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

Commit 7825637f authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Play different sounds for wired/wireless charging"

parents 10616141 f364d7cd
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -8594,12 +8594,18 @@ public final class Settings {
        public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
        /**
         * URI for the "wireless charging started" and "wired charging started" sound.
         * URI for the "wireless charging started" sound.
         * @hide
         */
        public static final String CHARGING_STARTED_SOUND =
        public static final String WIRELESS_CHARGING_STARTED_SOUND =
                "wireless_charging_started_sound";
        /**
         * URI for "wired charging started" sound.
         * @hide
         */
        public static final String CHARGING_STARTED_SOUND = "charging_started_sound";
        /**
         * Whether to play a sound for charging events.
         * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
+1 −0
Original line number Diff line number Diff line
@@ -853,6 +853,7 @@ message GlobalSettingsProto {
        optional SettingProto low_battery_sounds_enabled = 12 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto trusted = 13;
        optional SettingProto unlock = 14;
        optional SettingProto wireless_charging_started = 15;
    }
    optional Sounds sounds = 110;

+4 −0
Original line number Diff line number Diff line
@@ -4357,4 +4357,8 @@
         create additional screen real estate outside beyond the keyboard. Note that the user needs
         to have a confirmed way to dismiss the keyboard when desired. -->
    <bool name="config_automotiveHideNavBarForKeyboard">false</bool>

    <!-- Whether or not to show the built-in charging animation when the device begins charging
         wirelessly. -->
    <bool name="config_showBuiltinWirelessChargingAnim">true</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -3870,4 +3870,6 @@

  <java-symbol type="bool" name="config_automotiveHideNavBarForKeyboard" />

  <java-symbol type="bool" name="config_showBuiltinWirelessChargingAnim" />

</resources>
+1 −17
Original line number Diff line number Diff line
@@ -1497,21 +1497,7 @@ class DatabaseHelper extends SQLiteOpenHelper {
        }

        if (upgradeVersion == 94) {
            // Add wireless charging started sound setting
            if (mUserHandle == UserHandle.USER_SYSTEM) {
                db.beginTransaction();
                SQLiteStatement stmt = null;
                try {
                    stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
                            + " VALUES(?,?);");
                    loadStringSetting(stmt, Settings.Global.CHARGING_STARTED_SOUND,
                            R.string.def_wireless_charging_started_sound);
                    db.setTransactionSuccessful();
                } finally {
                    db.endTransaction();
                    if (stmt != null) stmt.close();
                }
            }
            // charging sound moved to SettingsProvider version 184
            upgradeVersion = 95;
        }

@@ -2562,8 +2548,6 @@ class DatabaseHelper extends SQLiteOpenHelper {
                    R.string.def_car_dock_sound);
            loadStringSetting(stmt, Settings.Global.CAR_UNDOCK_SOUND,
                    R.string.def_car_undock_sound);
            loadStringSetting(stmt, Settings.Global.CHARGING_STARTED_SOUND,
                    R.string.def_wireless_charging_started_sound);

            loadIntegerSetting(stmt, Settings.Global.DOCK_AUDIO_MEDIA_ENABLED,
                    R.integer.def_dock_audio_media_enabled);
Loading