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

Commit d12ba6d9 authored by Christopher Tate's avatar Christopher Tate Committed by Chris Tate
Browse files

Mark various SysUI PendingIntent sends "interactive"

Re-submitting a reverted CL, with permissions use corrected.

Bug: 251902289
Test: atest SystemUITests
Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.sharesheet.ShareScreenshot
Change-Id: Id1ed74da4c007d305ba7b0a6a208fa04b2782339
parent a8ac0478
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -878,6 +878,20 @@ public final class PendingIntent implements Parcelable {
        send(context, code, intent, null, null, null, null);
    }

    /**
     * Perform the operation associated with this PendingIntent, supplying additional
     * options for the operation.
     *
     * @param options Additional options the caller would like to provide to modify the
     * sending behavior.  May be built from an {@link ActivityOptions} to apply to an
     * activity start.
     *
     * @hide
     */
    public void send(Bundle options) throws CanceledException {
        send(null, 0, null, null, null, null, options);
    }

    /**
     * Perform the operation associated with this PendingIntent, allowing the
     * caller to be notified when the send has completed.
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
        <permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
        <permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
        <permission name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
        <permission name="android.permission.COMPONENT_OPTION_INTERACTIVE"/>
        <permission name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS"/>
        <permission name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS"/>
        <permission name="android.permission.CONTROL_VPN"/>
+3 −0
Original line number Diff line number Diff line
@@ -180,6 +180,9 @@
    <!-- Doze mode temp whitelisting for notification dispatching. -->
    <uses-permission android:name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST" />

    <!-- Tag user-initiated PendingIntent invocations as "interactive" when appropriate -->
    <uses-permission android:name="android.permission.COMPONENT_OPTION_INTERACTIVE" />

    <!-- Listen for keyboard attachment / detachment -->
    <uses-permission android:name="android.permission.TABLET_MODE" />

+4 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.plugins;

import android.annotation.Nullable;
import android.app.BroadcastOptions;
import android.app.PendingIntent;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -70,7 +71,9 @@ public interface GlobalActionsPanelPlugin extends Plugin {
        /** Starts a PendingIntent, dismissing the keyguard if necessary. */
        default void startPendingIntentDismissingKeyguard(PendingIntent pendingIntent) {
            try {
                pendingIntent.send();
                BroadcastOptions options = BroadcastOptions.makeBasic();
                options.setInteractive(true);
                pendingIntent.send(options.toBundle());
            } catch (PendingIntent.CanceledException e) {
                // no-op
            }
+2 −0
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ class DetailDialog(
                    // Remove the task explicitly, since onRelease() callback will be executed after
                    // startActivity() below is called.
                    broadcastSender.closeSystemDialogs()
                    // not sent as interactive, lest the higher-importance activity launch
                    // be impacted
                    pendingIntent.send()
                    false
                }
Loading