Loading core/java/android/content/theming/ThemeSettings.java +3 −5 Original line number Diff line number Diff line Loading @@ -151,14 +151,12 @@ public abstract sealed class ThemeSettings implements Parcelable permits ThemeSe @Override public ThemeSettings createFromParcel(Parcel in) { // The first string read is the concrete type, used by the sealed class's parceling // to delegate to the correct subclass constructor. // We then read the actual type string that we wrote in the subclass's writeToParcel. in.readString(); // Consume the type written by the sealed class itself for dispatch String type = in.readString(); // This is the type we're interested in // to delegate to the correct subclass constructor.. String type = in.readString(); return switch (type) { case VALUE_HOME_WALLPAPER -> new ThemeSettingsWallpaper(in); case VALUE_PRESET -> new ThemeSettingsPreset(in); default -> throw new IllegalArgumentException( case null, default -> throw new IllegalArgumentException( "Invalid type for ThemeSetting: " + type); }; } Loading services/tests/servicestests/src/com/android/server/theming/ThemeSettingsTests.java +1 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.server.theming; import static android.content.theming.FieldColorSource.VALUE_HOME_WALLPAPER; import static android.content.theming.FieldColorSource.VALUE_PRESET; import static android.content.theming.ThemeSettings.OVERLAY_CATEGORY_ACCENT_COLOR; import static android.content.theming.ThemeSettings.OVERLAY_CATEGORY_SYSTEM_PALETTE; Loading Loading @@ -105,7 +104,6 @@ public class ThemeSettingsTests { ThemeSettings originalSettings = ThemeSettings.fromJson(WALLPAPER_JSON); Parcel parcel = Parcel.obtain(); parcel.writeString(VALUE_HOME_WALLPAPER); originalSettings.writeToParcel(parcel, 0); parcel.setDataPosition(0); Loading @@ -122,7 +120,6 @@ public class ThemeSettingsTests { ThemeSettings originalSettings = ThemeSettings.fromJson(PRESET_JSON); Parcel parcel = Parcel.obtain(); parcel.writeString(VALUE_PRESET); originalSettings.writeToParcel(parcel, 0); parcel.setDataPosition(0); Loading Loading
core/java/android/content/theming/ThemeSettings.java +3 −5 Original line number Diff line number Diff line Loading @@ -151,14 +151,12 @@ public abstract sealed class ThemeSettings implements Parcelable permits ThemeSe @Override public ThemeSettings createFromParcel(Parcel in) { // The first string read is the concrete type, used by the sealed class's parceling // to delegate to the correct subclass constructor. // We then read the actual type string that we wrote in the subclass's writeToParcel. in.readString(); // Consume the type written by the sealed class itself for dispatch String type = in.readString(); // This is the type we're interested in // to delegate to the correct subclass constructor.. String type = in.readString(); return switch (type) { case VALUE_HOME_WALLPAPER -> new ThemeSettingsWallpaper(in); case VALUE_PRESET -> new ThemeSettingsPreset(in); default -> throw new IllegalArgumentException( case null, default -> throw new IllegalArgumentException( "Invalid type for ThemeSetting: " + type); }; } Loading
services/tests/servicestests/src/com/android/server/theming/ThemeSettingsTests.java +1 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.server.theming; import static android.content.theming.FieldColorSource.VALUE_HOME_WALLPAPER; import static android.content.theming.FieldColorSource.VALUE_PRESET; import static android.content.theming.ThemeSettings.OVERLAY_CATEGORY_ACCENT_COLOR; import static android.content.theming.ThemeSettings.OVERLAY_CATEGORY_SYSTEM_PALETTE; Loading Loading @@ -105,7 +104,6 @@ public class ThemeSettingsTests { ThemeSettings originalSettings = ThemeSettings.fromJson(WALLPAPER_JSON); Parcel parcel = Parcel.obtain(); parcel.writeString(VALUE_HOME_WALLPAPER); originalSettings.writeToParcel(parcel, 0); parcel.setDataPosition(0); Loading @@ -122,7 +120,6 @@ public class ThemeSettingsTests { ThemeSettings originalSettings = ThemeSettings.fromJson(PRESET_JSON); Parcel parcel = Parcel.obtain(); parcel.writeString(VALUE_PRESET); originalSettings.writeToParcel(parcel, 0); parcel.setDataPosition(0); Loading