Loading services/core/java/com/android/server/am/ActivityManagerService.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -6455,6 +6455,7 @@ public final class ActivityManagerService extends ActivityManagerNative // 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 @@ -6531,6 +6532,8 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6590,6 +6593,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } ProfilerInfo profilerInfo = profileFile == null ? null ProfilerInfo profilerInfo = profileFile == null ? null : new ProfilerInfo(profileFile, profileFd, samplingInterval, profileAutoStop); : new ProfilerInfo(profileFile, profileFd, samplingInterval, profileAutoStop); 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 @@ -6598,7 +6602,9 @@ public final class ActivityManagerService extends ActivityManagerNative new Configuration(mConfiguration), app.compat, new Configuration(mConfiguration), app.compat, getCommonServicesLocked(app.isolated), getCommonServicesLocked(app.isolated), mCoreSettingsObserver.getCoreSettingsLocked()); mCoreSettingsObserver.getCoreSettingsLocked()); 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 @@ -6637,6 +6643,7 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6647,6 +6654,7 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6678,6 +6686,7 @@ public final class ActivityManagerService extends ActivityManagerNative 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 +11 −2 Original line number Original line Diff line number Diff line Loading @@ -6455,6 +6455,7 @@ public final class ActivityManagerService extends ActivityManagerNative // 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 @@ -6531,6 +6532,8 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6590,6 +6593,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } ProfilerInfo profilerInfo = profileFile == null ? null ProfilerInfo profilerInfo = profileFile == null ? null : new ProfilerInfo(profileFile, profileFd, samplingInterval, profileAutoStop); : new ProfilerInfo(profileFile, profileFd, samplingInterval, profileAutoStop); 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 @@ -6598,7 +6602,9 @@ public final class ActivityManagerService extends ActivityManagerNative new Configuration(mConfiguration), app.compat, new Configuration(mConfiguration), app.compat, getCommonServicesLocked(app.isolated), getCommonServicesLocked(app.isolated), mCoreSettingsObserver.getCoreSettingsLocked()); mCoreSettingsObserver.getCoreSettingsLocked()); 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 @@ -6637,6 +6643,7 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6647,6 +6654,7 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ -6678,6 +6686,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (!didSomething) { if (!didSomething) { updateOomAdjLocked(); updateOomAdjLocked(); checkTime(startTime, "attachApplicationLocked: after updateOomAdjLocked"); } } return true; return true; Loading