Loading src/com/android/customization/model/theme/ThemeManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY import android.graphics.Point; import android.provider.Settings; import android.text.TextUtils; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; Loading @@ -41,6 +42,7 @@ import com.android.wallpaper.module.WallpaperPersister.SetWallpaperCallback; import com.android.wallpaper.module.WallpaperSetter; import com.android.wallpaper.picker.SetWallpaperDialogFragment.Listener; import com.android.wallpaper.util.WallpaperCropUtils; import org.json.JSONObject; import java.util.HashSet; import java.util.Map; Loading Loading @@ -210,4 +212,17 @@ public class ThemeManager implements CustomizationManager<ThemeBundle> { public ThemeBundle findThemeByPackages(ThemeBundle other) { return mProvider.findEquivalent(other); } /** * Store empty theme if no theme has been set yet. This will prevent Settings from showing the * suggestion to select a theme */ public void storeEmptyTheme() { String themeSetting = Settings.Secure.getString(mActivity.getContentResolver(), ResourceConstants.THEME_SETTING); if (TextUtils.isEmpty(themeSetting)) { Settings.Secure.putString(mActivity.getContentResolver(), ResourceConstants.THEME_SETTING, new JSONObject().toString()); } } } src/com/android/customization/picker/CustomizationPickerActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,10 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal if (!prefs.getTabVisited(name)) { prefs.setTabVisited(name); hideTipDot(item); if (id == R.id.nav_theme) { getThemeManager().storeEmptyTheme(); } } return true; }); Loading Loading
src/com/android/customization/model/theme/ThemeManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY import android.graphics.Point; import android.provider.Settings; import android.text.TextUtils; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; Loading @@ -41,6 +42,7 @@ import com.android.wallpaper.module.WallpaperPersister.SetWallpaperCallback; import com.android.wallpaper.module.WallpaperSetter; import com.android.wallpaper.picker.SetWallpaperDialogFragment.Listener; import com.android.wallpaper.util.WallpaperCropUtils; import org.json.JSONObject; import java.util.HashSet; import java.util.Map; Loading Loading @@ -210,4 +212,17 @@ public class ThemeManager implements CustomizationManager<ThemeBundle> { public ThemeBundle findThemeByPackages(ThemeBundle other) { return mProvider.findEquivalent(other); } /** * Store empty theme if no theme has been set yet. This will prevent Settings from showing the * suggestion to select a theme */ public void storeEmptyTheme() { String themeSetting = Settings.Secure.getString(mActivity.getContentResolver(), ResourceConstants.THEME_SETTING); if (TextUtils.isEmpty(themeSetting)) { Settings.Secure.putString(mActivity.getContentResolver(), ResourceConstants.THEME_SETTING, new JSONObject().toString()); } } }
src/com/android/customization/picker/CustomizationPickerActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,10 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal if (!prefs.getTabVisited(name)) { prefs.setTabVisited(name); hideTipDot(item); if (id == R.id.nav_theme) { getThemeManager().storeEmptyTheme(); } } return true; }); Loading