</intent-filter>
</activity>
- <receiver android:name=".widget.SettingsAppWidgetProvider" android:label="@string/gadget_title">
+ <receiver android:name=".widget.SettingsAppWidgetProvider"
+ android:label="@string/gadget_title" android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.net.conn.BACKGROUND_DATA_SETTING_CHANGED" />
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
<action android:name="android.location.PROVIDERS_CHANGED" />
- <!-- hack: using CLOSE_SYSTEM_DIALOGS to pick up (possible) sync changes -->
- <action android:name="android.intent.action.CLOSE_SYSTEM_DIALOGS" />
+ <action android:name="com.android.sync.SYNC_CONN_STATUS_CHANGED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
-import android.content.IContentService;
import android.content.Intent;
+import android.content.SyncStorageEngine;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.net.ConnectivityManager;
@Override
public void onActualStateChange(Context context, Intent unused) {
- // Well, ACTION_CLOSE_SYSTEM_DIALOGS fired. So _maybe_
- // the Sync settings changed.
- // TODO: find something more reliable.
setCurrentState(context, getActualState(context));
}
sBluetoothState.onActualStateChange(context, intent);
} else if (LocationManager.PROVIDERS_CHANGED_ACTION.equals(action)) {
sGpsState.onActualStateChange(context, intent);
- } else if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
- // Sadly, for lack of a "sync settings changed" intent,
- // this is where we check where sync is enabled or not.
- // It's not 100% reliable though as there are paths where
- // this doesn't fire.
+ } else if (SyncStorageEngine.SYNC_CONNECTION_SETTING_CHANGED_INTENT.getAction()
+ .equals(action)) {
sSyncState.onActualStateChange(context, intent);
} else if (intent.hasCategory(Intent.CATEGORY_ALTERNATIVE)) {
Uri data = intent.getData();