From 78207fd80bc321f9b30a5ebbd196a5df046029ec Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 17 Jul 2023 20:19:16 -0700 Subject: [PATCH 1/7] Change split toast exit asset to "X" * TODO: Probably need to change tint based on theme Bug: 276361926 Flag: ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE Test: Shows up as expected Change-Id: I28a2eefa115cb15aab560d750103c7946639c18b --- .../res/layout/split_instructions_view.xml | 2 +- res/drawable/ic_split_exit.xml | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 res/drawable/ic_split_exit.xml diff --git a/quickstep/res/layout/split_instructions_view.xml b/quickstep/res/layout/split_instructions_view.xml index 5f037f8971..c663bf470c 100644 --- a/quickstep/res/layout/split_instructions_view.xml +++ b/quickstep/res/layout/split_instructions_view.xml @@ -32,7 +32,7 @@ android:layout_width="wrap_content" android:gravity="center" android:textColor="?androidprv:attr/textColorOnAccent" - android:drawableEnd="@drawable/ic_split_horizontal" + android:drawableEnd="@drawable/ic_split_exit" android:drawablePadding="@dimen/split_instructions_drawable_padding" android:text="@string/toast_split_select_app" /> \ No newline at end of file diff --git a/res/drawable/ic_split_exit.xml b/res/drawable/ic_split_exit.xml new file mode 100644 index 0000000000..d7e8b03c50 --- /dev/null +++ b/res/drawable/ic_split_exit.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file From 27f23c7a357553b49771fa5bfb02177d67e6bd01 Mon Sep 17 00:00:00 2001 From: helencheuk Date: Fri, 14 Jul 2023 15:44:16 +0100 Subject: [PATCH 2/7] Re-land "Add hover state border to overview task item" Fix: 249859410 Test: b/291266459 Change-Id: I5ac1e9e77439e587f11c994d22fdc72d20d8502d --- .../keyboard_quick_switch_taskview.xml | 2 +- .../layout/keyboard_quick_switch_overview.xml | 2 +- .../layout/keyboard_quick_switch_taskview.xml | 2 +- quickstep/res/layout/task.xml | 3 +- quickstep/res/layout/task_desktop.xml | 3 +- quickstep/res/layout/task_grouped.xml | 3 +- quickstep/res/values/attrs.xml | 3 +- quickstep/res/values/dimens.xml | 2 + .../taskbar/KeyboardQuickSwitchTaskView.java | 2 +- .../com/android/quickstep/views/TaskView.java | 92 ++++++++++++++----- 10 files changed, 85 insertions(+), 29 deletions(-) diff --git a/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml b/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml index 4e676298c8..69e157433a 100644 --- a/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml +++ b/quickstep/res/layout-land/keyboard_quick_switch_taskview.xml @@ -23,7 +23,7 @@ android:importantForAccessibility="yes" android:background="@drawable/keyboard_quick_switch_task_view_background" android:clipToOutline="true" - launcher:borderColor="?androidprv:attr/materialColorOutline"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline" + launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline" + launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary"> + launcher:focusBorderColor="?androidprv:attr/materialColorOutline" + launcher:hoverBorderColor="?androidprv:attr/materialColorPrimary"> - + + 44dp + + 4dp 16dp diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java index 8a11b57c11..3e1a6ae9cb 100644 --- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java +++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchTaskView.java @@ -80,7 +80,7 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout { setWillNotDraw(false); mBorderColor = ta.getColor( - R.styleable.TaskView_borderColor, DEFAULT_BORDER_COLOR); + R.styleable.TaskView_focusBorderColor, DEFAULT_BORDER_COLOR); ta.recycle(); } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 5301c7c207..6b0843ccf5 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -97,7 +97,6 @@ import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle; import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.TaskIconCache; -import com.android.quickstep.TaskOverlayFactory; import com.android.quickstep.TaskThumbnailCache; import com.android.quickstep.TaskUtils; import com.android.quickstep.TaskViewUtils; @@ -413,7 +412,9 @@ public class TaskView extends FrameLayout implements Reusable { private boolean mIsClickableAsLiveTile = true; - @Nullable private final BorderAnimator mBorderAnimator; + @Nullable private final BorderAnimator mFocusBorderAnimator; + + @Nullable private final BorderAnimator mHoverBorderAnimator; public TaskView(Context context) { this(context, null); @@ -439,23 +440,40 @@ public class TaskView extends FrameLayout implements Reusable { boolean keyboardFocusHighlightEnabled = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get() || DesktopTaskView.DESKTOP_MODE_SUPPORTED; - setWillNotDraw(!keyboardFocusHighlightEnabled); + boolean willDrawBorder = + keyboardFocusHighlightEnabled || FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get(); + setWillNotDraw(!willDrawBorder); - TypedArray ta = context.obtainStyledAttributes( - attrs, R.styleable.TaskView, defStyleAttr, defStyleRes); + if (willDrawBorder) { + TypedArray styledAttrs = context.obtainStyledAttributes( + attrs, R.styleable.TaskView, defStyleAttr, defStyleRes); - mBorderAnimator = !keyboardFocusHighlightEnabled - ? null - : new BorderAnimator( - /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, - /* borderColor= */ ta.getColor( - R.styleable.TaskView_borderColor, DEFAULT_BORDER_COLOR), - /* borderAnimationParams= */ new BorderAnimator.SimpleParams( - /* borderWidthPx= */ context.getResources().getDimensionPixelSize( - R.dimen.keyboard_quick_switch_border_width), - /* boundsBuilder= */ this::updateBorderBounds, - /* targetView= */ this)); - ta.recycle(); + mFocusBorderAnimator = keyboardFocusHighlightEnabled ? new BorderAnimator( + /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, + /* borderColor= */ styledAttrs.getColor( + R.styleable.TaskView_focusBorderColor, DEFAULT_BORDER_COLOR), + /* borderAnimationParams= */ new BorderAnimator.SimpleParams( + /* borderWidthPx= */ context.getResources().getDimensionPixelSize( + R.dimen.keyboard_quick_switch_border_width), + /* boundsBuilder= */ this::updateBorderBounds, + /* targetView= */ this)) : null; + + mHoverBorderAnimator = + FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get() ? new BorderAnimator( + /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, + /* borderColor= */ styledAttrs.getColor( + R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR), + /* borderAnimationParams= */ new BorderAnimator.SimpleParams( + /* borderWidthPx= */ context.getResources() + .getDimensionPixelSize(R.dimen.task_hover_border_width), + /* boundsBuilder= */ this::updateBorderBounds, + /* targetView= */ this)) : null; + + styledAttrs.recycle(); + } else { + mFocusBorderAnimator = null; + mHoverBorderAnimator = null; + } } protected void updateBorderBounds(Rect bounds) { @@ -509,16 +527,48 @@ public class TaskView extends FrameLayout implements Reusable { @Override protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); - if (mBorderAnimator != null) { - mBorderAnimator.buildAnimator(gainFocus).start(); + if (mFocusBorderAnimator != null) { + mFocusBorderAnimator.buildAnimator(gainFocus).start(); + } + } + + @Override + public boolean onHoverEvent(MotionEvent event) { + if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { + switch (event.getAction()) { + case MotionEvent.ACTION_HOVER_ENTER: + mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start(); + break; + case MotionEvent.ACTION_HOVER_EXIT: + mHoverBorderAnimator.buildAnimator(/* isAppearing= */ false).start(); + break; + default: + break; + } + } + return super.onHoverEvent(event); + } + + @Override + public boolean onInterceptHoverEvent(MotionEvent event) { + if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { + // avoid triggering hover event on child elements which would cause HOVER_EXIT for this + // task view + return true; + } else { + return super.onInterceptHoverEvent(event); } } @Override public void draw(Canvas canvas) { super.draw(canvas); - if (mBorderAnimator != null) { - mBorderAnimator.drawBorder(canvas); + if (mFocusBorderAnimator != null) { + mFocusBorderAnimator.drawBorder(canvas); + } + + if (mHoverBorderAnimator != null) { + mHoverBorderAnimator.drawBorder(canvas); } } From c90df24e1c877a184d1c9c545b3e58c9d9881aec Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Tue, 11 Jul 2023 17:14:23 -0400 Subject: [PATCH 3/7] Notify Taskbar search session of All Apps transitions. Test: Manual Bug: 290819902 Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR Change-Id: I9ff5ec7d55c33f9987aec79ebae31c38c710a920 --- .../allapps/TaskbarAllAppsController.java | 2 +- .../allapps/TaskbarAllAppsSlideInView.java | 20 ++++++++++ .../allapps/TaskbarAllAppsViewController.java | 24 ++++++++++-- .../allapps/TaskbarSearchSessionController.kt | 15 +++++--- .../allapps/AllAppsTransitionListener.java | 37 +++++++++++++++++++ 5 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 src/com/android/launcher3/allapps/AllAppsTransitionListener.java diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java index 3e1fef91e8..544f9bf27e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java @@ -164,7 +164,7 @@ public final class TaskbarAllAppsController { cleanUpOverlay(); }); TaskbarAllAppsViewController viewController = new TaskbarAllAppsViewController( - mOverlayContext, mSlideInView, mControllers); + mOverlayContext, mSlideInView, mControllers, mSearchSessionController); viewController.show(animate); mAppsView = mOverlayContext.getAppsView(); diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index 84cc00278b..837e06a677 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -17,6 +17,8 @@ package com.android.launcher3.taskbar.allapps; import static com.android.app.animation.Interpolators.EMPHASIZED; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.animation.PropertyValuesHolder; import android.content.Context; import android.graphics.Canvas; @@ -63,14 +65,23 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView) {} + open fun setZeroStatePredictedItems(items: List) = Unit /** Updates the search suggestions shown in the zero-state. */ - open fun setZeroStateSearchSuggestions(items: List) {} + open fun setZeroStateSearchSuggestions(items: List) = Unit + + override fun onAllAppsTransitionStart(toAllApps: Boolean) = Unit + + override fun onAllAppsTransitionEnd(toAllApps: Boolean) = Unit /** Creates a [PreDragCondition] for [view], if it is a search result that requires one. */ open fun createPreDragConditionForSearch(view: View): PreDragCondition? = null diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionListener.java b/src/com/android/launcher3/allapps/AllAppsTransitionListener.java new file mode 100644 index 0000000000..4a17e29039 --- /dev/null +++ b/src/com/android/launcher3/allapps/AllAppsTransitionListener.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.launcher3.allapps; + +/** + * An interface for listening to all-apps open-close transition + */ +public interface AllAppsTransitionListener { + /** + * Called when the transition starts + * @param toAllApps {@code true} if this transition is supposed to end in the AppApps UI + * + * @see ActivityAllAppsContainerView + */ + void onAllAppsTransitionStart(boolean toAllApps); + + /** + * Called when the transition ends + * @param toAllApps {@code true} if the final state is all-apps + * + * @see ActivityAllAppsContainerView + */ + void onAllAppsTransitionEnd(boolean toAllApps); +} From da718e9749066a7b88c2fee014c9032660118a6a Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Tue, 18 Jul 2023 13:34:07 -0700 Subject: [PATCH 4/7] Log appear animation's scale factor Test: Grabbed a bug report b/291974797 Flag: N/A Bug: 290320302 Change-Id: Ic33dc94806b838a03a2203bdd5701a1eeaeeb7bf --- .../launcher3/QuickstepTransitionManager.java | 4 + .../uioverrides/QuickstepLauncher.java | 5 + .../android/launcher3/util/EventLogArray.kt | 117 ++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 src/com/android/launcher3/util/EventLogArray.kt diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 153c1acd75..4489eaf746 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -158,6 +158,7 @@ import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; import com.android.wm.shell.startingsurface.IStartingWindowListener; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -477,6 +478,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener }); } + /** Dump debug logs to bug report. */ + public void dump(@NonNull String prefix, @NonNull PrintWriter printWriter) {} + /** * Content is everything on screen except the background and the floating view (if any). * diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index fbe0a8f722..96d5ebc88f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -203,6 +203,8 @@ public class QuickstepLauncher extends Launcher { public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false; + protected static final String RING_APPEAR_ANIMATION_PREFIX = "RingAppearAnimation\t"; + private FixedContainerItems mAllAppsPredictions; private HotseatPredictionController mHotseatPredictionController; private DepthController mDepthController; @@ -1369,5 +1371,8 @@ public class QuickstepLauncher extends Launcher { if (recentsView != null) { recentsView.getSplitSelectController().dump(prefix, writer); } + if (mAppTransitionManager != null) { + mAppTransitionManager.dump(prefix + "\t" + RING_APPEAR_ANIMATION_PREFIX, writer); + } } } diff --git a/src/com/android/launcher3/util/EventLogArray.kt b/src/com/android/launcher3/util/EventLogArray.kt new file mode 100644 index 0000000000..a17d6509e3 --- /dev/null +++ b/src/com/android/launcher3/util/EventLogArray.kt @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.launcher3.util + +import java.io.PrintWriter +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +/** + * A utility class to record and log events. Events are stored in a fixed size array and old logs + * are purged as new events come. + */ +class EventLogArray(private val name: String, size: Int) { + + companion object { + private const val TYPE_ONE_OFF = 0 + private const val TYPE_FLOAT = 1 + private const val TYPE_INTEGER = 2 + private const val TYPE_BOOL_TRUE = 3 + private const val TYPE_BOOL_FALSE = 4 + private fun isEntrySame(entry: EventEntry?, type: Int, event: String): Boolean { + return entry != null && entry.type == type && entry.event == event + } + } + + private val logs: Array + private var nextIndex = 0 + + init { + logs = arrayOfNulls(size) + } + + fun addLog(event: String) { + addLog(TYPE_ONE_OFF, event, 0f) + } + + fun addLog(event: String, extras: Int) { + addLog(TYPE_INTEGER, event, extras.toFloat()) + } + + fun addLog(event: String, extras: Float) { + addLog(TYPE_FLOAT, event, extras) + } + + fun addLog(event: String, extras: Boolean) { + addLog(if (extras) TYPE_BOOL_TRUE else TYPE_BOOL_FALSE, event, 0f) + } + + private fun addLog(type: Int, event: String, extras: Float) { + // Merge the logs if it's a duplicate + val last = (nextIndex + logs.size - 1) % logs.size + val secondLast = (nextIndex + logs.size - 2) % logs.size + if (isEntrySame(logs[last], type, event) && isEntrySame(logs[secondLast], type, event)) { + logs[last]!!.update(type, event, extras) + logs[secondLast]!!.duplicateCount++ + return + } + if (logs[nextIndex] == null) { + logs[nextIndex] = EventEntry() + } + logs[nextIndex]!!.update(type, event, extras) + nextIndex = (nextIndex + 1) % logs.size + } + + fun dump(prefix: String, writer: PrintWriter) { + writer.println("$prefix$name event history:") + val sdf = SimpleDateFormat(" HH:mm:ss.SSSZ ", Locale.US) + val date = Date() + for (i in logs.indices) { + val log = logs[(nextIndex + logs.size - i - 1) % logs.size] ?: continue + date.time = log.time + val msg = StringBuilder(prefix).append(sdf.format(date)).append(log.event) + when (log.type) { + TYPE_BOOL_FALSE -> msg.append(": false") + TYPE_BOOL_TRUE -> msg.append(": true") + TYPE_FLOAT -> msg.append(": ").append(log.extras) + TYPE_INTEGER -> msg.append(": ").append(log.extras.toInt()) + else -> {} + } + if (log.duplicateCount > 0) { + msg.append(" & ").append(log.duplicateCount).append(" similar events") + } + writer.println(msg) + } + } + + /** A single event entry. */ + private class EventEntry { + var type = 0 + var event: String? = null + var extras = 0f + var time: Long = 0 + var duplicateCount = 0 + fun update(type: Int, event: String, extras: Float) { + this.type = type + this.event = event + this.extras = extras + time = System.currentTimeMillis() + duplicateCount = 0 + } + } +} From 67de6365b5398c5d69923bfeb424e99319877f71 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Tue, 11 Jul 2023 15:17:46 -0400 Subject: [PATCH 5/7] Support system back in Taskbar search session. Bug: 290820102 Test: Manual Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR Change-Id: If56b70cdad85a805ff5191b9c95e7c1939d394e9 --- .../taskbar/allapps/TaskbarAllAppsSlideInView.java | 7 +++++++ .../taskbar/allapps/TaskbarAllAppsViewController.java | 5 +++++ .../taskbar/allapps/TaskbarSearchSessionController.kt | 2 ++ 3 files changed, 14 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index 837e06a677..4f75ef5599 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -214,4 +214,11 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView Date: Thu, 20 Jul 2023 11:38:24 -0700 Subject: [PATCH 6/7] Adding RECEIVER_EXPORTED flag to BroadcastReceiver We currently won't be able to run test locally on Android 14 devices as the flag is required for all braodcast recievers, so the change here. Test: Presubmit Bug: 292118103 Flag: not needed Change-Id: I85f9d1b9717b85b30a15e825ebd500508dd3ca5d --- .../android/launcher3/testcomponent/BaseTestingActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java b/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java index d3ce67c81c..81a59b9a45 100644 --- a/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java +++ b/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java @@ -69,7 +69,10 @@ public class BaseTestingActivity extends Activity implements View.OnClickListene mView.setBackgroundColor(Color.BLUE); setContentView(mView); - registerReceiver(mCommandReceiver, new IntentFilter(mAction + SUFFIX_COMMAND)); + registerReceiver( + mCommandReceiver, + new IntentFilter(mAction + SUFFIX_COMMAND), + RECEIVER_EXPORTED); } protected void addButton(String title, String method) { From 5ad13e3412a120b3c35a0b0d32bd163f4a7d04b3 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 20 Jul 2023 17:45:54 -0700 Subject: [PATCH 7/7] Add null check for invalid previously appeared target * In ag/23680185, a null check was removed that was checking if individual mLastAppearedTaskTargets were null; we check if the array overall is null, but individual elements can also be null, ex 3P launcher Bug: 289609734 Test: Repro steps from b/289609734 don't cause crash Flag: none Change-Id: Iddfde6d9ac2b708380b70b5fb6301b629506619c --- quickstep/src/com/android/quickstep/TaskAnimationManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 739f10eb6a..c0684d7750 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -206,7 +206,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn if (mLastAppearedTaskTargets != null) { for (RemoteAnimationTarget lastTarget : mLastAppearedTaskTargets) { for (RemoteAnimationTarget appearedTarget : appearedTaskTargets) { - if (appearedTarget.taskId != lastTarget.taskId) { + if (lastTarget != null && + appearedTarget.taskId != lastTarget.taskId) { mController.removeTaskTarget(lastTarget.taskId); } }