diff options
| author | 2023-12-04 23:26:20 +0000 | |
|---|---|---|
| committer | 2023-12-06 00:28:13 +0000 | |
| commit | 2c8ff60598d6c779742c7394e703375198c05639 (patch) | |
| tree | e7f553fb00ac2217bd1d406c6de240faacf73d93 | |
| parent | e2b283d902e0ff7907280bdc2e56214b812b324a (diff) | |
No logs if BAL hardened result unchanged
If BAL hardening does not change that we allow the start, there is no
reason to print a warning. Currently this emits a lot of warnings for
cases that are not PendingIntents (regular activity starts). In the
BackgroundActivityLauchTest run this reduces the number of BAL wtf logs
from 169 to only 6.
Test: atest BackgroundActivityLauchTest (and inspecting logs)
Bug: 296478951
Change-Id: I332294eb823c38f02aca34bc18eadfd9facb867b
| -rw-r--r-- | services/core/java/com/android/server/wm/BackgroundActivityStartController.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java index 4625b4fe07ef..f8b22c97e218 100644 --- a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java +++ b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java @@ -614,6 +614,15 @@ public class BackgroundActivityStartController { == ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED; if (callerCanAllow && realCallerCanAllow) { // Both caller and real caller allow with system defined behavior + if (state.mBalAllowedByPiCreatorWithHardening.allowsBackgroundActivityStarts()) { + // Will be allowed even with BAL hardening. + if (DEBUG_ACTIVITY_STARTS) { + Slog.d(TAG, "Activity start allowed by caller. " + + state.dump(resultForCaller, resultForRealCaller)); + } + // return the realCaller result for backwards compatibility + return statsLog(resultForRealCaller, state); + } if (state.mBalAllowedByPiCreator.allowsBackgroundActivityStarts()) { Slog.wtf(TAG, "With Android 15 BAL hardening this activity start may be blocked" @@ -632,6 +641,14 @@ public class BackgroundActivityStartController { } if (callerCanAllow) { // Allowed before V by creator + if (state.mBalAllowedByPiCreatorWithHardening.allowsBackgroundActivityStarts()) { + // Will be allowed even with BAL hardening. + if (DEBUG_ACTIVITY_STARTS) { + Slog.d(TAG, "Activity start allowed by caller. " + + state.dump(resultForCaller, resultForRealCaller)); + } + return statsLog(resultForCaller, state); + } if (state.mBalAllowedByPiCreator.allowsBackgroundActivityStarts()) { Slog.wtf(TAG, "With Android 15 BAL hardening this activity start may be blocked" |