Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c820256 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Frameworks base: Promote dream setting defaults to config." into jb-mr1-dev

parents 8b946c05 ed108f3d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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;
    }
}
+10 −2
Original line number Diff line number Diff line
@@ -895,8 +895,16 @@
    <!-- Name of the wimax state tracker clas -->
    <string name="config_wimaxStateTrackerClassname" translatable="false"></string>

    <!-- enable screen saver feature -->
    <bool name="config_enableDreams">true</bool>
    <!-- Is the dreams feature supported? -->
    <bool name="config_dreamsSupported">true</bool>
    <!-- If supported, are dreams enabled? (by default) -->
    <bool name="config_dreamsEnabledByDefault">true</bool>
    <!-- If supported and enabled, are dreams activated when docked? (by default) -->
    <bool name="config_dreamsActivatedOnDockByDefault">true</bool>
    <!-- If supported and enabled, are dreams activated when asleep and charging? (by default) -->
    <bool name="config_dreamsActivatedOnSleepByDefault">false</bool>
    <!-- ComponentName of the default dream (Settings.Secure.SCREENSAVER_COMPONENT) -->
    <string name="config_dreamsDefaultComponent">com.google.android.deskclock/com.android.deskclock.Screensaver</string>

    <!-- Base "touch slop" value used by ViewConfiguration as a
         movement threshold where scrolling should begin. -->
+5 −1
Original line number Diff line number Diff line
@@ -1627,7 +1627,11 @@
  <java-symbol type="style" name="Theme.Dialog.AppError" />
  <java-symbol type="style" name="Theme.Toast" />
  <java-symbol type="xml" name="storage_list" />
  <java-symbol type="bool" name="config_enableDreams" />
  <java-symbol type="bool" name="config_dreamsSupported" />
  <java-symbol type="bool" name="config_dreamsEnabledByDefault" />
  <java-symbol type="bool" name="config_dreamsActivatedOnDockByDefault" />
  <java-symbol type="bool" name="config_dreamsActivatedOnSleepByDefault" />
  <java-symbol type="string" name="config_dreamsDefaultComponent" />
  <java-symbol type="string" name="enable_explore_by_touch_warning_title" />
  <java-symbol type="string" name="enable_explore_by_touch_warning_message" />

+0 −10
Original line number Diff line number Diff line
@@ -165,16 +165,6 @@
         Value here is the same as WifiStateMachine.DEFAULT_MAX_DHCP_RETRIES -->
    <integer name="def_max_dhcp_retries">9</integer>

    <!-- Dreams (screen saver) default settings -->
    <!-- Whether the feature is enabled when charging (Settings.Secure.SCREENSAVER_ENABLED) -->
    <bool name="def_screensaver_enabled">true</bool>
    <!-- Whether the feature activates when docked (SCREENSAVER_ACTIVATE_ON_DOCK) -->
    <bool name="def_screensaver_activate_on_dock">true</bool>
    <!-- Whether the feature activates when docked (SCREENSAVER_ACTIVATE_ON_SLEEP) -->
    <bool name="def_screensaver_activate_on_sleep">false</bool>
    <!-- ComponentName of the default screen saver (Settings.Secure.SCREENSAVER_COMPONENT) -->
    <string name="def_screensaver_component">com.google.android.deskclock/com.android.deskclock.Screensaver</string>

    <!-- Default for Settings.Secure.USER_SETUP_COMPLETE -->
    <bool name="def_user_setup_complete">false</bool>
</resources>
+11 −11
Original line number Diff line number Diff line
@@ -1166,15 +1166,15 @@ public class DatabaseHelper extends SQLiteOpenHelper {
                stmt = db.compileStatement("INSERT OR REPLACE INTO secure(name,value)"
                        + " VALUES(?,?);");
                loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ENABLED,
                        R.bool.def_screensaver_enabled);
                        com.android.internal.R.bool.config_dreamsEnabledByDefault);
                loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK,
                        R.bool.def_screensaver_activate_on_dock);
                        com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault);
                loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP,
                        R.bool.def_screensaver_activate_on_sleep);
                loadStringSetting(stmt, Settings.Secure.SCREENSAVER_DEFAULT_COMPONENT,
                        R.string.def_screensaver_component);
                        com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault);
                loadStringSetting(stmt, Settings.Secure.SCREENSAVER_COMPONENTS,
                        R.string.def_screensaver_component);
                        com.android.internal.R.string.config_dreamsDefaultComponent);
                loadStringSetting(stmt, Settings.Secure.SCREENSAVER_DEFAULT_COMPONENT,
                        com.android.internal.R.string.config_dreamsDefaultComponent);

                db.setTransactionSuccessful();
            } finally {
@@ -2027,15 +2027,15 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            }

            loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ENABLED,
                    R.bool.def_screensaver_enabled);
                    com.android.internal.R.bool.config_dreamsEnabledByDefault);
            loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK,
                    R.bool.def_screensaver_activate_on_dock);
                    com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault);
            loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP,
                    R.bool.def_screensaver_activate_on_sleep);
                    com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault);
            loadStringSetting(stmt, Settings.Secure.SCREENSAVER_COMPONENTS,
                    R.string.def_screensaver_component);
                    com.android.internal.R.string.config_dreamsDefaultComponent);
            loadStringSetting(stmt, Settings.Secure.SCREENSAVER_DEFAULT_COMPONENT,
                    R.string.def_screensaver_component);
                    com.android.internal.R.string.config_dreamsDefaultComponent);

            loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
                    R.bool.def_accessibility_display_magnification_enabled);
Loading