From 4661854dd6b92f9c05358d93fc2517e2d9bf2165 Mon Sep 17 00:00:00 2001 From: Jagrut Desai Date: Thu, 23 Mar 2023 20:39:00 -0700 Subject: [PATCH 1/4] Make taskbar accessibility announcement when user is in app only. Test: Manual Bug: 265099829 Change-Id: I9d90ed7ae3479cf51b261bba63aedccf515bd2c5 --- quickstep/res/layout/transient_taskbar.xml | 2 ++ .../android/launcher3/taskbar/TaskbarStashController.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/quickstep/res/layout/transient_taskbar.xml b/quickstep/res/layout/transient_taskbar.xml index 47d63e728c..62c69336e7 100644 --- a/quickstep/res/layout/transient_taskbar.xml +++ b/quickstep/res/layout/transient_taskbar.xml @@ -26,6 +26,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" + android:focusable="true" + android:importantForAccessibility="yes" android:forceHasOverlappingRendering="false" android:layout_gravity="bottom" android:layout_marginBottom="@dimen/transient_taskbar_bottom_margin" diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 41d35cfd3e..b98f172e9b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -600,7 +600,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba if (!mIsStashed) { tryStartTaskbarTimeout(); } - mControllers.taskbarViewController.announceForAccessibility(); + + // only announce if we are actually animating + if (duration > 0 && isInApp()) { + mControllers.taskbarViewController.announceForAccessibility(); + } } }); } From 7cdc616a01d220c4f617718e8e7498a40470c6aa Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Mon, 27 Mar 2023 11:18:14 -0700 Subject: [PATCH 2/4] Changing global variable for local variable to prevent memory leaks The array mTmpObjArray is not properly clean but ther is no need for the array to be global since every time is used is provided so a use of a local variable will make sure is never leaked. Fix: 269163620 Test: the flake related to memory leak on testWorkspace should dissapear Change-Id: I29fb3dd6419f621f2ccce9db2fc5ed86358f7516 --- src/com/android/launcher3/views/FloatingIconView.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index c3633db11f..4d0e2aff2d 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -80,7 +80,6 @@ public class FloatingIconView extends FrameLayout implements public static final float SHAPE_PROGRESS_DURATION = 0.10f; private static final RectF sTmpRectF = new RectF(); - private static final Object[] sTmpObjArray = new Object[1]; private Runnable mEndRunnable; private CancellationSignal mLoadIconSignal; @@ -289,12 +288,13 @@ public class FloatingIconView extends FrameLayout implements } else { int width = (int) pos.width(); int height = (int) pos.height(); + Object[] tmpObjArray = new Object[1]; if (supportsAdaptiveIcons) { boolean shouldThemeIcon = btvIcon instanceof FastBitmapDrawable && ((FastBitmapDrawable) btvIcon).isThemed(); - drawable = getFullDrawable(l, info, width, height, shouldThemeIcon, sTmpObjArray); + drawable = getFullDrawable(l, info, width, height, shouldThemeIcon, tmpObjArray); if (drawable instanceof AdaptiveIconDrawable) { - badge = getBadge(l, info, sTmpObjArray[0]); + badge = getBadge(l, info, tmpObjArray[0]); } else { // The drawable we get back is not an adaptive icon, so we need to use the // BubbleTextView icon that is already legacy treated. @@ -306,7 +306,7 @@ public class FloatingIconView extends FrameLayout implements drawable = btvIcon; } else { drawable = getFullDrawable(l, info, width, height, true /* shouldThemeIcon */, - sTmpObjArray); + tmpObjArray); } } } @@ -679,7 +679,6 @@ public class FloatingIconView extends FrameLayout implements mOriginalIcon = null; mOnTargetChangeRunnable = null; mBadge = null; - sTmpObjArray[0] = null; sRecycledFetchIconId = sFetchIconId; mIconLoadResult = null; mClipIconView.recycle(); From fa9dbe32915d8f4392a2c3417d33cec09f17e1ae Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 27 Mar 2023 18:24:44 +0000 Subject: [PATCH 3/4] Fix lint error in errorprone target (only in tm-qpr-dev) Bug: 275111546 Test: m out/soong/.intermediates/packages/apps/Launcher3/Launcher3/android_common/lint/lint-baseline.xml Before: https://paste.googleplex.com/6542806926491648 After: https://paste.googleplex.com/5015617085112320 Change-Id: If486407303b81a38b4a35979e442299f33fa49b2 --- src/com/android/launcher3/views/ActivityContext.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java index 10f40b7124..a6744fb02a 100644 --- a/src/com/android/launcher3/views/ActivityContext.java +++ b/src/com/android/launcher3/views/ActivityContext.java @@ -324,8 +324,9 @@ public interface ActivityContext { Bundle optsBundle = null; if (v != null) { optsBundle = getActivityLaunchOptions(v, item).toBundle(); - } else if (item != null && item.animationType == LauncherSettings.Animation.DEFAULT_NO_ICON - && Utilities.ATLEAST_T) { + } else if (android.os.Build.VERSION.SDK_INT >= 33 + && item != null + && item.animationType == LauncherSettings.Animation.DEFAULT_NO_ICON) { optsBundle = ActivityOptions.makeBasic() .setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR).toBundle(); } From 4d74ad3c31d107100efb1216a132f7b83e700d92 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 27 Mar 2023 16:31:11 -0700 Subject: [PATCH 4/4] Fix transient taskbar icon size in two panel portrait DeviceProfile Fixes: 275269031 Test: use two panel device verify taskbar icon size in portrait verify taskbar icon size in landscape rotate between the two orientation Change-Id: I21ae4aee90c3aa54615d8d0881acb40d8b4f351f --- src/com/android/launcher3/InvariantDeviceProfile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 47396a530f..0c19e4bab1 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -1144,7 +1144,7 @@ public class InvariantDeviceProfile { transientTaskbarIconSize[INDEX_DEFAULT]); transientTaskbarIconSize[INDEX_TWO_PANEL_PORTRAIT] = a.getFloat( R.styleable.ProfileDisplayOption_transientTaskbarIconSizeTwoPanelPortrait, - hotseatQsbSpace[INDEX_DEFAULT]); + transientTaskbarIconSize[INDEX_DEFAULT]); a.recycle(); }