diff --git a/core/java/android/view/IPinnedStackListener.aidl b/core/java/android/view/IPinnedStackListener.aidl index b6ce9f52e0c39..f49fee36ca7e9 100644 --- a/core/java/android/view/IPinnedStackListener.aidl +++ b/core/java/android/view/IPinnedStackListener.aidl @@ -16,6 +16,7 @@ package android.view; +import android.app.RemoteAction; import android.content.ComponentName; import android.content.pm.ParceledListSlice; import android.graphics.Rect; @@ -51,9 +52,9 @@ oneway interface IPinnedStackListener { /** * Called when the set of actions for the current PiP activity changes, or when the listener - * is first registered to allow the listener to synchronized its state with the controller. + * is first registered to allow the listener to synchronize its state with the controller. */ - void onActionsChanged(in ParceledListSlice actions); + void onActionsChanged(in ParceledListSlice actions); /** * Called by the window manager to notify the listener that Activity (was or is in pinned mode) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/PinnedStackListenerForwarder.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/PinnedStackListenerForwarder.java index 4794847d8be16..2091baaaf8a1e 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/PinnedStackListenerForwarder.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/PinnedStackListenerForwarder.java @@ -16,6 +16,7 @@ package com.android.systemui.shared.system; +import android.app.RemoteAction; import android.content.ComponentName; import android.content.pm.ParceledListSlice; import android.view.DisplayInfo; @@ -66,7 +67,7 @@ public class PinnedStackListenerForwarder extends IPinnedStackListener.Stub { } @Override - public void onActionsChanged(ParceledListSlice actions) { + public void onActionsChanged(ParceledListSlice actions) { for (PinnedStackListener listener : mListeners) { listener.onActionsChanged(actions); } @@ -111,7 +112,7 @@ public class PinnedStackListenerForwarder extends IPinnedStackListener.Stub { public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) {} - public void onActionsChanged(ParceledListSlice actions) {} + public void onActionsChanged(ParceledListSlice actions) {} public void onActivityHidden(ComponentName componentName) {} diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java index 75d3d0454755b..bf1892e5e3757 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java @@ -25,6 +25,7 @@ import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityTaskManager; import android.app.IActivityManager; +import android.app.RemoteAction; import android.content.ComponentName; import android.content.Context; import android.content.pm.ParceledListSlice; @@ -209,7 +210,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio } @Override - public void onActionsChanged(ParceledListSlice actions) { + public void onActionsChanged(ParceledListSlice actions) { mHandler.post(() -> mMenuController.setAppActions(actions)); } diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 204354645e107..442b43eed51ea 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -162,9 +162,10 @@ public class PipMenuActivity extends Activity { break; case MESSAGE_UPDATE_ACTIONS: { final Bundle data = (Bundle) msg.obj; - final ParceledListSlice actions = data.getParcelable(EXTRA_ACTIONS); + final ParceledListSlice actions = data.getParcelable( + EXTRA_ACTIONS); setActions(data.getParcelable(EXTRA_STACK_BOUNDS), actions != null - ? actions.getList() : Collections.EMPTY_LIST); + ? actions.getList() : Collections.emptyList()); break; } case MESSAGE_UPDATE_DISMISS_FRACTION: { @@ -496,7 +497,7 @@ public class PipMenuActivity extends Activity { } notifyActivityCallback(mMessenger); - ParceledListSlice actions = intent.getParcelableExtra(EXTRA_ACTIONS); + ParceledListSlice actions = intent.getParcelableExtra(EXTRA_ACTIONS); if (actions != null) { mActions.clear(); mActions.addAll(actions.getList()); diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java index 31d292fa3fd7e..87e66fdc375c0 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java @@ -115,8 +115,8 @@ public class PipMenuActivityController { private InputConsumerController mInputConsumerController; private ArrayList mListeners = new ArrayList<>(); - private ParceledListSlice mAppActions; - private ParceledListSlice mMediaActions; + private ParceledListSlice mAppActions; + private ParceledListSlice mMediaActions; private int mMenuState; // The dismiss fraction update is sent frequently, so use a temporary bundle for the message @@ -429,7 +429,7 @@ public class PipMenuActivityController { /** * Sets the menu actions to the actions provided by the current PiP activity. */ - public void setAppActions(ParceledListSlice appActions) { + public void setAppActions(ParceledListSlice appActions) { mAppActions = appActions; updateMenuActions(); } @@ -437,7 +437,7 @@ public class PipMenuActivityController { /** * @return the best set of actions to show in the PiP menu. */ - private ParceledListSlice resolveMenuActions() { + private ParceledListSlice resolveMenuActions() { if (isValidActions(mAppActions)) { return mAppActions; } @@ -515,7 +515,7 @@ public class PipMenuActivityController { /** * Returns whether the set of actions are valid. */ - private boolean isValidActions(ParceledListSlice actions) { + private static boolean isValidActions(ParceledListSlice actions) { return actions != null && actions.getList().size() > 0; } diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsViewController.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsViewController.java index 1fe531b372c68..bb588d409dc84 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsViewController.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsViewController.java @@ -243,7 +243,7 @@ public class PipControlsViewController { /** * Updates the set of activity-defined actions. */ - public void setActions(List actions) { + public void setActions(List actions) { mCustomActions.clear(); mCustomActions.addAll(actions); updateUserActions(); diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java index 628223630af75..cbeefa6849b56 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java @@ -24,6 +24,7 @@ import android.app.ActivityManager.RunningTaskInfo; import android.app.ActivityManager.StackInfo; import android.app.ActivityTaskManager; import android.app.IActivityTaskManager; +import android.app.RemoteAction; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; @@ -135,7 +136,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio private MediaController mPipMediaController; private String[] mLastPackagesResourceGranted; private PipNotification mPipNotification; - private ParceledListSlice mCustomActions; + private ParceledListSlice mCustomActions; private int mResizeAnimationDuration; // Used to calculate the movement bounds @@ -220,7 +221,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio } @Override - public void onActionsChanged(ParceledListSlice actions) { + public void onActionsChanged(ParceledListSlice actions) { mCustomActions = actions; mHandler.post(() -> { for (int i = mListeners.size() - 1; i >= 0; --i) { @@ -764,7 +765,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio /** Invoked when the PIP menu gets shown. */ void onShowPipMenu(); /** Invoked when the PIP menu actions change. */ - void onPipMenuActionsChanged(ParceledListSlice actions); + void onPipMenuActionsChanged(ParceledListSlice actions); /** Invoked when the PIPed activity is about to return back to the fullscreen. */ void onMoveToFullscreen(); /** Invoked when we are above to start resizing the Pip. */ diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java index 158be45e0adbd..c2b9af3266507 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java @@ -19,6 +19,7 @@ package com.android.systemui.pip.tv; import android.animation.Animator; import android.animation.AnimatorInflater; import android.app.Activity; +import android.app.RemoteAction; import android.content.Intent; import android.content.pm.ParceledListSlice; import android.os.Bundle; @@ -149,12 +150,12 @@ public class PipMenuActivity extends Activity implements PipManager.Listener { } @Override - public void onPipMenuActionsChanged(ParceledListSlice actions) { + public void onPipMenuActionsChanged(ParceledListSlice actions) { if (DEBUG) Log.d(TAG, "onPipMenuActionsChanged()"); boolean hasCustomActions = actions != null && !actions.getList().isEmpty(); mPipControlsViewController.setActions( - hasCustomActions ? actions.getList() : Collections.EMPTY_LIST); + hasCustomActions ? actions.getList() : Collections.emptyList()); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java index 30ec29683942b..5b549cd92b18d 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java @@ -19,6 +19,7 @@ package com.android.systemui.pip.tv; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; +import android.app.RemoteAction; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -89,7 +90,7 @@ public class PipNotification { } @Override - public void onPipMenuActionsChanged(ParceledListSlice actions) { + public void onPipMenuActionsChanged(ParceledListSlice actions) { // no-op. }