Merge "Remember the process that token was added for also for the services that are already running" into qt-dev

am: b112f3f62b

Change-Id: Iec5d33e530f2ea35938da5c9bc7133f676e11d7f
This commit is contained in:
Michal Karpinski
2019-05-23 05:46:59 -07:00
committed by android-build-merger

View File

@@ -551,12 +551,10 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
.removeAllowBackgroundActivityStartsToken(this);
ams.mHandler.removeCallbacks(mStartedWhitelistingBgActivityStartsCleanUp);
}
mAppForStartedWhitelistingBgActivityStarts = null;
}
if (mHasStartedWhitelistingBgActivityStarts) {
// Make sure the cleanup callback knows about the new process.
mAppForStartedWhitelistingBgActivityStarts = _proc;
}
// Make sure the cleanup callback knows about the new process.
mAppForStartedWhitelistingBgActivityStarts = mHasStartedWhitelistingBgActivityStarts
? _proc : null;
if (mHasStartedWhitelistingBgActivityStarts
|| mHasBindingWhitelistingBgActivityStarts) {
_proc.addAllowBackgroundActivityStartsToken(this);
@@ -656,6 +654,9 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
*/
void whitelistBgActivityStartsOnServiceStart() {
setHasStartedWhitelistingBgActivityStarts(true);
if (app != null) {
mAppForStartedWhitelistingBgActivityStarts = app;
}
// This callback is stateless, so we create it once when we first need it.
if (mStartedWhitelistingBgActivityStartsCleanUp == null) {