Loading services/core/java/com/android/server/am/ActiveServices.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public final class ActiveServices { public static final int FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE = 18; public static final int FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD = 19; public static final int FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES = 20; public static final int FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER = 21; @IntDef(flag = true, prefix = { "FGS_FEATURE_" }, value = { FGS_FEATURE_DENIED, Loading @@ -191,6 +192,7 @@ public final class ActiveServices { FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE, FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD, FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES, FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER }) @Retention(RetentionPolicy.SOURCE) public @interface FgsFeatureRetCode {} Loading Loading @@ -5208,8 +5210,8 @@ public final class ActiveServices { for (int i = mAm.mProcessList.mLruProcesses.size() - 1; i >= 0; i--) { final ProcessRecord pr = mAm.mProcessList.mLruProcesses.get(i); if (pr.uid == callingUid) { if (pr.areBackgroundActivityStartsAllowedByToken()) { ret = FGS_FEATURE_ALLOWED_BY_ACTIVITY_TOKEN; if (pr.getWindowProcessController().areBackgroundActivityStartsAllowed()) { ret = FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER; break; } } Loading Loading @@ -5412,6 +5414,8 @@ public final class ActiveServices { return "ALLOWED_BY_PROCESS_RECORD"; case FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES: return "FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES"; case FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER: return "ALLOWED_BY_ACTIVITY_STARTER"; default: return ""; } Loading services/core/java/com/android/server/am/ProcessRecord.java +0 −4 Original line number Diff line number Diff line Loading @@ -1381,10 +1381,6 @@ class ProcessRecord implements WindowProcessListener { mWindowProcessController.removeAllowBackgroundActivityStartsToken(entity); } boolean areBackgroundActivityStartsAllowedByToken() { return mWindowProcessController.areBackgroundActivityStartsAllowedByToken(); } void addBoundClientUid(int clientUid) { mBoundClientUids.add(clientUid); mWindowProcessController.setBoundClientUids(mBoundClientUids); Loading services/core/java/com/android/server/wm/WindowProcessController.java +2 −6 Original line number Diff line number Diff line Loading @@ -510,13 +510,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio } } /** * Returns true if background activity starts are allowed by any token added via {@link * #addOrUpdateAllowBackgroundActivityStartsToken(Binder, IBinder)}. */ public boolean areBackgroundActivityStartsAllowedByToken() { public boolean areBackgroundActivityStartsAllowed() { synchronized (mAtm.mGlobalLock) { return !mBackgroundActivityStartTokens.isEmpty(); return areBackgroundActivityStartsAllowed(mAtm.getBalAppSwitchesAllowed()); } } Loading Loading
services/core/java/com/android/server/am/ActiveServices.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public final class ActiveServices { public static final int FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE = 18; public static final int FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD = 19; public static final int FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES = 20; public static final int FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER = 21; @IntDef(flag = true, prefix = { "FGS_FEATURE_" }, value = { FGS_FEATURE_DENIED, Loading @@ -191,6 +192,7 @@ public final class ActiveServices { FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE, FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD, FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES, FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER }) @Retention(RetentionPolicy.SOURCE) public @interface FgsFeatureRetCode {} Loading Loading @@ -5208,8 +5210,8 @@ public final class ActiveServices { for (int i = mAm.mProcessList.mLruProcesses.size() - 1; i >= 0; i--) { final ProcessRecord pr = mAm.mProcessList.mLruProcesses.get(i); if (pr.uid == callingUid) { if (pr.areBackgroundActivityStartsAllowedByToken()) { ret = FGS_FEATURE_ALLOWED_BY_ACTIVITY_TOKEN; if (pr.getWindowProcessController().areBackgroundActivityStartsAllowed()) { ret = FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER; break; } } Loading Loading @@ -5412,6 +5414,8 @@ public final class ActiveServices { return "ALLOWED_BY_PROCESS_RECORD"; case FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES: return "FGS_FEATURE_ALLOWED_BY_EXEMPTED_PACKAGES"; case FGS_FEATURE_ALLOWED_BY_ACTIVITY_STARTER: return "ALLOWED_BY_ACTIVITY_STARTER"; default: return ""; } Loading
services/core/java/com/android/server/am/ProcessRecord.java +0 −4 Original line number Diff line number Diff line Loading @@ -1381,10 +1381,6 @@ class ProcessRecord implements WindowProcessListener { mWindowProcessController.removeAllowBackgroundActivityStartsToken(entity); } boolean areBackgroundActivityStartsAllowedByToken() { return mWindowProcessController.areBackgroundActivityStartsAllowedByToken(); } void addBoundClientUid(int clientUid) { mBoundClientUids.add(clientUid); mWindowProcessController.setBoundClientUids(mBoundClientUids); Loading
services/core/java/com/android/server/wm/WindowProcessController.java +2 −6 Original line number Diff line number Diff line Loading @@ -510,13 +510,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio } } /** * Returns true if background activity starts are allowed by any token added via {@link * #addOrUpdateAllowBackgroundActivityStartsToken(Binder, IBinder)}. */ public boolean areBackgroundActivityStartsAllowedByToken() { public boolean areBackgroundActivityStartsAllowed() { synchronized (mAtm.mGlobalLock) { return !mBackgroundActivityStartTokens.isEmpty(); return areBackgroundActivityStartsAllowed(mAtm.getBalAppSwitchesAllowed()); } } Loading