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

Commit dfba97cf authored by Lais Andrade's avatar Lais Andrade Committed by Android (Google) Code Review
Browse files

Merge "Move APPLY_RAMPING_RINGER setting from Global to System"

parents aa6380d6 724d0cd1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -20684,6 +20684,7 @@ package android.media {
    method public boolean isMicrophoneMute();
    method public boolean isMusicActive();
    method public static boolean isOffloadedPlaybackSupported(@NonNull android.media.AudioFormat, @NonNull android.media.AudioAttributes);
    method public boolean isRampingRingerEnabled();
    method public boolean isSpeakerphoneOn();
    method public boolean isStreamMute(int);
    method public boolean isSurroundFormatEnabled(int);
@@ -35596,7 +35597,7 @@ package android.provider {
    field public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
    field public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
    field public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
    field public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
    field @Deprecated public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
    field public static final String AUTO_TIME = "auto_time";
    field public static final String AUTO_TIME_ZONE = "auto_time_zone";
    field public static final String BLUETOOTH_ON = "bluetooth_on";
+1 −0
Original line number Diff line number Diff line
@@ -1458,6 +1458,7 @@ package android.media {
    method public boolean hasRegisteredDynamicPolicy();
    method @RequiresPermission(anyOf={android.Manifest.permission.MODIFY_AUDIO_ROUTING, android.Manifest.permission.QUERY_AUDIO_STATE}) public boolean isFullVolumeDevice();
    method @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public int requestAudioFocusForTest(@NonNull android.media.AudioFocusRequest, @NonNull String, int, int);
    method public void setRampingRingerEnabled(boolean);
  }

  public static final class AudioRecord.MetricsConstants {
+49 −2
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.database.Cursor;
import android.database.SQLException;
import android.location.ILocationManager;
import android.location.LocationManager;
import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.net.NetworkScoreManager;
import android.net.Uri;
@@ -3632,6 +3633,12 @@ public final class Settings {
        private static boolean putStringForUser(ContentResolver resolver, String name, String value,
                int userHandle, boolean overrideableByRestore) {
            return putStringForUser(resolver, name, value, /* tag= */ null,
                    /* makeDefault= */ false, userHandle, overrideableByRestore);
        }
        private static boolean putStringForUser(ContentResolver resolver, String name, String value,
                String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore) {
            if (MOVED_TO_SECURE.contains(name)) {
                Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
                        + " to android.provider.Settings.Secure, value is unchanged.");
@@ -3642,8 +3649,8 @@ public final class Settings {
                        + " to android.provider.Settings.Global, value is unchanged.");
                return false;
            }
            return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle,
                    overrideableByRestore);
            return sNameValueCache.putStringForUser(resolver, name, value, tag, makeDefault,
                    userHandle, overrideableByRestore);
        }
        /**
@@ -4478,6 +4485,15 @@ public final class Settings {
        @Readable
        public static final String VIBRATE_ON = "vibrate_on";
        /**
         * Whether applying ramping ringer on incoming phone call ringtone.
         * <p>1 = apply ramping ringer
         * <p>0 = do not apply ramping ringer
         * @hide
         */
        @Readable
        public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
        /**
         * If 1, redirects the system vibrator to all currently attached input devices
         * that support vibration.  If there are no such input devices, then the system
@@ -5348,6 +5364,7 @@ public final class Settings {
            PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
            PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
            PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
            PUBLIC_SETTINGS.add(APPLY_RAMPING_RINGER);
        }
        /**
@@ -5884,6 +5901,10 @@ public final class Settings {
            outKeySet.addAll(MOVED_TO_GLOBAL);
        }
        /** @hide */
        public static void getMovedToSystemSettings(Set<String> outKeySet) {
        }
        /** @hide */
        public static void clearProviderForTest() {
            sProviderHolder.clearProviderForTest();
@@ -10482,7 +10503,9 @@ public final class Settings {
         * Whether applying ramping ringer on incoming phone call ringtone.
         * <p>1 = apply ramping ringer
         * <p>0 = do not apply ramping ringer
         * @deprecated Use {@link AudioManager#isRampingRingerEnabled()} instead
         */
        @Deprecated
        @Readable
        public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
@@ -15261,11 +15284,23 @@ public final class Settings {
            MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES);
        }
        // Certain settings have been moved from global to the per-user system namespace
        private static final HashSet<String> MOVED_TO_SYSTEM;
        static {
            MOVED_TO_SYSTEM = new HashSet<>(1);
            MOVED_TO_SYSTEM.add(Global.APPLY_RAMPING_RINGER);
        }
        /** @hide */
        public static void getMovedToSecureSettings(Set<String> outKeySet) {
            outKeySet.addAll(MOVED_TO_SECURE);
        }
        /** @hide */
        public static void getMovedToSystemSettings(Set<String> outKeySet) {
            outKeySet.addAll(MOVED_TO_SYSTEM);
        }
        /** @hide */
        public static void clearProviderForTest() {
            sProviderHolder.clearProviderForTest();
@@ -15298,6 +15333,11 @@ public final class Settings {
                        + " to android.provider.Settings.Secure, returning read-only value.");
                return Secure.getStringForUser(resolver, name, userHandle);
            }
            if (MOVED_TO_SYSTEM.contains(name)) {
                Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
                        + " to android.provider.Settings.System, returning read-only value.");
                return System.getStringForUser(resolver, name, userHandle);
            }
            return sNameValueCache.getStringForUser(resolver, name, userHandle);
        }
@@ -15462,6 +15502,13 @@ public final class Settings {
                return Secure.putStringForUser(resolver, name, value, tag,
                        makeDefault, userHandle, overrideableByRestore);
            }
            // Global and System have the same access policy so we can forward writes
            if (MOVED_TO_SYSTEM.contains(name)) {
                Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
                        + " to android.provider.Settings.System, value is unchanged.");
                return System.putStringForUser(resolver, name, value, tag,
                        makeDefault, userHandle, overrideableByRestore);
            }
            return sNameValueCache.putStringForUser(resolver, name, value, tag,
                    makeDefault, userHandle, overrideableByRestore);
        }
+1 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ message GlobalSettingsProto {
    // ringer mode.
    optional SettingProto mode_ringer = 75 [ (android.privacy).dest = DEST_AUTOMATIC ];

    optional SettingProto apply_ramping_ringer = 147 [ (android.privacy).dest = DEST_AUTOMATIC ];
    reserved 147; // Used to be apply_ramping_ringer

    message MultiSim {
        option (android.msg_privacy).dest = DEST_EXPLICIT;
+3 −1
Original line number Diff line number Diff line
@@ -242,7 +242,9 @@ message SystemSettingsProto {

    optional SettingProto when_to_make_wifi_calls = 34 [ (android.privacy).dest = DEST_AUTOMATIC ];

    optional SettingProto apply_ramping_ringer = 35 [ (android.privacy).dest = DEST_AUTOMATIC ];

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 35;
    // Next tag = 36;
}
Loading