summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorNick Chameyev <nickchameyev@google.com>2021-09-21 16:09:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-09-21 16:09:41 +0000
commitc87aa1a23e11409cd5ea30b217d71dbc2e0787b4 (patch)
tree658477f1032f016c2c0a6375ceabb4dd52d9f887 /core/java
parent348a0e6e3c7e5b8a7554d18cd206edab179b926b (diff)
parent0a14f33198d939db9cca92c44b7f2789c32fe001 (diff)
Merge "Add should use default unfold transition attribute to wallpaper" into sc-v2-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/WallpaperInfo.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/app/WallpaperInfo.java b/core/java/android/app/WallpaperInfo.java
index e9b01750b3b1..4dff4e0e84d6 100644
--- a/core/java/android/app/WallpaperInfo.java
+++ b/core/java/android/app/WallpaperInfo.java
@@ -81,6 +81,7 @@ public final class WallpaperInfo implements Parcelable {
final int mContextDescriptionResource;
final boolean mShowMetadataInPreview;
final boolean mSupportsAmbientMode;
+ final boolean mShouldUseDefaultUnfoldTransition;
final String mSettingsSliceUri;
final boolean mSupportMultipleDisplays;
@@ -145,6 +146,9 @@ public final class WallpaperInfo implements Parcelable {
mSupportsAmbientMode = sa.getBoolean(
com.android.internal.R.styleable.Wallpaper_supportsAmbientMode,
false);
+ mShouldUseDefaultUnfoldTransition = sa.getBoolean(
+ com.android.internal.R.styleable.Wallpaper_shouldUseDefaultUnfoldTransition,
+ true);
mSettingsSliceUri = sa.getString(
com.android.internal.R.styleable.Wallpaper_settingsSliceUri);
mSupportMultipleDisplays = sa.getBoolean(
@@ -171,6 +175,7 @@ public final class WallpaperInfo implements Parcelable {
mSupportsAmbientMode = source.readInt() != 0;
mSettingsSliceUri = source.readString();
mSupportMultipleDisplays = source.readInt() != 0;
+ mShouldUseDefaultUnfoldTransition = source.readInt() != 0;
mService = ResolveInfo.CREATOR.createFromParcel(source);
}
@@ -393,6 +398,26 @@ public final class WallpaperInfo implements Parcelable {
return mSupportMultipleDisplays;
}
+ /**
+ * Returns whether this wallpaper should receive default zooming updates when unfolding.
+ * If set to false the wallpaper will not receive zoom events when folding or unfolding
+ * a foldable device, so it can implement its own unfold transition.
+ * <p>
+ * This corresponds to the value {@link
+ * android.R.styleable#Wallpaper_shouldUseDefaultUnfoldTransition} in the XML description
+ * of the wallpaper.
+ * <p>
+ * The default value is {@code true}.
+ *
+ * @see android.R.styleable#Wallpaper_shouldUseDefaultUnfoldTransition
+ * @return {@code true} if wallpaper should receive default fold/unfold transition updates
+ *
+ * @attr ref android.R.styleable#Wallpaper_shouldUseDefaultUnfoldTransition
+ */
+ public boolean shouldUseDefaultUnfoldTransition() {
+ return mShouldUseDefaultUnfoldTransition;
+ }
+
public void dump(Printer pw, String prefix) {
pw.println(prefix + "Service:");
mService.dump(pw, prefix + " ");
@@ -423,6 +448,7 @@ public final class WallpaperInfo implements Parcelable {
dest.writeInt(mSupportsAmbientMode ? 1 : 0);
dest.writeString(mSettingsSliceUri);
dest.writeInt(mSupportMultipleDisplays ? 1 : 0);
+ dest.writeInt(mShouldUseDefaultUnfoldTransition ? 1 : 0);
mService.writeToParcel(dest, flags);
}