From ed108f3d125b0a4cc465057e3514caf781cdea19 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Thu, 18 Oct 2012 16:49:24 -0400 Subject: Frameworks base: Promote dream setting defaults to config. So that: - the values can be shared (to fix assoc bug) - the values can be customized in product overlays Bug:7373284 Change-Id: I37f037082523a3d975f6014f36afa28c60117372 --- core/java/android/service/dreams/Sandman.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/service/dreams/Sandman.java b/core/java/android/service/dreams/Sandman.java index 70142ce..5f5b079 100644 --- a/core/java/android/service/dreams/Sandman.java +++ b/core/java/android/service/dreams/Sandman.java @@ -36,9 +36,6 @@ import android.util.Slog; public final class Sandman { private static final String TAG = "Sandman"; - private static final int DEFAULT_SCREENSAVER_ENABLED = 1; - private static final int DEFAULT_SCREENSAVER_ACTIVATED_ON_DOCK = 1; - // The component name of a special dock app that merely launches a dream. // We don't want to launch this app when docked because it causes an unnecessary // activity transition. We just want to start the dream. @@ -109,14 +106,18 @@ public final class Sandman { } private static boolean isScreenSaverEnabled(Context context) { + int def = context.getResources().getBoolean( + com.android.internal.R.bool.config_dreamsEnabledByDefault) ? 1 : 0; return Settings.Secure.getIntForUser(context.getContentResolver(), - Settings.Secure.SCREENSAVER_ENABLED, DEFAULT_SCREENSAVER_ENABLED, + Settings.Secure.SCREENSAVER_ENABLED, def, UserHandle.USER_CURRENT) != 0; } private static boolean isScreenSaverActivatedOnDock(Context context) { + int def = context.getResources().getBoolean( + com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault) ? 1 : 0; return Settings.Secure.getIntForUser(context.getContentResolver(), - Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK, - DEFAULT_SCREENSAVER_ACTIVATED_ON_DOCK, UserHandle.USER_CURRENT) != 0; + Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK, def, + UserHandle.USER_CURRENT) != 0; } } -- cgit v1.1