support for changes to the sync settings and control API
This commit is contained in:
@@ -278,13 +278,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {
|
|||||||
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
boolean sync = getBackgroundDataState(context);
|
boolean sync = getBackgroundDataState(context);
|
||||||
connManager.setBackgroundDataSetting(!sync);
|
connManager.setBackgroundDataSetting(!sync);
|
||||||
|
ContentResolver.setMasterSyncAutomatically(!sync);
|
||||||
IContentService contentService = ContentResolver.getContentService();
|
|
||||||
try {
|
|
||||||
contentService.setListenForNetworkTickles(!sync);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.d(TAG, "toggleBackgroundData: " + e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user