Merge "Add a SysPropBooleanFlag: wallpaper cropping for foldables" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
75c52789b7
@@ -258,4 +258,11 @@ interface IWallpaperManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
boolean isLockscreenLiveWallpaperEnabled();
|
boolean isLockscreenLiveWallpaperEnabled();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Temporary method for project b/270726737.
|
||||||
|
* Return true if the wallpaper supports different crops for different display dimensions.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
boolean isMultiCropEnabled();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ public class WallpaperManager {
|
|||||||
private final boolean mWcgEnabled;
|
private final boolean mWcgEnabled;
|
||||||
private final ColorManagementProxy mCmProxy;
|
private final ColorManagementProxy mCmProxy;
|
||||||
private static Boolean sIsLockscreenLiveWallpaperEnabled = null;
|
private static Boolean sIsLockscreenLiveWallpaperEnabled = null;
|
||||||
|
private static Boolean sIsMultiCropEnabled = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special drawable that draws a wallpaper as fast as possible. Assumes
|
* Special drawable that draws a wallpaper as fast as possible. Assumes
|
||||||
@@ -865,6 +866,26 @@ public class WallpaperManager {
|
|||||||
return sIsLockscreenLiveWallpaperEnabled;
|
return sIsLockscreenLiveWallpaperEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Temporary method for project b/270726737
|
||||||
|
* @return true if the wallpaper supports different crops for different display dimensions
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static boolean isMultiCropEnabled() {
|
||||||
|
if (sGlobals == null) {
|
||||||
|
sIsMultiCropEnabled = SystemProperties.getBoolean(
|
||||||
|
"persist.wm.debug.wallpaper_multi_crop", false);
|
||||||
|
}
|
||||||
|
if (sIsMultiCropEnabled == null) {
|
||||||
|
try {
|
||||||
|
sIsMultiCropEnabled = sGlobals.mService.isMultiCropEnabled();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.rethrowFromSystemServer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sIsMultiCropEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate whether wcg (Wide Color Gamut) should be enabled.
|
* Indicate whether wcg (Wide Color Gamut) should be enabled.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -524,6 +524,13 @@ object Flags {
|
|||||||
@JvmField val LOCKSCREEN_LIVE_WALLPAPER =
|
@JvmField val LOCKSCREEN_LIVE_WALLPAPER =
|
||||||
sysPropBooleanFlag(1117, "persist.wm.debug.lockscreen_live_wallpaper", default = false)
|
sysPropBooleanFlag(1117, "persist.wm.debug.lockscreen_live_wallpaper", default = false)
|
||||||
|
|
||||||
|
// TODO(b/281648899): Tracking bug
|
||||||
|
@Keep
|
||||||
|
@JvmField
|
||||||
|
val WALLPAPER_MULTI_CROP =
|
||||||
|
sysPropBooleanFlag(1118, "persist.wm.debug.wallpaper_multi_crop", default = false)
|
||||||
|
|
||||||
|
|
||||||
// 1200 - predictive back
|
// 1200 - predictive back
|
||||||
@Keep
|
@Keep
|
||||||
@JvmField
|
@JvmField
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
|||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
/** True to enable a second engine for lock screen wallpaper when different from system wp. */
|
/** True to enable a second engine for lock screen wallpaper when different from system wp. */
|
||||||
private final boolean mIsLockscreenLiveWallpaperEnabled;
|
private final boolean mIsLockscreenLiveWallpaperEnabled;
|
||||||
|
/** True to support different crops for different display dimensions */
|
||||||
|
private final boolean mIsMultiCropEnabled;
|
||||||
/** Tracks wallpaper being migrated from system+lock to lock when setting static wp. */
|
/** Tracks wallpaper being migrated from system+lock to lock when setting static wp. */
|
||||||
WallpaperDestinationChangeHandler mPendingMigrationViaStatic;
|
WallpaperDestinationChangeHandler mPendingMigrationViaStatic;
|
||||||
|
|
||||||
@@ -1602,6 +1604,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
|||||||
|
|
||||||
mIsLockscreenLiveWallpaperEnabled =
|
mIsLockscreenLiveWallpaperEnabled =
|
||||||
SystemProperties.getBoolean("persist.wm.debug.lockscreen_live_wallpaper", false);
|
SystemProperties.getBoolean("persist.wm.debug.lockscreen_live_wallpaper", false);
|
||||||
|
mIsMultiCropEnabled =
|
||||||
|
SystemProperties.getBoolean("persist.wm.debug.wallpaper_multi_crop", false);
|
||||||
LocalServices.addService(WallpaperManagerInternal.class, new LocalService());
|
LocalServices.addService(WallpaperManagerInternal.class, new LocalService());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3723,6 +3727,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
|||||||
return mIsLockscreenLiveWallpaperEnabled;
|
return mIsLockscreenLiveWallpaperEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMultiCropEnabled() {
|
||||||
|
return mIsMultiCropEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
private void onDisplayReadyInternal(int displayId) {
|
private void onDisplayReadyInternal(int displayId) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (mLastWallpaper == null) {
|
if (mLastWallpaper == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user