diff options
| author | 2019-05-23 10:58:00 +0000 | |
|---|---|---|
| committer | 2019-05-23 10:58:00 +0000 | |
| commit | b112f3f62b354633b1afd9e5ced5b718baee67fe (patch) | |
| tree | 2f78b5f30bdcbe82d42fa6d98c3648bae678b93e | |
| parent | c543913a79983f9d837d55b4603840a7968bb9af (diff) | |
| parent | 39422271a9f431e06296d9914b3aadf6dfa8040e (diff) | |
Merge "Remember the process that token was added for also for the services that are already running" into qt-dev
| -rw-r--r-- | services/core/java/com/android/server/am/ServiceRecord.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java index 2f1b22ec9a67..446b12833096 100644 --- a/services/core/java/com/android/server/am/ServiceRecord.java +++ b/services/core/java/com/android/server/am/ServiceRecord.java @@ -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) { |