diff options
Diffstat (limited to 'services')
5 files changed, 56 insertions, 27 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 989477f..db042b5 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -1794,7 +1794,7 @@ public final class ActivityManagerService extends ActivityManagerNative } private final void updateLruProcessInternalLocked(ProcessRecord app, - boolean oomAdj, boolean updateActivityTime, int bestPos) { + boolean updateActivityTime, int bestPos) { // put it on the LRU to keep track of when it should be exited. int lrui = mLruProcesses.indexOf(app); if (lrui >= 0) mLruProcesses.remove(lrui); @@ -1851,7 +1851,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (cr.binding != null && cr.binding.service != null && cr.binding.service.app != null && cr.binding.service.app.lruSeq != mLruSeq) { - updateLruProcessInternalLocked(cr.binding.service.app, false, + updateLruProcessInternalLocked(cr.binding.service.app, updateActivityTime, i+1); } } @@ -1859,21 +1859,21 @@ public final class ActivityManagerService extends ActivityManagerNative for (int j=app.conProviders.size()-1; j>=0; j--) { ContentProviderRecord cpr = app.conProviders.get(j).provider; if (cpr.proc != null && cpr.proc.lruSeq != mLruSeq) { - updateLruProcessInternalLocked(cpr.proc, false, + updateLruProcessInternalLocked(cpr.proc, updateActivityTime, i+1); } } - - //Slog.i(TAG, "Putting proc to front: " + app.processName); - if (oomAdj) { - updateOomAdjLocked(); - } } final void updateLruProcessLocked(ProcessRecord app, boolean oomAdj, boolean updateActivityTime) { mLruSeq++; - updateLruProcessInternalLocked(app, oomAdj, updateActivityTime, 0); + updateLruProcessInternalLocked(app, updateActivityTime, 0); + + //Slog.i(TAG, "Putting proc to front: " + app.processName); + if (oomAdj) { + updateOomAdjLocked(); + } } final ProcessRecord getProcessRecordLocked( @@ -4455,7 +4455,13 @@ public final class ActivityManagerService extends ActivityManagerNative enableScreenAfterBoot(); } } - + + public final void activityResumed(IBinder token) { + final long origId = Binder.clearCallingIdentity(); + mMainStack.activityResumed(token); + Binder.restoreCallingIdentity(origId); + } + public final void activityPaused(IBinder token) { final long origId = Binder.clearCallingIdentity(); mMainStack.activityPaused(token, false); diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index f72d318..29ee0bc 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -52,7 +52,6 @@ import android.os.IBinder; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.PowerManager; -import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; @@ -755,8 +754,6 @@ final class ActivityStack { completeResumeLocked(r); checkReadyForSleepLocked(); if (DEBUG_SAVED_STATE) Slog.i(TAG, "Launch completed; removing icicle of " + r.icicle); - r.icicle = null; - r.haveState = false; } else { // This activity is not starting in the resumed state... which // should look like we asked it to pause+stop (but remain visible), @@ -1010,7 +1007,21 @@ final class ActivityStack { resumeTopActivityLocked(null); } } - + + final void activityResumed(IBinder token) { + ActivityRecord r = null; + + synchronized (mService) { + int index = indexOfTokenLocked(token); + if (index >= 0) { + r = mHistory.get(index); + if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; dropping state of: " + r); + r.icicle = null; + r.haveState = false; + } + } + } + final void activityPaused(IBinder token, boolean timeout) { if (DEBUG_PAUSE) Slog.v( TAG, "Activity paused: token=" + token + ", timeout=" + timeout); @@ -1488,6 +1499,15 @@ final class ActivityStack { // can be resumed... if (mResumedActivity != null) { if (DEBUG_SWITCH) Slog.v(TAG, "Skip resume: need to start pausing"); + // At this point we want to put the upcoming activity's process + // at the top of the LRU list, since we know we will be needing it + // very soon and it would be a waste to let it get killed if it + // happens to be sitting towards the end. + if (next.app != null && next.app.thread != null) { + // No reason to do full oom adj update here; we'll let that + // happen whenever it needs to later. + mService.updateLruProcessLocked(next.app, false, true); + } startPausingLocked(userLeaving, false); return true; } @@ -1728,11 +1748,6 @@ final class ActivityStack { "resume-exception", true); return true; } - - // Didn't need to use the icicle, and it is now out of date. - if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; didn't need icicle of: " + next); - next.icicle = null; - next.haveState = false; next.stopped = false; } else { @@ -2578,7 +2593,6 @@ final class ActivityStack { mDismissKeyguardOnNextActivity = false; mService.mWindowManager.dismissKeyguard(); } - Slog.i(TAG, "DONE STARTING!"); return err; } diff --git a/services/java/com/android/server/display/WifiDisplayController.java b/services/java/com/android/server/display/WifiDisplayController.java index 87e11e6..3bc19a1 100644 --- a/services/java/com/android/server/display/WifiDisplayController.java +++ b/services/java/com/android/server/display/WifiDisplayController.java @@ -485,6 +485,8 @@ final class WifiDisplayController implements DumpUtils.Dump { mConnectingDevice = mDesiredDevice; WifiP2pConfig config = new WifiP2pConfig(); config.deviceAddress = mConnectingDevice.deviceAddress; + // Helps with STA & P2P concurrency + config.groupOwnerIntent = WifiP2pConfig.MAX_GO_INTENT; final WifiDisplay display = createWifiDisplay(mConnectingDevice); mHandler.post(new Runnable() { diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index ce52d2b..536c612 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -3535,8 +3535,8 @@ public class PackageManagerService extends IPackageManager.Stub { return DEX_OPT_DEFERRED; } else { Log.i(TAG, "Running dexopt on: " + pkg.applicationInfo.packageName); - ret = mInstaller.dexopt(path, pkg.applicationInfo.uid, - !isForwardLocked(pkg)); + final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid); + ret = mInstaller.dexopt(path, sharedGid, !isForwardLocked(pkg)); pkg.mDidDexOpt = true; performed = true; } diff --git a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java index c1f45a8..a74a648 100644 --- a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java +++ b/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java @@ -89,12 +89,15 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { // get the hash of the currently used value String currentHash = getCurrentHash(getCurrentContent()); if (!verifyVersion(currentVersion, altVersion)) { - Slog.e(TAG, "New version is not greater than current version, aborting!"); + EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, + "New version is not greater than current version"); } else if (!verifyPreviousHash(currentHash, altRequiredHash)) { - Slog.e(TAG, "Current hash did not match required value, aborting!"); + EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, + "Current hash did not match required value"); } else if (!verifySignature(altContent, altVersion, altRequiredHash, altSig, cert)) { - Slog.e(TAG, "Signature did not verify, aborting!"); + EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, + "Signature did not verify"); } else { // install the new content Slog.i(TAG, "Found new update, installing..."); @@ -103,8 +106,12 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { } } catch (Exception e) { Slog.e(TAG, "Could not update content!", e); - EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, - updateDir.toString()); + // keep the error message <= 100 chars + String errMsg = e.toString(); + if (errMsg.length() > 100) { + errMsg = errMsg.substring(0, 99); + } + EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, errMsg); } } }.start(); |