Default emergency gesture setting On.
And a few drive-by fixes: * Move all emergency gesture fragments and controllers to emergency package for better code colocation. * Remove the placeholder video preference from emergency_gesture_settings.xml Bug: 178009196 Test: reran robotests Change-Id: Ifcb591e7ab8e5e5494c480cbbe9410c08c296f8e
This commit is contained in:
@@ -22,15 +22,11 @@
|
||||
|
||||
<com.android.settingslib.widget.MainSwitchPreference
|
||||
android:key="gesture_emergency_button_switch_bar"
|
||||
app:controller="com.android.settings.gestures.EmergencyGesturePreferenceController" />
|
||||
|
||||
<com.android.settings.widget.VideoPreference
|
||||
android:key="emergency_gesture_screen_video"
|
||||
app:animation="@raw/gesture_double_tap"
|
||||
app:preview="@drawable/gesture_double_tap"/>
|
||||
app:controller="com.android.settings.emergency.EmergencyGesturePreferenceController" />
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:title="@string/emergency_gesture_screen_summary"
|
||||
app:allowDividerAbove="false"
|
||||
app:allowDividerBelow="true" />
|
||||
|
||||
<SwitchPreference
|
||||
@@ -39,10 +35,10 @@
|
||||
android:title="@string/emergency_gesture_sound_setting_title"
|
||||
android:summary="@string/emergency_gesture_sound_setting_summary"
|
||||
app:keywords="@string/keywords_gesture"
|
||||
app:controller="com.android.settings.gestures.EmergencyGestureSoundPreferenceController"
|
||||
app:controller="com.android.settings.emergency.EmergencyGestureSoundPreferenceController"
|
||||
app:allowDividerAbove="true"/>
|
||||
|
||||
<com.android.settings.gestures.EmergencyGestureNumberOverridePreference
|
||||
<com.android.settings.emergency.EmergencyGestureNumberOverridePreference
|
||||
android:key="emregency_gesture_number_override"
|
||||
android:title="@string/emergency_gesture_call_for_help_title"
|
||||
android:summary="@string/summary_placeholder"
|
||||
@@ -51,5 +47,5 @@
|
||||
android:dialogLayout="@layout/emergency_gesture_number_override_dialog"
|
||||
android:positiveButtonText="@string/save"
|
||||
app:allowDividerAbove="true"
|
||||
app:controller="com.android.settings.gestures.EmergencyGestureNumberOverridePreferenceController"/>
|
||||
app:controller="com.android.settings.emergency.EmergencyGestureNumberOverridePreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
|
@@ -29,8 +29,8 @@
|
||||
android:key="gesture_emergency_summary"
|
||||
android:title="@string/emergency_gesture_screen_title"
|
||||
android:order="100"
|
||||
android:fragment="com.android.settings.gestures.EmergencyGestureSettings"
|
||||
settings:controller="com.android.settings.gestures.EmergencyGestureEntrypointPreferenceController" />
|
||||
android:fragment="com.android.settings.emergency.EmergencyGestureSettings"
|
||||
settings:controller="com.android.settings.emergency.EmergencyGestureEntrypointPreferenceController" />
|
||||
<com.android.settingslib.RestrictedPreference
|
||||
android:key="app_and_notif_cell_broadcast_settings"
|
||||
android:title="@string/cell_broadcast_settings"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static android.content.DialogInterface.BUTTON_POSITIVE;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static com.android.settingslib.emergencynumber.EmergencyNumberUtils.EMERGENCY_NUMBER_OVERRIDE_AUTHORITY;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
@@ -71,7 +71,7 @@ public class EmergencyGesturePreferenceController extends BasePreferenceControll
|
||||
|
||||
@VisibleForTesting
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getInt(mContext.getContentResolver(), SECURE_KEY, OFF) == ON;
|
||||
return Settings.Secure.getInt(mContext.getContentResolver(), SECURE_KEY, ON) == ON;
|
||||
}
|
||||
|
||||
@Override
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
@@ -22,11 +22,12 @@ import android.provider.Settings;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
/**
|
||||
* Preference controller for emergency sos gesture setting
|
||||
*/
|
||||
public class EmergencyGestureSoundPreferenceController extends GesturePreferenceController {
|
||||
public class EmergencyGestureSoundPreferenceController extends TogglePreferenceController {
|
||||
|
||||
@VisibleForTesting
|
||||
static final int ON = 1;
|
||||
@@ -39,11 +40,6 @@ public class EmergencyGestureSoundPreferenceController extends GesturePreference
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getVideoPrefKey() {
|
||||
return "emergency_gesture_screen_video";
|
||||
}
|
||||
|
||||
private static boolean isGestureAvailable(Context context) {
|
||||
return context.getResources()
|
||||
.getBoolean(R.bool.config_show_emergency_gesture_settings);
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
import static com.android.settings.gestures.EmergencyGestureEntrypointPreferenceController.ACTION_EMERGENCY_GESTURE_SETTINGS;
|
||||
import static com.android.settings.emergency.EmergencyGestureEntrypointPreferenceController.ACTION_EMERGENCY_GESTURE_SETTINGS;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
import static com.android.settings.gestures.EmergencyGesturePreferenceController.OFF;
|
||||
import static com.android.settings.gestures.EmergencyGesturePreferenceController.ON;
|
||||
import static com.android.settings.emergency.EmergencyGesturePreferenceController.OFF;
|
||||
import static com.android.settings.emergency.EmergencyGesturePreferenceController.ON;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.gestures;
|
||||
package com.android.settings.emergency;
|
||||
|
||||
import static com.android.settings.gestures.EmergencyGestureSoundPreferenceController.OFF;
|
||||
import static com.android.settings.gestures.EmergencyGestureSoundPreferenceController.ON;
|
||||
import static com.android.settings.emergency.EmergencyGestureSoundPreferenceController.OFF;
|
||||
import static com.android.settings.emergency.EmergencyGestureSoundPreferenceController.ON;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
Reference in New Issue
Block a user