Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9c0e539 authored by Nan Wu's avatar Nan Wu Committed by Hao Ke
Browse files

Create a new trunk stable flag for intent redirect

Use a different trunk stable flag to control show toast when the
extra intent keys are not collected for a top level intent.

Bug: 380164671
Bug: 380365713
Test: Manual testing
Flag: android.security.prevent_intent_redirect_show_toast_if_nested_keys_not_collected
Change-Id: Ib5363cd8a35c4ab479c30a82c6e5dfc6a7969fb2
parent d48ccaa6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -95,6 +95,14 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "prevent_intent_redirect_show_toast_if_nested_keys_not_collected"
    namespace: "responsible_apis"
    description: "Prevent intent redirect attacks by showing a toast if not yet collected"
    bug: "361143368"
    is_fixed_read_only: true
}

flag {
    name: "prevent_intent_redirect_throw_exception_if_nested_keys_not_collected"
    namespace: "responsible_apis"
+2 −2
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ import static android.provider.Settings.Global.DEBUG_APP;
import static android.provider.Settings.Global.WAIT_FOR_DEBUGGER;
import static android.security.Flags.preventIntentRedirect;
import static android.security.Flags.preventIntentRedirectCollectNestedKeysOnServerIfNotCollected;
import static android.security.Flags.preventIntentRedirectShowToast;
import static android.security.Flags.preventIntentRedirectShowToastIfNestedKeysNotCollected;
import static android.security.Flags.preventIntentRedirectThrowExceptionIfNestedKeysNotCollected;
import static android.util.FeatureFlagUtils.SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS;
import static android.view.Display.INVALID_DISPLAY;
@@ -19326,7 +19326,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    "[IntentRedirect] The intent does not have its nested keys collected as a "
                            + "preparation for creating intent creator tokens. Intent: "
                            + intent + "; creatorPackage: " + creatorPackage);
            if (preventIntentRedirectShowToast()) {
            if (preventIntentRedirectShowToastIfNestedKeysNotCollected()) {
                UiThread.getHandler().post(
                        () -> Toast.makeText(mContext,
                                "Nested keys not collected. go/report-bug-intentRedir to report a"