Skip to content

Commit bd4f218

Browse files
jsharkeyAndroid (Google) Code Review
authored andcommitted
Merge "Defer more Account actions until user starting." into jb-mr1-dev
2 parents 3e336bd + e4996bb commit bd4f218

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

core/java/android/accounts/AccountManagerService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ public void onReceive(Context context, Intent intent) {
247247
}
248248

249249
public void systemReady() {
250-
initUser(UserHandle.USER_OWNER);
251250
}
252251

253252
private UserManager getUserManager() {

core/java/android/content/SyncManager.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import android.util.EventLog;
5656
import android.util.Log;
5757
import android.util.Pair;
58+
import android.util.Slog;
5859

5960
import com.android.internal.R;
6061
import com.android.internal.util.IndentingPrintWriter;
@@ -311,13 +312,10 @@ public void onReceive(Context context, Intent intent) {
311312
if (userId == UserHandle.USER_NULL) return;
312313

313314
if (Intent.ACTION_USER_REMOVED.equals(action)) {
314-
Log.i(TAG, "User removed: u" + userId);
315315
onUserRemoved(userId);
316316
} else if (Intent.ACTION_USER_STARTING.equals(action)) {
317-
Log.i(TAG, "User starting: u" + userId);
318317
onUserStarting(userId);
319318
} else if (Intent.ACTION_USER_STOPPING.equals(action)) {
320-
Log.i(TAG, "User stopping: u" + userId);
321319
onUserStopping(userId);
322320
}
323321
}
@@ -338,6 +336,10 @@ private ConnectivityManager getConnectivityManager() {
338336
}
339337
}
340338

339+
/**
340+
* Should only be created after {@link ContentService#systemReady()} so that
341+
* {@link PackageManager} is ready to query.
342+
*/
341343
public SyncManager(Context context, boolean factoryTest) {
342344
// Initialize the SyncStorageEngine first, before registering observers
343345
// and creating threads and so on; it may fail if the disk is full.
@@ -441,9 +443,6 @@ public void onStatusChanged(int which) {
441443
UserHandle.ALL,
442444
new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION),
443445
null, null);
444-
445-
// do this synchronously to ensure we have the accounts before this call returns
446-
onUserStarting(UserHandle.USER_OWNER);
447446
}
448447

449448
// Pick a random second in a day to seed all periodic syncs

core/java/android/content/SyncQueue.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public class SyncQueue {
5151
public SyncQueue(SyncStorageEngine syncStorageEngine, final SyncAdaptersCache syncAdapters) {
5252
mSyncStorageEngine = syncStorageEngine;
5353
mSyncAdapters = syncAdapters;
54-
55-
addPendingOperations(UserHandle.USER_OWNER);
5654
}
5755

5856
public void addPendingOperations(int userId) {

0 commit comments

Comments
 (0)