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

Commit 6e66b320 authored by Beverly's avatar Beverly Committed by android-build-merger
Browse files

Merge changes Id4feeefa,Ie0a501b8 into pi-dev

am: 45a250a2

Change-Id: Id58b92f3400f17fedb30524cc851fa3c1304af61
parents 0b25a307 45a250a2
Loading
Loading
Loading
Loading
+22 −1
Original line number Original line Diff line number Diff line
@@ -6008,6 +6008,23 @@ public final class Settings {
        private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
        private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
                new SettingsValidators.ComponentNameListValidator(":");
                new SettingsValidators.ComponentNameListValidator(":");
        /**
         * Whether the hush gesture has ever been used // TODO: beverlyt
         * @hide
         */
        public static final String HUSH_GESTURE_USED = "hush_gesture_used";
        private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR;
        /**
         * Number of times the user has manually clicked the ringer toggle
         * @hide
         */
        public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
        private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
                NON_NEGATIVE_INTEGER_VALIDATOR;
        /**
        /**
         * Uri of the slice that's presented on the keyguard.
         * Uri of the slice that's presented on the keyguard.
         * Defaults to a slice with the date and next alarm.
         * Defaults to a slice with the date and next alarm.
@@ -7991,7 +8008,9 @@ public final class Settings {
            SCREENSAVER_ACTIVATE_ON_SLEEP,
            SCREENSAVER_ACTIVATE_ON_SLEEP,
            LOCKDOWN_IN_POWER_MENU,
            LOCKDOWN_IN_POWER_MENU,
            SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
            SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
            VOLUME_HUSH_GESTURE
            VOLUME_HUSH_GESTURE,
            MANUAL_RINGER_TOGGLE_COUNT,
            HUSH_GESTURE_USED,
        };
        };
        /**
        /**
@@ -8138,6 +8157,8 @@ public final class Settings {
                    ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
                    ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
            VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
            VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
                    ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
                    ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
            VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
            VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
        }
        }
        /**
        /**
+23 −1
Original line number Original line Diff line number Diff line
@@ -2935,7 +2935,7 @@ public class SettingsProvider extends ContentProvider {
        }
        }


        private final class UpgradeController {
        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 166;
            private static final int SETTINGS_VERSION = 167;


            private final int mUserId;
            private final int mUserId;


@@ -3770,6 +3770,28 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 166;
                    currentVersion = 166;
                }
                }


                if (currentVersion == 166) {
                    // Version 166: add default values for hush gesture used and manual ringer
                    // toggle
                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
                    Setting currentHushUsedSetting = secureSettings.getSettingLocked(
                            Secure.HUSH_GESTURE_USED);
                    if (currentHushUsedSetting.isNull()) {
                        secureSettings.insertSettingLocked(
                                Settings.Secure.HUSH_GESTURE_USED, "0", null, true,
                                SettingsState.SYSTEM_PACKAGE_NAME);
                    }

                    Setting currentRingerToggleCountSetting = secureSettings.getSettingLocked(
                            Secure.MANUAL_RINGER_TOGGLE_COUNT);
                    if (currentRingerToggleCountSetting.isNull()) {
                        secureSettings.insertSettingLocked(
                                Settings.Secure.MANUAL_RINGER_TOGGLE_COUNT, "0", null, true,
                                SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    currentVersion = 167;
                }

                // vXXX: Add new settings above this point.
                // vXXX: Add new settings above this point.


                if (currentVersion != newVersion) {
                if (currentVersion != newVersion) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -1069,7 +1069,7 @@
    <string name="manage_notifications_text">Manage notifications</string>
    <string name="manage_notifications_text">Manage notifications</string>


    <!-- The text to show in the notifications shade when dnd is suppressing notifications. [CHAR LIMIT=100] -->
    <!-- The text to show in the notifications shade when dnd is suppressing notifications. [CHAR LIMIT=100] -->
    <string name="dnd_suppressing_shade_text">Do Not Disturb is hiding notifications</string>
    <string name="dnd_suppressing_shade_text">Notifications paused by Do Not Disturb</string>


    <!-- Media projection permission dialog action text. [CHAR LIMIT=60] -->
    <!-- Media projection permission dialog action text. [CHAR LIMIT=60] -->
    <string name="media_projection_action_text">Start now</string>
    <string name="media_projection_action_text">Start now</string>
+7 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.KeyguardManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent;
@@ -445,6 +446,7 @@ public class VolumeDialogImpl implements VolumeDialog {
                }
                }
            }
            }
            Events.writeEvent(mContext, Events.EVENT_RINGER_TOGGLE, newRingerMode);
            Events.writeEvent(mContext, Events.EVENT_RINGER_TOGGLE, newRingerMode);
            incrementManualToggleCount();
            updateRingerH();
            updateRingerH();
            provideTouchFeedbackH(newRingerMode);
            provideTouchFeedbackH(newRingerMode);
            mController.setRingerMode(newRingerMode, false);
            mController.setRingerMode(newRingerMode, false);
@@ -453,6 +455,11 @@ public class VolumeDialogImpl implements VolumeDialog {
        updateRingerH();
        updateRingerH();
    }
    }


    private void incrementManualToggleCount() {
        ContentResolver cr = mContext.getContentResolver();
        int ringerCount = Settings.Secure.getInt(cr, Settings.Secure.MANUAL_RINGER_TOGGLE_COUNT, 0);
        Settings.Secure.putInt(cr, Settings.Secure.MANUAL_RINGER_TOGGLE_COUNT, ringerCount + 1);
    }


    private void provideTouchFeedbackH(int newRingerMode) {
    private void provideTouchFeedbackH(int newRingerMode) {
        VibrationEffect effect = null;
        VibrationEffect effect = null;
+1 −0
Original line number Original line Diff line number Diff line
@@ -1138,6 +1138,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
        }
        getAudioManagerInternal();
        getAudioManagerInternal();
        mAudioManagerInternal.silenceRingerModeInternal("volume_hush");
        mAudioManagerInternal.silenceRingerModeInternal("volume_hush");
        Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.HUSH_GESTURE_USED, 1);
        mLogger.action(MetricsProto.MetricsEvent.ACTION_HUSH_GESTURE, mRingerToggleChord);
        mLogger.action(MetricsProto.MetricsEvent.ACTION_HUSH_GESTURE, mRingerToggleChord);
    }
    }