Bug 709391 - hide Sync setup task in Launcher, make syncs return immediately. a=java-only, a=akeybl
authorRichard Newman <rnewman@mozilla.com>
Wed, 21 Dec 2011 08:44:08 -0800
changeset 84217 62cdb08ef4d31013f0535289930fd6f119bd03e3
parent 84216 4c20c43a09a002f9e23e0329c7c70af0de72fc0d
child 84218 699a36336685747b7c2f63d437d95e8d479da8b0
push id775
push userrnewman@mozilla.com
push dateThu, 26 Jan 2012 04:30:14 +0000
treeherdermozilla-aurora@b310cea4258c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjava-only, akeybl
bugs709391
milestone11.0a2
Bug 709391 - hide Sync setup task in Launcher, make syncs return immediately. a=java-only, a=akeybl
mobile/android/base/sync/syncadapter/SyncAdapter.java
mobile/android/sync/manifests/SyncAndroidManifest_activities.xml.in
--- a/mobile/android/base/sync/syncadapter/SyncAdapter.java
+++ b/mobile/android/base/sync/syncadapter/SyncAdapter.java
@@ -127,27 +127,33 @@ public class SyncAdapter extends Abstrac
     // From the docs: "This will be invoked on a separate thread than the sync
     // thread and so you must consider the multi-threaded implications of the
     // work that you do in this method."
   }
 
   public Object syncMonitor = new Object();
   private SyncResult syncResult;
 
+  public boolean shouldPerformSync = false;
+
   @Override
   public void onPerformSync(final Account account,
                             final Bundle extras,
                             final String authority,
                             final ContentProviderClient provider,
                             final SyncResult syncResult) {
 
     // TODO: don't clear the auth token unless we have a sync error.
     Log.i(LOG_TAG, "Got onPerformSync. Extras bundle is " + extras);
     Log.d(LOG_TAG, "Extras clusterURL: " + extras.getString("clusterURL"));
     Log.i(LOG_TAG, "Account name: " + account.name);
+    if (!shouldPerformSync) {
+      Log.i(LOG_TAG, "Not performing sync.");
+      return;
+    }
     Log.i(LOG_TAG, "XXX CLEARING AUTH TOKEN XXX");
     invalidateAuthToken(account);
 
     final SyncAdapter self = this;
     AccountManagerCallback<Bundle> callback = new AccountManagerCallback<Bundle>() {
       @Override
       public void run(AccountManagerFuture<Bundle> future) {
         Log.i(LOG_TAG, "AccountManagerCallback invoked.");
--- a/mobile/android/sync/manifests/SyncAndroidManifest_activities.xml.in
+++ b/mobile/android/sync/manifests/SyncAndroidManifest_activities.xml.in
@@ -1,22 +1,8 @@
-        <activity
-            android:icon="@drawable/sync_ic_launcher"
-            android:label="@string/sync_app_name"
-            android:launchMode="singleTask"
-            android:name="org.mozilla.gecko.sync.setup.activities.SetupSyncActivity" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-            <intent-filter>
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:scheme="sync" android:host="org.mozilla.android" android:path="/setup"/>
-            </intent-filter>
-        </activity>
         <activity
             android:clearTaskOnLaunch="true"
             android:launchMode="singleTask"
             android:name="org.mozilla.gecko.sync.setup.activities.AccountActivity"
             android:windowSoftInputMode="adjustResize"/>
         <activity
             android:name="org.mozilla.gecko.sync.setup.activities.SetupFailureActivity" />
         <activity