diff options
4 files changed, 16 insertions, 17 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index d61b561b158e..6c0517387176 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -690,17 +690,17 @@ public class LockSettingsService extends ILockSettings.Stub { final IProgressListener listener = new IProgressListener.Stub() { @Override public void onStarted(int id, Bundle extras) throws RemoteException { - // Ignored + Log.d(TAG, "unlockUser started"); } @Override public void onProgress(int id, int progress, Bundle extras) throws RemoteException { - // Ignored + Log.d(TAG, "unlockUser progress " + progress); } @Override public void onFinished(int id, Bundle extras) throws RemoteException { - Log.d(TAG, "unlockUser finished!"); + Log.d(TAG, "unlockUser finished"); latch.countDown(); } }; diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 6138ef43d073..60653d5f3af8 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1945,6 +1945,9 @@ public final class ActivityManagerService extends ActivityManagerNative startPersistentApps(PackageManager.MATCH_DIRECT_BOOT_UNAWARE); } installEncryptionUnawareProviders(userId); + if (msg.obj instanceof ProgressReporter) { + ((ProgressReporter) msg.obj).finish(); + } break; } case SYSTEM_USER_CURRENT_MSG: { diff --git a/services/core/java/com/android/server/am/PreBootBroadcaster.java b/services/core/java/com/android/server/am/PreBootBroadcaster.java index 0e192eab498f..1f3ccf530f71 100644 --- a/services/core/java/com/android/server/am/PreBootBroadcaster.java +++ b/services/core/java/com/android/server/am/PreBootBroadcaster.java @@ -78,9 +78,12 @@ public abstract class PreBootBroadcaster extends IIntentReceiver.Stub { final ResolveInfo ri = mTargets.get(mIndex++); final ComponentName componentName = ri.activityInfo.getComponentName(); - final CharSequence label = ri.activityInfo.loadLabel(mService.mContext.getPackageManager()); - mProgress.setProgress(mIndex, mTargets.size(), - mService.mContext.getString(R.string.android_preparing_apk, label)); + if (mProgress != null) { + final CharSequence label = ri.activityInfo + .loadLabel(mService.mContext.getPackageManager()); + mProgress.setProgress(mIndex, mTargets.size(), + mService.mContext.getString(R.string.android_preparing_apk, label)); + } Slog.i(TAG, "Pre-boot of " + componentName.toShortString() + " for user " + mUserId); EventLogTags.writeAmPreBoot(mUserId, componentName.getPackageName()); diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index 4c050c461d9d..75d49c3ba8fc 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -101,6 +101,7 @@ import java.util.Set; */ final class UserController { private static final String TAG = TAG_WITH_CLASS_NAME ? "UserController" : TAG_AM; + // Maximum number of users we allow to be running at a time. static final int MAX_RUNNING_USERS = 3; @@ -279,7 +280,8 @@ final class UserController { uss.mUnlockProgress.setProgress(20); // Dispatch unlocked to system services - mHandler.sendMessage(mHandler.obtainMessage(SYSTEM_USER_UNLOCK_MSG, userId, 0)); + mHandler.obtainMessage(SYSTEM_USER_UNLOCK_MSG, userId, 0, uss.mUnlockProgress) + .sendToTarget(); // Dispatch unlocked to external apps final Intent unlockedIntent = new Intent(Intent.ACTION_USER_UNLOCKED); @@ -309,8 +311,7 @@ final class UserController { // Send PRE_BOOT broadcasts if fingerprint changed final UserInfo info = getUserInfo(userId); if (!Objects.equals(info.lastLoggedInFingerprint, Build.FINGERPRINT)) { - uss.mUnlockProgress.startSegment(80); - new PreBootBroadcaster(mService, userId, uss.mUnlockProgress) { + new PreBootBroadcaster(mService, userId, null) { @Override public void onFinished() { finishUserUnlocked(uss); @@ -328,14 +329,6 @@ final class UserController { * {@link UserState#STATE_RUNNING_UNLOCKED}. */ private void finishUserUnlocked(UserState uss) { - try { - finishUserUnlockedInternal(uss); - } finally { - uss.mUnlockProgress.finish(); - } - } - - private void finishUserUnlockedInternal(UserState uss) { final int userId = uss.mHandle.getIdentifier(); synchronized (mService) { // Bail if we ended up with a stale user |