Allocate insane memory just for CI

Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach committed 2026-01-10 20:46:44 +07:00
1 parent dd4a08be61
commit b67168f737
1183 files changed
+71641 -76403

No files matched your search

@@ -40,7 +40,6 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BACK_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BACK_DISMISS_IME;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_BUTTON_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_VISIBLE;
@@ -73,6 +72,7 @@ import android.graphics.Region.Op;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.PaintDrawable;
import android.graphics.drawable.RotateDrawable;
import android.inputmethodservice.InputMethodService;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemProperties;
@@ -167,9 +167,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_VOICE_INTERACTION_WINDOW_SHOWING;
private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons";
private static final String SUW_THEME_SYSTEM_PROPERTY = "setupwizard.theme";
private static final String GLIF_EXPRESSIVE_THEME = "glif_expressive";
private static final String GLIF_EXPRESSIVE_LIGHT_THEME = "glif_expressive_light";
private static final double SQUARE_ASPECT_RATIO_BOTTOM_BOUND = 0.95;
private static final double SQUARE_ASPECT_RATIO_UPPER_BOUND = 1.05;
@@ -281,9 +278,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (mContext.isPhoneMode()) {
mTaskbarTransitions = new TaskbarTransitions(mContext, mNavButtonsView);
}
String SUWTheme = SystemProperties.get(SUW_THEME_SYSTEM_PROPERTY, "");
mIsExpressiveThemeEnabled = SUWTheme.equals(GLIF_EXPRESSIVE_THEME)
|| SUWTheme.equals(GLIF_EXPRESSIVE_LIGHT_THEME);
String SUWTheme = SystemProperties.get("setupwizard.theme", "");
mIsExpressiveThemeEnabled = SUWTheme.equals("glif_expressive")
|| SUWTheme.equals("glif_expressive_light");
}
/**
@@ -313,7 +310,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
}
mNavButtonsView.setLayoutParams(navButtonsViewLayoutParams);
mIsImeRenderingNavButtons = mContext.imeDrawsImeNavBar();
mIsImeRenderingNavButtons =
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
if (!mIsImeRenderingNavButtons) {
// IME switcher
final int switcherResId = Flags.imeSwitcherRevamp()
@@ -347,10 +345,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// Start at 1 because relevant flags are unset at init.
mOnBackgroundNavButtonColorOverrideMultiplier.value = 1;
// Potentially force the back button to be visible during setup wizard. The back button
// won't show up if the expressive theme is enabled and simple view is disabled
boolean shouldShowInSetup = !mContext.isUserSetupComplete()
&& (!mIsExpressiveThemeEnabled || mContext.isSimpleViewEnabled());
// Potentially force the back button to be visible during setup wizard.
boolean shouldShowInSetup = !mContext.isUserSetupComplete() && !mIsExpressiveThemeEnabled;
boolean isInKidsMode = mContext.isNavBarKidsModeActive();
boolean alwaysShowButtons = isThreeButtonNav || shouldShowInSetup;
@@ -366,7 +362,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
flags -> (flags & flagsToRemoveTranslation) != 0, AnimatedFloat.VALUE,
1, 0));
// Center nav buttons in new height for IME.
float transForIme = (mContext.getDeviceProfile().getTaskbarProfile().getHeight()
float transForIme = (mContext.getDeviceProfile().taskbarHeight
- mControllers.taskbarInsetsController.getTaskbarHeightForIme()) / 2f;
// For gesture nav, nav buttons only show for IME anyway so keep them translated down.
float defaultButtonTransY = alwaysShowButtons ? 0 : transForIme;
@@ -394,6 +390,13 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(),
flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
}
} else if (!mIsImeRenderingNavButtons) {
View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
mStartContextualContainer, mControllers.navButtonController, R.id.back);
imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90);
// Only show when IME is visible.
mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
flags -> (flags & FLAG_IME_VISIBLE) != 0));
}
mFloatingRotationButton = new FloatingRotationButton(
ENABLE_TASKBAR_NAVBAR_UNIFICATION ? mNavigationBarPanelContext : mContext,
@@ -420,7 +423,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
mSeparateWindowParent = new BaseDragLayer<>(mContext, null, 0) {
@Override
public void recreateControllers() {
super.recreateControllers();
mControllers = new TouchController[0];
}
@@ -505,13 +507,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
navButtonController.onButtonClick(BUTTON_RECENTS, v);
mHitboxExtender.onRecentsButtonClicked();
});
mRecentsButton.addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
int[] location = v.getLocationOnScreen();
Rect bounds = new Rect(location[0], location[1], location[0] + v.getWidth(),
location[1] + v.getHeight());
navButtonController.onRecentsButtonLayoutChanged(bounds);
});
mPropertyHolders.add(new StatePropertyHolder(mRecentsButton,
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 && (flags & FLAG_DISABLE_RECENTS) == 0
&& !mContext.isNavBarKidsModeActive() && !mContext.isGestureNav()));
@@ -529,20 +524,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
navButtonController.onButtonLongClick(BUTTON_SPACE, view));
}
/**
* Method to determine whether the Navigation Bar is viewable in Setup Wizard
*
* @return {@code true} if the device is in Setup Wizard, the expressive theme is enabled,
* and Simple View is NOT enabled
*/
boolean isNavbarHiddenInSUW() {
if (mContext == null) {
return false;
}
return !mContext.isUserSetupComplete() && mIsExpressiveThemeEnabled
&& !mContext.isSimpleViewEnabled();
}
/**
* Method to determine whether to show the home button in lockscreen
*
@@ -566,9 +547,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
boolean isBackDismissIme = (sysUiStateFlags & SYSUI_STATE_BACK_DISMISS_IME) != 0;
boolean a11yVisible = (sysUiStateFlags & SYSUI_STATE_A11Y_BUTTON_CLICKABLE) != 0;
boolean isHomeDisabled = (sysUiStateFlags & SYSUI_STATE_HOME_DISABLED) != 0;
// TODO: b/409075366 - ensure this signal is correctly set for external displays.
boolean isRecentsDisabled = mContext.isPrimaryDisplay()
&& (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0;
boolean isRecentsDisabled = (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0;
boolean isBackDisabled = (sysUiStateFlags & SYSUI_STATE_BACK_DISABLED) != 0;
long shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
@@ -578,8 +557,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
(sysUiStateFlags & SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING) != 0;
boolean isKeyboardShortcutHelperShowing =
(sysUiStateFlags & SYSUI_STATE_SHORTCUT_HELPER_SHOWING) != 0;
boolean splitAnimationRunning =
(sysUiStateFlags & SYSUI_STATE_DISABLE_GESTURE_SPLIT_INVOCATION) != 0;
updateStateForFlag(FLAG_IME_SWITCHER_BUTTON_VISIBLE, isImeSwitcherButtonVisible);
updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
updateStateForFlag(FLAG_BACK_DISMISS_IME, isBackDismissIme);
@@ -599,12 +577,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
mA11yButton.setLongClickable(a11yLongClickable);
updateButtonLayoutSpacing();
}
if (mNavButtonContainer.getChildCount() > 0) {
for (int i = 0; i < mNavButtonContainer.getChildCount(); i++) {
mNavButtonContainer.getChildAt(i).setEnabled(!splitAnimationRunning);
}
}
}
public void updateStateForSysuiFlags(@SystemUiStateFlags long systemUiStateFlags,
@@ -672,8 +644,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
* Returns true if the recents (overview) button is disabled
*/
public boolean isRecentsDisabled() {
// TODO: b/409075366 - ensure this signal is correctly set for external displays.
return (mState & FLAG_DISABLE_RECENTS) != 0 && mContext.isPrimaryDisplay();
return (mState & FLAG_DISABLE_RECENTS) != 0;
}
/**
@@ -728,13 +699,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (mBackButton == null) {
return;
}
boolean predictiveBackThreeButtonNav;
try {
predictiveBackThreeButtonNav = predictiveBackThreeButtonNav();
} catch (Throwable t) {
predictiveBackThreeButtonNav = false;
}
if (predictiveBackThreeButtonNav) {
if (predictiveBackThreeButtonNav()) {
setupBackButtonAccessibility(mBackButton, accessibilityDelegate);
} else {
mBackButton.setAccessibilityDelegate(accessibilityDelegate);
@@ -929,13 +894,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
buttonView.setImageResource(drawableId);
buttonView.setContentDescription(parent.getContext().getString(
navButtonController.getButtonContentDescription(buttonType)));
boolean predictiveBackThreeButtonNav;
try {
predictiveBackThreeButtonNav = predictiveBackThreeButtonNav();
} catch (Throwable t) {
predictiveBackThreeButtonNav = false;
}
if (predictiveBackThreeButtonNav && buttonType == BUTTON_BACK) {
if (predictiveBackThreeButtonNav() && buttonType == BUTTON_BACK) {
// set up special touch listener for back button to support predictive back
setupBackButtonAccessibility(buttonView, null);
setBackButtonTouchListener(buttonView, navButtonController);
@@ -949,8 +908,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
navButtonController.onButtonLongClick(buttonType, view));
buttonView.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
}
return false;
});
@@ -994,8 +952,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
hasSentDownEvent.set(false);
mHandler.postDelayed(longPressTimeout, PREDICTIVE_BACK_TIMEOUT_MS);
rect.set(0, 0, v.getWidth(), v.getHeight());
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
}
boolean isCancelled = motionEventAction == MotionEvent.ACTION_CANCEL
|| (!rect.contains(event.getX(), event.getY())
@@ -1043,15 +1000,15 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (mFloatingRotationButton != null) {
mFloatingRotationButton.onConfigurationChanged(configChanges);
}
if (!mContext.isUserSetupComplete() && !ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
if (!mContext.isUserSetupComplete()) {
handleSetupUi();
}
updateButtonLayoutSpacing();
}
private void handleSetupUi() {
// Setup wizard handles the UI when the expressive theme is enabled and Simple View isn't.
if (mIsExpressiveThemeEnabled && !mContext.isSimpleViewEnabled()) {
// Setup wizard handles the UI when the expressive theme is enabled.
if (mIsExpressiveThemeEnabled) {
return;
}
// Since setup wizard only has back button enabled, it looks strange to be
@@ -1070,9 +1027,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// If SUW is on a large screen device that is landscape (or has a square aspect
// ratio) the back button has to be placed accordingly
if ((deviceProfile.getDeviceProperties().isTablet() && deviceProfile.getDeviceProperties().isLandscape())
|| (deviceProfile.getDeviceProperties().getAspectRatio() > SQUARE_ASPECT_RATIO_BOTTOM_BOUND
&& deviceProfile.getDeviceProperties().getAspectRatio() < SQUARE_ASPECT_RATIO_UPPER_BOUND)) {
if ((deviceProfile.isTablet && deviceProfile.isLandscape)
|| (deviceProfile.aspectRatio > SQUARE_ASPECT_RATIO_BOTTOM_BOUND
&& deviceProfile.aspectRatio < SQUARE_ASPECT_RATIO_UPPER_BOUND)) {
navButtonsLayoutParams.setMarginStart(
resources.getDimensionPixelSize(R.dimen.taskbar_back_button_suw_start_margin));
navButtonsViewLayoutParams.bottomMargin = resources.getDimensionPixelSize(
@@ -1083,7 +1040,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
int phoneOrPortraitSetupMargin = resources.getDimensionPixelSize(
R.dimen.taskbar_contextual_button_suw_margin);
navButtonsLayoutParams.setMarginStart(phoneOrPortraitSetupMargin);
navButtonsLayoutParams.bottomMargin = !deviceProfile.getDeviceProperties().isLandscape()
navButtonsLayoutParams.bottomMargin = !deviceProfile.isLandscape
? 0
: phoneOrPortraitSetupMargin - (resources.getDimensionPixelSize(
R.dimen.taskbar_nav_buttons_size) / 2);
@@ -1254,9 +1211,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
public void onDestroy() {
mPropertyHolders.clear();
mControllers.rotationButtonController.unregisterListeners();
if (mFloatingRotationButton != null) {
mFloatingRotationButton.hide();
mFloatingRotationButton = null;
}
moveNavButtonsBackToTaskbarWindow();
@@ -1445,11 +1402,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// Skip additional translations on the nav bar container while in SUW layout
return 0;
} else if (mContext.shouldStartAlignTaskbar()) {
int navBarSpacing = dp.getHotseatProfile().getInlineNavButtonsEndSpacingPx();
int navBarSpacing = dp.inlineNavButtonsEndSpacingPx;
// If the taskbar is start aligned the navigation bar is aligned to the start or end of
// the container, depending on the bubble bar location
if (isNavbarOnRight) {
navBarTargetStartX = dp.getDeviceProperties().getWidthPx() - navBarSpacing - mNavButtonContainer.getWidth();
navBarTargetStartX = dp.widthPx - navBarSpacing - mNavButtonContainer.getWidth();
} else {
navBarTargetStartX = navBarSpacing;
}
@@ -1462,7 +1419,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (isNavbarOnRight) {
if (mNavButtonsView.isLayoutRtl()) {
float taskBarEnd = taskbarBounds.right;
navBarTargetStartX = (dp.getDeviceProperties().getWidthPx() + taskBarEnd - navbarWidth) / 2;
navBarTargetStartX = (dp.widthPx + taskBarEnd - navbarWidth) / 2;
} else {
navBarTargetStartX = mNavButtonContainer.getLeft();
}
@@ -1480,7 +1437,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// screen.
Rect transientTaskbarIconLayoutBoundsInParent = mControllers.taskbarViewController
.getTransientTaskbarIconLayoutBoundsInParent();
if (mContext.getDeviceProfile().getDeviceProperties().isPhone()
if (mContext.getDeviceProfile().isPhone
|| transientTaskbarIconLayoutBoundsInParent.isEmpty()
|| mNavButtonsView.getWidth() == 0) {
return;