diff options
author | Andy Mast <andy@cyngn.com> | 2015-05-20 17:27:42 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2015-10-27 18:19:23 -0700 |
commit | c07ca25126b4f9650f86af043a44fa90c37025fd (patch) | |
tree | 3dc976e0dc679743b82866e3d7471b6d9e0ecd1a /core/java/android/content | |
parent | 58f5b46439cc714a25400c42110423d4f73aa9c0 (diff) | |
download | frameworks_base-c07ca25126b4f9650f86af043a44fa90c37025fd.zip frameworks_base-c07ca25126b4f9650f86af043a44fa90c37025fd.tar.gz frameworks_base-c07ca25126b4f9650f86af043a44fa90c37025fd.tar.bz2 |
[1/2] Themes: Multiwallpaper support
1. Add wallpaper component id to ThemeChangeRequest
2. Query themes provider for the wallpaper path given a pkgName and wallpaper id.
Previously the path was only assumed from the pkgName.
3. Update the mix'n'match table to reflect the component id
Change-Id: Ia38da1c36b3c2f7f038d0a34054aff2257a294dc
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/res/ThemeChangeRequest.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/content/res/ThemeChangeRequest.java b/core/java/android/content/res/ThemeChangeRequest.java index 6c55cd2..08b0217 100644 --- a/core/java/android/content/res/ThemeChangeRequest.java +++ b/core/java/android/content/res/ThemeChangeRequest.java @@ -27,9 +27,12 @@ import static android.provider.ThemesContract.ThemesColumns.*; /** @hide */ public final class ThemeChangeRequest implements Parcelable { + public static final int DEFAULT_WALLPAPER_ID = -1; + private final Map<String, String> mThemeComponents = new HashMap<String, String>(); private final Map<String, String> mPerAppOverlays = new HashMap<String, String>(); private RequestType mRequestType; + private long mWallpaperId = -1; public String getOverlayThemePackageName() { return getThemePackageNameForComponent(MODIFIES_OVERLAYS); @@ -79,6 +82,10 @@ public final class ThemeChangeRequest implements Parcelable { return Collections.unmodifiableMap(mThemeComponents); } + public long getWallpaperId() { + return mWallpaperId; + } + /** * Get the mapping for per app themes * @return A mapping of apps and the theme to apply for each one. or null if none set. @@ -100,7 +107,7 @@ public final class ThemeChangeRequest implements Parcelable { } private ThemeChangeRequest(Map<String, String> components, Map<String, String> perAppThemes, - RequestType requestType) { + RequestType requestType, long wallpaperId) { if (components != null) { mThemeComponents.putAll(components); } @@ -108,6 +115,7 @@ public final class ThemeChangeRequest implements Parcelable { mPerAppOverlays.putAll(perAppThemes); } mRequestType = requestType; + mWallpaperId = wallpaperId; } private ThemeChangeRequest(Parcel source) { @@ -121,6 +129,7 @@ public final class ThemeChangeRequest implements Parcelable { mPerAppOverlays.put(source.readString(), source.readString()); } mRequestType = RequestType.values()[source.readInt()]; + mWallpaperId = source.readLong(); } @Override @@ -141,6 +150,7 @@ public final class ThemeChangeRequest implements Parcelable { dest.writeString(mPerAppOverlays.get(appPkgName)); } dest.writeInt(mRequestType.ordinal()); + dest.writeLong(mWallpaperId); } public static final Parcelable.Creator<ThemeChangeRequest> CREATOR = @@ -168,6 +178,7 @@ public final class ThemeChangeRequest implements Parcelable { Map<String, String> mThemeComponents = new HashMap<String, String>(); Map<String, String> mPerAppOverlays = new HashMap<String, String>(); RequestType mRequestType = RequestType.USER_REQUEST; + long mWallpaperId; public Builder() {} @@ -199,6 +210,12 @@ public final class ThemeChangeRequest implements Parcelable { return setComponent(MODIFIES_LAUNCHER, pkgName); } + // Used in the case that more than one wallpaper exists for a given pkg name + public Builder setWallpaperId(long id) { + mWallpaperId = id; + return this; + } + public Builder setLockWallpaper(String pkgName) { return setComponent(MODIFIES_LOCKSCREEN, pkgName); } @@ -242,7 +259,8 @@ public final class ThemeChangeRequest implements Parcelable { } public ThemeChangeRequest build() { - return new ThemeChangeRequest(mThemeComponents, mPerAppOverlays, mRequestType); + return new ThemeChangeRequest(mThemeComponents, mPerAppOverlays, + mRequestType, mWallpaperId); } } } |