- Boot時に、pluginのServiceを立ち上げる。
- アプリケーションとして、ドロワーに表示される状態にし、Preferenceをキックするようにする。
この2点の対応で、ICSでもpluginが動作するようになります。
manifestに
<activity android:label="@string/app_name" android:name="com.sonyericsson.extras.liveview.plugins.PluginPreferences" android:launchMode="singleInstance">
</activity>
と
<receiver android:name=".LiveViewReceiver" android:enabled="true">
</receiver>
で、LiveviewReceiverで、こんな感じでServiceをキックする。
package jp.ddo.dekuyou.liveview.plugins.gmail;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class LiveViewSaverReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//
String action = intent.getAction();
if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
context.startService(new Intent(context, GmailPluginService.class));
}
}
}
するとなぜか、LiveviewアプリケーションのPreferenceにも表示されるようになり、無事動作するようになります。
せっかく、GingerBreadでのペアリング問題から開放されましたし、他のPluginも対応されると良いなと思う今日この頃です。
(根本的にはSonyが対応すべきだと思いますが。。。。)
ちなみに、smartwatchは先日のLivewareアプリのアップデートで対応されたみたいですね。