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:
Fan Zhang
2021-01-20 10:27:52 -08:00
parent a347993239
commit e81091175e
12 changed files with 29 additions and 37 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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);