Loading services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -6415,6 +6415,7 @@ public class ActivityManagerService extends IActivityManager.Stub // the pid if we are running in multiple processes, or just pull the // the pid if we are running in multiple processes, or just pull the // next app record if we are emulating process with anonymous threads. // next app record if we are emulating process with anonymous threads. ProcessRecord app; ProcessRecord app; long startTime = SystemClock.uptimeMillis(); if (pid != MY_PID && pid >= 0) { if (pid != MY_PID && pid >= 0) { synchronized (mPidsSelfLocked) { synchronized (mPidsSelfLocked) { app = mPidsSelfLocked.get(pid); app = mPidsSelfLocked.get(pid); Loading Loading @@ -6493,6 +6494,8 @@ public class ActivityManagerService extends IActivityManager.Stub mHandler.sendMessageDelayed(msg, CONTENT_PROVIDER_PUBLISH_TIMEOUT); mHandler.sendMessageDelayed(msg, CONTENT_PROVIDER_PUBLISH_TIMEOUT); } } checkTime(startTime, "attachApplicationLocked: before bindApplication"); if (!normalMode) { if (!normalMode) { Slog.i(TAG, "Launching preboot mode app: " + app); Slog.i(TAG, "Launching preboot mode app: " + app); } } Loading Loading @@ -6564,6 +6567,7 @@ public class ActivityManagerService extends IActivityManager.Stub .getSerial(); .getSerial(); // } // } checkTime(startTime, "attachApplicationLocked: immediately before bindApplication"); thread.bindApplication(processName, appInfo, providers, app.instrumentationClass, thread.bindApplication(processName, appInfo, providers, app.instrumentationClass, profilerInfo, app.instrumentationArguments, app.instrumentationWatcher, profilerInfo, app.instrumentationArguments, app.instrumentationWatcher, app.instrumentationUiAutomationConnection, testMode, app.instrumentationUiAutomationConnection, testMode, Loading @@ -6574,7 +6578,9 @@ public class ActivityManagerService extends IActivityManager.Stub mCoreSettingsObserver.getCoreSettingsLocked(), mCoreSettingsObserver.getCoreSettingsLocked(), buildSerial); buildSerial); checkTime(startTime, "attachApplicationLocked: immediately after bindApplication"); updateLruProcessLocked(app, false, null); updateLruProcessLocked(app, false, null); checkTime(startTime, "attachApplicationLocked: after updateLruProcessLocked"); app.lastRequestedGc = app.lastLowMemory = SystemClock.uptimeMillis(); app.lastRequestedGc = app.lastLowMemory = SystemClock.uptimeMillis(); } catch (Exception e) { } catch (Exception e) { // todo: Yikes! What should we do? For now we will try to // todo: Yikes! What should we do? For now we will try to Loading Loading @@ -6613,6 +6619,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!badApp) { if (!badApp) { try { try { didSomething |= mServices.attachApplicationLocked(app, processName); didSomething |= mServices.attachApplicationLocked(app, processName); checkTime(startTime, "attachApplicationLocked: after mServices.attachApplicationLocked"); } catch (Exception e) { } catch (Exception e) { Slog.wtf(TAG, "Exception thrown starting services in " + app, e); Slog.wtf(TAG, "Exception thrown starting services in " + app, e); badApp = true; badApp = true; Loading @@ -6623,6 +6630,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!badApp && isPendingBroadcastProcessLocked(pid)) { if (!badApp && isPendingBroadcastProcessLocked(pid)) { try { try { didSomething |= sendPendingBroadcastsLocked(app); didSomething |= sendPendingBroadcastsLocked(app); checkTime(startTime, "attachApplicationLocked: after sendPendingBroadcastsLocked"); } catch (Exception e) { } catch (Exception e) { // If the app died trying to launch the receiver we declare it 'bad' // If the app died trying to launch the receiver we declare it 'bad' Slog.wtf(TAG, "Exception thrown dispatching broadcasts in " + app, e); Slog.wtf(TAG, "Exception thrown dispatching broadcasts in " + app, e); Loading Loading @@ -6654,6 +6662,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!didSomething) { if (!didSomething) { updateOomAdjLocked(); updateOomAdjLocked(); checkTime(startTime, "attachApplicationLocked: after updateOomAdjLocked"); } } return true; return true; Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -6415,6 +6415,7 @@ public class ActivityManagerService extends IActivityManager.Stub // the pid if we are running in multiple processes, or just pull the // the pid if we are running in multiple processes, or just pull the // next app record if we are emulating process with anonymous threads. // next app record if we are emulating process with anonymous threads. ProcessRecord app; ProcessRecord app; long startTime = SystemClock.uptimeMillis(); if (pid != MY_PID && pid >= 0) { if (pid != MY_PID && pid >= 0) { synchronized (mPidsSelfLocked) { synchronized (mPidsSelfLocked) { app = mPidsSelfLocked.get(pid); app = mPidsSelfLocked.get(pid); Loading Loading @@ -6493,6 +6494,8 @@ public class ActivityManagerService extends IActivityManager.Stub mHandler.sendMessageDelayed(msg, CONTENT_PROVIDER_PUBLISH_TIMEOUT); mHandler.sendMessageDelayed(msg, CONTENT_PROVIDER_PUBLISH_TIMEOUT); } } checkTime(startTime, "attachApplicationLocked: before bindApplication"); if (!normalMode) { if (!normalMode) { Slog.i(TAG, "Launching preboot mode app: " + app); Slog.i(TAG, "Launching preboot mode app: " + app); } } Loading Loading @@ -6564,6 +6567,7 @@ public class ActivityManagerService extends IActivityManager.Stub .getSerial(); .getSerial(); // } // } checkTime(startTime, "attachApplicationLocked: immediately before bindApplication"); thread.bindApplication(processName, appInfo, providers, app.instrumentationClass, thread.bindApplication(processName, appInfo, providers, app.instrumentationClass, profilerInfo, app.instrumentationArguments, app.instrumentationWatcher, profilerInfo, app.instrumentationArguments, app.instrumentationWatcher, app.instrumentationUiAutomationConnection, testMode, app.instrumentationUiAutomationConnection, testMode, Loading @@ -6574,7 +6578,9 @@ public class ActivityManagerService extends IActivityManager.Stub mCoreSettingsObserver.getCoreSettingsLocked(), mCoreSettingsObserver.getCoreSettingsLocked(), buildSerial); buildSerial); checkTime(startTime, "attachApplicationLocked: immediately after bindApplication"); updateLruProcessLocked(app, false, null); updateLruProcessLocked(app, false, null); checkTime(startTime, "attachApplicationLocked: after updateLruProcessLocked"); app.lastRequestedGc = app.lastLowMemory = SystemClock.uptimeMillis(); app.lastRequestedGc = app.lastLowMemory = SystemClock.uptimeMillis(); } catch (Exception e) { } catch (Exception e) { // todo: Yikes! What should we do? For now we will try to // todo: Yikes! What should we do? For now we will try to Loading Loading @@ -6613,6 +6619,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!badApp) { if (!badApp) { try { try { didSomething |= mServices.attachApplicationLocked(app, processName); didSomething |= mServices.attachApplicationLocked(app, processName); checkTime(startTime, "attachApplicationLocked: after mServices.attachApplicationLocked"); } catch (Exception e) { } catch (Exception e) { Slog.wtf(TAG, "Exception thrown starting services in " + app, e); Slog.wtf(TAG, "Exception thrown starting services in " + app, e); badApp = true; badApp = true; Loading @@ -6623,6 +6630,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!badApp && isPendingBroadcastProcessLocked(pid)) { if (!badApp && isPendingBroadcastProcessLocked(pid)) { try { try { didSomething |= sendPendingBroadcastsLocked(app); didSomething |= sendPendingBroadcastsLocked(app); checkTime(startTime, "attachApplicationLocked: after sendPendingBroadcastsLocked"); } catch (Exception e) { } catch (Exception e) { // If the app died trying to launch the receiver we declare it 'bad' // If the app died trying to launch the receiver we declare it 'bad' Slog.wtf(TAG, "Exception thrown dispatching broadcasts in " + app, e); Slog.wtf(TAG, "Exception thrown dispatching broadcasts in " + app, e); Loading Loading @@ -6654,6 +6662,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (!didSomething) { if (!didSomething) { updateOomAdjLocked(); updateOomAdjLocked(); checkTime(startTime, "attachApplicationLocked: after updateOomAdjLocked"); } } return true; return true; Loading