Fix: Adapt to missing flags in Android 16 QPR1 Beta 2 (#5538)

* Fix: Adapt to missing Flags in android 16 qpr1 beta 2

* fix: revert jvm memory flag

I accidentally committed it, oops

Co-authored-by: Pun Butrach <pun.butrach@gmail.com>

---------

Co-authored-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Adil Hanney
2025-06-15 08:16:08 +01:00
committed by GitHub
parent 67442b35b5
commit 0d18a381da
5 changed files with 36 additions and 1 deletions

View File

@@ -321,6 +321,12 @@ public class CustomFeatureFlags implements FeatureFlags {
return getValue(Flags.FLAG_FLOATING_MENU_RADII_ANIMATION,
FeatureFlags::floatingMenuRadiiAnimation);
}
@Override
public boolean generatedPreviews() {
return getValue(Flags.FLAG_GENERATED_PREVIEWS,
FeatureFlags::generatedPreviews);
}
@Override
public boolean getConnectedDeviceNameUnsynchronized() {

View File

@@ -106,6 +106,8 @@ public interface FeatureFlags {
boolean floatingMenuRadiiAnimation();
boolean generatedPreviews();
boolean getConnectedDeviceNameUnsynchronized();
boolean glanceableHubAllowKeyguardWhenDreaming();

View File

@@ -64,6 +64,7 @@ public final class FeatureFlagsImpl implements FeatureFlags {
private static boolean floatingMenuNarrowTargetContentObserver = true;
private static boolean floatingMenuOverlapsNavBarsFlag = true;
private static boolean floatingMenuRadiiAnimation = true;
private static boolean generatedPreviews = true;
private static boolean getConnectedDeviceNameUnsynchronized = true;
private static boolean glanceableHubAllowKeyguardWhenDreaming = false;
private static boolean glanceableHubFullscreenSwipe = false;
@@ -241,6 +242,7 @@ public final class FeatureFlagsImpl implements FeatureFlags {
fastUnlockTransition = foundPackage;
fixImageWallpaperCrashSurfaceAlreadyReleased = foundPackage;
fixScreenshotActionDismissSystemWindows = foundPackage;
generatedPreviews = foundPackage;
getConnectedDeviceNameUnsynchronized = foundPackage;
glanceableHubAllowKeyguardWhenDreaming = foundPackage;
glanceableHubFullscreenSwipe = foundPackage;
@@ -529,6 +531,8 @@ public final class FeatureFlagsImpl implements FeatureFlags {
properties.getBoolean(Flags.FLAG_FIX_IMAGE_WALLPAPER_CRASH_SURFACE_ALREADY_RELEASED, true);
fixScreenshotActionDismissSystemWindows =
properties.getBoolean(Flags.FLAG_FIX_SCREENSHOT_ACTION_DISMISS_SYSTEM_WINDOWS, true);
generatedPreviews =
properties.getBoolean(Flags.FLAG_GENERATED_PREVIEWS, true);
getConnectedDeviceNameUnsynchronized =
properties.getBoolean(Flags.FLAG_GET_CONNECTED_DEVICE_NAME_UNSYNCHRONIZED, true);
glanceableHubAllowKeyguardWhenDreaming =
@@ -1553,6 +1557,22 @@ public final class FeatureFlagsImpl implements FeatureFlags {
return floatingMenuRadiiAnimation;
}
@Override
public boolean generatedPreviews() {
if (isReadFromNew) {
if (!isCached) {
init();
}
} else {
if (!systemui_is_cached) {
load_overrides_systemui();
}
}
return generatedPreviews;
}
@Override

View File

@@ -105,6 +105,8 @@ public final class Flags {
/** @hide */
public static final String FLAG_FLOATING_MENU_RADII_ANIMATION = "com.android.systemui.floating_menu_radii_animation";
/** @hide */
public static final String FLAG_GENERATED_PREVIEWS = "android.appwidget.flags.generated_previews";
/** @hide */
public static final String FLAG_GET_CONNECTED_DEVICE_NAME_UNSYNCHRONIZED = "com.android.systemui.get_connected_device_name_unsynchronized";
/** @hide */
public static final String FLAG_GLANCEABLE_HUB_ALLOW_KEYGUARD_WHEN_DREAMING = "com.android.systemui.glanceable_hub_allow_keyguard_when_dreaming";
@@ -508,6 +510,10 @@ public final class Flags {
public static boolean floatingMenuRadiiAnimation() {
return FEATURE_FLAGS.floatingMenuRadiiAnimation();
}
public static boolean generatedPreviews() {
return FEATURE_FLAGS.generatedPreviews();
}
public static boolean getConnectedDeviceNameUnsynchronized() {
return FEATURE_FLAGS.getConnectedDeviceNameUnsynchronized();

View File

@@ -38,6 +38,7 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.widget.custom.CustomWidgetManager;
import com.android.systemui.Flags;
import java.util.Collections;
import java.util.List;
@@ -161,7 +162,7 @@ public class WidgetManagerHelper {
@RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM)
public RemoteViews loadGeneratedPreview(@NonNull AppWidgetProviderInfo info,
int widgetCategory) {
if (!android.appwidget.flags.Flags.generatedPreviews()) return null;
if (!Flags.generatedPreviews()) return null;
return mAppWidgetManager.getWidgetPreview(info.provider, info.getProfile(), widgetCategory);
}