Loading services/java/com/android/server/am/ActivityManagerService.java +9 −10 Original line number Diff line number Diff line Loading @@ -866,8 +866,6 @@ public final class ActivityManagerService extends ActivityManagerNative static ActivityManagerService mSelf; static ActivityThread mSystemThread; private Looper mLooper; private int mCurrentUserId = 0; private UserManagerService mUserManager; Loading Loading @@ -1469,7 +1467,6 @@ public final class ActivityManagerService extends ActivityManagerNative context.setTheme(android.R.style.Theme_Holo); m.mContext = context; m.mFactoryTest = factoryTest; m.mLooper = thr.mLooper; m.mStackSupervisor = new ActivityStackSupervisor(m, context, thr.mLooper); m.mStackSupervisor.init(); Loading Loading @@ -2524,6 +2521,7 @@ public final class ActivityManagerService extends ActivityManagerNative mPendingActivityLaunches.clear(); } @Override public final int startActivity(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Loading Loading @@ -2575,6 +2573,7 @@ public final class ActivityManagerService extends ActivityManagerNative return ret; } @Override public int startActivityIntentSender(IApplicationThread caller, IntentSender intent, Intent fillInIntent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, Loading Loading @@ -7013,7 +7012,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Actually is sleeping or shutting down or whatever else in the future // is an inactive state. public boolean isSleeping() { public boolean isSleepingOrShuttingDown() { return mSleeping || mShuttingDown; } Loading services/java/com/android/server/am/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ final class ActivityRecord { pw.print(prefix); pw.print("packageName="); pw.print(packageName); pw.print(" processName="); pw.println(processName); pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid); pw.print(" launchedFromPackage="); pw.println(launchedFromPackage); pw.print(" launchedFromPackage="); pw.print(launchedFromPackage); pw.print(" userId="); pw.println(userId); pw.print(prefix); pw.print("app="); pw.println(app); pw.print(prefix); pw.println(intent.toInsecureStringWithClip()); Loading services/java/com/android/server/am/ActivityStack.java +10 −12 Original line number Diff line number Diff line Loading @@ -344,7 +344,7 @@ final class ActivityStack { switch (msg.what) { case SLEEP_TIMEOUT_MSG: { synchronized (mService) { if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { Slog.w(TAG, "Sleep timeout! Sleeping now."); mSleepTimeout = true; checkReadyForSleepLocked(); Loading Loading @@ -875,7 +875,7 @@ final class ActivityStack { } void stopIfSleepingLocked() { if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { if (!mGoingToSleep.isHeld()) { mGoingToSleep.acquire(); if (mLaunchingActivity.isHeld()) { Loading Loading @@ -912,7 +912,7 @@ final class ActivityStack { } void checkReadyForSleepLocked() { if (!mService.isSleeping()) { if (!mService.isSleepingOrShuttingDown()) { // Do not care. return; } Loading Loading @@ -1003,14 +1003,13 @@ final class ActivityStack { private final void startPausingLocked(boolean userLeaving, boolean uiSleeping) { if (mPausingActivity != null) { RuntimeException e = new RuntimeException(); Slog.e(TAG, "Trying to pause when pause is already pending for " + mPausingActivity, e); + mPausingActivity, new RuntimeException("here").fillInStackTrace()); } ActivityRecord prev = mResumedActivity; if (prev == null) { RuntimeException e = new RuntimeException(); Slog.e(TAG, "Trying to pause when nothing is resumed", e); Slog.e(TAG, "Trying to pause when nothing is resumed", new RuntimeException("here").fillInStackTrace()); resumeTopActivityLocked(null); return; } Loading Loading @@ -1049,7 +1048,7 @@ final class ActivityStack { // If we are not going to sleep, we want to ensure the device is // awake until the next activity is started. if (!mService.mSleeping && !mService.mShuttingDown) { if (!mService.isSleepingOrShuttingDown()) { mLaunchingActivity.acquire(); if (!mHandler.hasMessages(LAUNCH_TIMEOUT_MSG)) { // To be safe, don't allow the wake lock to be held for too long. Loading @@ -1058,7 +1057,6 @@ final class ActivityStack { } } if (mPausingActivity != null) { // Have the window manager pause its key dispatching until the new // activity has started. If we're pausing the activity just because Loading Loading @@ -1205,7 +1203,7 @@ final class ActivityStack { mPausingActivity = null; } if (!mService.isSleeping()) { if (!mService.isSleepingOrShuttingDown()) { resumeTopActivityLocked(prev); } else { checkReadyForSleepLocked(); Loading Loading @@ -3375,7 +3373,7 @@ final class ActivityStack { mService.mWindowManager.setAppVisibility(r.appToken, false); } r.app.thread.scheduleStopActivity(r.appToken, r.visible, r.configChangeFlags); if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { r.setSleeping(true); } Message msg = mHandler.obtainMessage(STOP_TIMEOUT_MSG); Loading Loading @@ -3425,7 +3423,7 @@ final class ActivityStack { mService.mWindowManager.setAppVisibility(s.appToken, false); } } if ((!s.waitingVisible || mService.isSleeping()) && remove) { if ((!s.waitingVisible || mService.isSleepingOrShuttingDown()) && remove) { if (localLOGV) Slog.v(TAG, "Ready to stop: " + s); if (stops == null) { stops = new ArrayList<ActivityRecord>(); Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +9 −10 Original line number Diff line number Diff line Loading @@ -866,8 +866,6 @@ public final class ActivityManagerService extends ActivityManagerNative static ActivityManagerService mSelf; static ActivityThread mSystemThread; private Looper mLooper; private int mCurrentUserId = 0; private UserManagerService mUserManager; Loading Loading @@ -1469,7 +1467,6 @@ public final class ActivityManagerService extends ActivityManagerNative context.setTheme(android.R.style.Theme_Holo); m.mContext = context; m.mFactoryTest = factoryTest; m.mLooper = thr.mLooper; m.mStackSupervisor = new ActivityStackSupervisor(m, context, thr.mLooper); m.mStackSupervisor.init(); Loading Loading @@ -2524,6 +2521,7 @@ public final class ActivityManagerService extends ActivityManagerNative mPendingActivityLaunches.clear(); } @Override public final int startActivity(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Loading Loading @@ -2575,6 +2573,7 @@ public final class ActivityManagerService extends ActivityManagerNative return ret; } @Override public int startActivityIntentSender(IApplicationThread caller, IntentSender intent, Intent fillInIntent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, Loading Loading @@ -7013,7 +7012,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Actually is sleeping or shutting down or whatever else in the future // is an inactive state. public boolean isSleeping() { public boolean isSleepingOrShuttingDown() { return mSleeping || mShuttingDown; } Loading
services/java/com/android/server/am/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ final class ActivityRecord { pw.print(prefix); pw.print("packageName="); pw.print(packageName); pw.print(" processName="); pw.println(processName); pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid); pw.print(" launchedFromPackage="); pw.println(launchedFromPackage); pw.print(" launchedFromPackage="); pw.print(launchedFromPackage); pw.print(" userId="); pw.println(userId); pw.print(prefix); pw.print("app="); pw.println(app); pw.print(prefix); pw.println(intent.toInsecureStringWithClip()); Loading
services/java/com/android/server/am/ActivityStack.java +10 −12 Original line number Diff line number Diff line Loading @@ -344,7 +344,7 @@ final class ActivityStack { switch (msg.what) { case SLEEP_TIMEOUT_MSG: { synchronized (mService) { if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { Slog.w(TAG, "Sleep timeout! Sleeping now."); mSleepTimeout = true; checkReadyForSleepLocked(); Loading Loading @@ -875,7 +875,7 @@ final class ActivityStack { } void stopIfSleepingLocked() { if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { if (!mGoingToSleep.isHeld()) { mGoingToSleep.acquire(); if (mLaunchingActivity.isHeld()) { Loading Loading @@ -912,7 +912,7 @@ final class ActivityStack { } void checkReadyForSleepLocked() { if (!mService.isSleeping()) { if (!mService.isSleepingOrShuttingDown()) { // Do not care. return; } Loading Loading @@ -1003,14 +1003,13 @@ final class ActivityStack { private final void startPausingLocked(boolean userLeaving, boolean uiSleeping) { if (mPausingActivity != null) { RuntimeException e = new RuntimeException(); Slog.e(TAG, "Trying to pause when pause is already pending for " + mPausingActivity, e); + mPausingActivity, new RuntimeException("here").fillInStackTrace()); } ActivityRecord prev = mResumedActivity; if (prev == null) { RuntimeException e = new RuntimeException(); Slog.e(TAG, "Trying to pause when nothing is resumed", e); Slog.e(TAG, "Trying to pause when nothing is resumed", new RuntimeException("here").fillInStackTrace()); resumeTopActivityLocked(null); return; } Loading Loading @@ -1049,7 +1048,7 @@ final class ActivityStack { // If we are not going to sleep, we want to ensure the device is // awake until the next activity is started. if (!mService.mSleeping && !mService.mShuttingDown) { if (!mService.isSleepingOrShuttingDown()) { mLaunchingActivity.acquire(); if (!mHandler.hasMessages(LAUNCH_TIMEOUT_MSG)) { // To be safe, don't allow the wake lock to be held for too long. Loading @@ -1058,7 +1057,6 @@ final class ActivityStack { } } if (mPausingActivity != null) { // Have the window manager pause its key dispatching until the new // activity has started. If we're pausing the activity just because Loading Loading @@ -1205,7 +1203,7 @@ final class ActivityStack { mPausingActivity = null; } if (!mService.isSleeping()) { if (!mService.isSleepingOrShuttingDown()) { resumeTopActivityLocked(prev); } else { checkReadyForSleepLocked(); Loading Loading @@ -3375,7 +3373,7 @@ final class ActivityStack { mService.mWindowManager.setAppVisibility(r.appToken, false); } r.app.thread.scheduleStopActivity(r.appToken, r.visible, r.configChangeFlags); if (mService.isSleeping()) { if (mService.isSleepingOrShuttingDown()) { r.setSleeping(true); } Message msg = mHandler.obtainMessage(STOP_TIMEOUT_MSG); Loading Loading @@ -3425,7 +3423,7 @@ final class ActivityStack { mService.mWindowManager.setAppVisibility(s.appToken, false); } } if ((!s.waitingVisible || mService.isSleeping()) && remove) { if ((!s.waitingVisible || mService.isSleepingOrShuttingDown()) && remove) { if (localLOGV) Slog.v(TAG, "Ready to stop: " + s); if (stops == null) { stops = new ArrayList<ActivityRecord>(); Loading