Revert "Mark various SysUI PendingIntent sends "interactive""
This reverts commit a09944f75e.
Reason for revert: Looks like it may cause b/261526579 testing failed. Revert it for testing.
Testing is passed when including this revert cl.
https://android-build.googleplex.com/builds/abtd/run/L43200000957626986?referrer=email
Testing is failing when not including this revert cl.
https://android-build.googleplex.com/builds/abtd/run/L94200000957630043?referrer=email
Bug: 261526579
Change-Id: If97da3747747172e08c712719f572d87fafdbb05
This commit is contained in:
@@ -832,20 +832,6 @@ 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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user