diff options
| author | 2022-12-06 06:37:43 +0000 | |
|---|---|---|
| committer | 2022-12-06 06:37:43 +0000 | |
| commit | c6d238d2396a4bf811509f2887c2aeb68d8952e7 (patch) | |
| tree | 29bf5865a48e751fdf17c09604157e1ade6307e1 | |
| parent | 8ec07724b1acee23e7f54b06a18629208ec05f54 (diff) | |
| parent | e649b80e5be326313389c9e8a422f288d00af2ed (diff) | |
Merge "Revert "Mark various SysUI PendingIntent sends "interactive"""
12 files changed, 12 insertions, 63 deletions
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index f09e6ce39034..db47a4cdefc0 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -833,20 +833,6 @@ public final class PendingIntent implements Parcelable { } /** - * 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. * diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActionsPanelPlugin.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActionsPanelPlugin.java index 429458fe0704..d0694ab124c6 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActionsPanelPlugin.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActionsPanelPlugin.java @@ -17,7 +17,6 @@ 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; @@ -71,9 +70,7 @@ public interface GlobalActionsPanelPlugin extends Plugin { /** Starts a PendingIntent, dismissing the keyguard if necessary. */ default void startPendingIntentDismissingKeyguard(PendingIntent pendingIntent) { try { - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - pendingIntent.send(options.toBundle()); + pendingIntent.send(); } catch (PendingIntent.CanceledException e) { // no-op } diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt index 3d9eee4e9feb..edd1c6891946 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt @@ -156,8 +156,6 @@ 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 } diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/pipeline/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/pipeline/MediaDataManager.kt index 3888bd3d186b..3012bb41445e 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/pipeline/MediaDataManager.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/pipeline/MediaDataManager.kt @@ -16,7 +16,6 @@ package com.android.systemui.media.controls.pipeline -import android.app.BroadcastOptions import android.app.Notification import android.app.Notification.EXTRA_SUBSTITUTE_APP_NAME import android.app.PendingIntent @@ -1150,9 +1149,7 @@ class MediaDataManager( private fun sendPendingIntent(intent: PendingIntent): Boolean { return try { - val options = BroadcastOptions.makeBasic() - options.setInteractive(true) - intent.send(options.toBundle()) + intent.send() true } catch (e: PendingIntent.CanceledException) { Log.d(TAG, "Intent canceled", e) diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java index 0c23ea60da4c..827ac789073a 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java @@ -23,7 +23,6 @@ import static com.android.systemui.media.controls.models.recommendation.Smartspa import android.animation.Animator; import android.animation.AnimatorInflater; import android.animation.AnimatorSet; -import android.app.BroadcastOptions; import android.app.PendingIntent; import android.app.WallpaperColors; import android.app.smartspace.SmartspaceAction; @@ -114,8 +113,6 @@ import com.android.systemui.util.ColorUtilKt; import com.android.systemui.util.animation.TransitionLayout; import com.android.systemui.util.time.SystemClock; -import dagger.Lazy; - import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; @@ -123,6 +120,7 @@ import java.util.concurrent.Executor; import javax.inject.Inject; +import dagger.Lazy; import kotlin.Unit; /** @@ -623,9 +621,7 @@ public class MediaControlPanel { device.getIntent().getIntent(), true); } else { try { - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - device.getIntent().send(options.toBundle()); + device.getIntent().send(); } catch (PendingIntent.CanceledException e) { Log.e(TAG, "Device pending intent was canceled"); } diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingController.java b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingController.java index 431b28fb7f28..b8684ee30b9a 100644 --- a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingController.java +++ b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingController.java @@ -16,14 +16,12 @@ package com.android.systemui.screenrecord; -import android.app.BroadcastOptions; import android.app.Dialog; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.os.Bundle; import android.os.CountDownTimer; import android.os.UserHandle; import android.util.Log; @@ -59,7 +57,6 @@ public class RecordingController private boolean mIsStarting; private boolean mIsRecording; private PendingIntent mStopIntent; - private final Bundle mInteractiveBroadcastOption; private CountDownTimer mCountDownTimer = null; private final Executor mMainExecutor; private final BroadcastDispatcher mBroadcastDispatcher; @@ -109,10 +106,6 @@ public class RecordingController mBroadcastDispatcher = broadcastDispatcher; mUserContextProvider = userContextProvider; mUserTracker = userTracker; - - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - mInteractiveBroadcastOption = options.toBundle(); } /** Create a dialog to show screen recording options to the user. */ @@ -155,7 +148,7 @@ public class RecordingController cb.onCountdownEnd(); } try { - startIntent.send(mInteractiveBroadcastOption); + startIntent.send(); mUserTracker.addCallback(mUserChangedCallback, mMainExecutor); IntentFilter stateFilter = new IntentFilter(INTENT_UPDATE_STATE); @@ -209,7 +202,7 @@ public class RecordingController public void stopRecording() { try { if (mStopIntent != null) { - mStopIntent.send(mInteractiveBroadcastOption); + mStopIntent.send(); } else { Log.e(TAG, "Stop intent was null"); } diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/OverlayActionChip.java b/packages/SystemUI/src/com/android/systemui/screenshot/OverlayActionChip.java index 860bfe37aee2..c4ea67e0f79e 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/OverlayActionChip.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/OverlayActionChip.java @@ -18,7 +18,6 @@ package com.android.systemui.screenshot; import static java.util.Objects.requireNonNull; -import android.app.BroadcastOptions; import android.app.PendingIntent; import android.content.Context; import android.graphics.drawable.Icon; @@ -97,9 +96,7 @@ public class OverlayActionChip extends FrameLayout { public void setPendingIntent(PendingIntent intent, Runnable finisher) { setOnClickListener(v -> { try { - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - intent.send(options.toBundle()); + intent.send(); finisher.run(); } catch (PendingIntent.CanceledException e) { Log.e(TAG, "Intent cancelled", e); diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 8e99a115a0a0..fae938d542f1 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -34,7 +34,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.app.ActivityManager; -import android.app.BroadcastOptions; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; @@ -54,7 +53,6 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.graphics.drawable.InsetDrawable; import android.graphics.drawable.LayerDrawable; -import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.util.AttributeSet; @@ -171,7 +169,6 @@ public class ScreenshotView extends FrameLayout implements private long mDefaultTimeoutOfTimeoutHandler; private ActionIntentExecutor mActionExecutor; private FeatureFlags mFlags; - private final Bundle mInteractiveBroadcastOption; private enum PendingInteraction { PREVIEW, @@ -198,10 +195,6 @@ public class ScreenshotView extends FrameLayout implements mResources = mContext.getResources(); mInteractionJankMonitor = getInteractionJankMonitorInstance(); - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - mInteractiveBroadcastOption = options.toBundle(); - mFixedSize = mResources.getDimensionPixelSize(R.dimen.overlay_x_scale); // standard material ease @@ -1099,7 +1092,7 @@ public class ScreenshotView extends FrameLayout implements private void startSharedTransition(ActionTransition transition) { try { mPendingSharedTransition = true; - transition.action.actionIntent.send(mInteractiveBroadcastOption); + transition.action.actionIntent.send(); // fade out non-preview UI createScreenshotFadeDismissAnimation().start(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 0dfffc434219..c7c644179e5b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -121,7 +121,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn options.setLaunchDisplayId(displayId); options.setCallerDisplayId(displayId); options.setPendingIntentBackgroundActivityLaunchAllowed(true); - options.setInteractive(true); return options.toBundle(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationAdapter.java index 33620979d681..3b1a4db067a3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationAdapter.java @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.tv.notifications; -import android.app.BroadcastOptions; import android.app.Notification; import android.app.PendingIntent; import android.service.notification.StatusBarNotification; @@ -101,9 +100,7 @@ public class TvNotificationAdapter extends RecyclerView.Adapter<RecyclerView.Vie public void onClick(View v) { try { if (mPendingIntent != null) { - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - mPendingIntent.send(options.toBundle()); + mPendingIntent.send(); } } catch (PendingIntent.CanceledException e) { Log.d(TAG, "Pending intent canceled for : " + mPendingIntent); diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java index dfc6392404a4..1243c4718229 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java @@ -20,7 +20,6 @@ import static com.android.systemui.wallet.ui.WalletCardCarousel.CARD_ANIM_ALPHA_ import static com.android.systemui.wallet.ui.WalletCardCarousel.CARD_ANIM_ALPHA_DURATION; import android.annotation.Nullable; -import android.app.BroadcastOptions; import android.app.PendingIntent; import android.content.Context; import android.content.res.Configuration; @@ -304,10 +303,7 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard ? mDeviceLockedActionOnClickListener : v -> { try { - - BroadcastOptions options = BroadcastOptions.makeBasic(); - options.setInteractive(true); - walletCard.getPendingIntent().send(options.toBundle()); + walletCard.getPendingIntent().send(); } catch (PendingIntent.CanceledException e) { Log.w(TAG, "Error sending pending intent for wallet card."); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingControllerTest.java index 8127ccca3f3f..69f3e987ec1d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingControllerTest.java @@ -107,7 +107,7 @@ public class RecordingControllerTest extends SysuiTestCase { mController.startCountdown(0, 0, startIntent, null); verify(mCallback).onCountdownEnd(); - verify(startIntent).send(any()); + verify(startIntent).send(); } // Test that when recording is stopped, the stop intent is sent and listeners are notified. @@ -125,7 +125,7 @@ public class RecordingControllerTest extends SysuiTestCase { assertFalse(mController.isStarting()); assertFalse(mController.isRecording()); - verify(stopIntent).send(any()); + verify(stopIntent).send(); verify(mCallback).onRecordingEnd(); } |