diff --git a/res/drawable-nodpi/gesture_silence b/res/drawable-nodpi/gesture_silence deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/res/drawable-nodpi/gesture_skip b/res/drawable-nodpi/gesture_skip deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/res/raw/gesture_silence.mp4 b/res/raw/gesture_silence.mp4 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/res/raw/gesture_skip.mp4 b/res/raw/gesture_skip.mp4 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/res/values/strings.xml b/res/values/strings.xml index 35c89234eee..23496f0caa4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10541,12 +10541,6 @@ - - Skip gesture - - - Silence alerts gesture - 0 apps used permissions diff --git a/res/xml/gestures.xml b/res/xml/gestures.xml index cd834df31be..4b17bd95e15 100644 --- a/res/xml/gestures.xml +++ b/res/xml/gestures.xml @@ -27,18 +27,6 @@ android:fragment="com.android.settings.gestures.AssistGestureSettings" settings:controller="com.android.settings.gestures.AssistGestureSettingsPreferenceController" /> - - - - - - - - - diff --git a/res/xml/skip_gesture_settings.xml b/res/xml/skip_gesture_settings.xml deleted file mode 100644 index 3d88ac81a06..00000000000 --- a/res/xml/skip_gesture_settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/src/com/android/settings/gestures/SilenceGesturePreferenceController.java b/src/com/android/settings/gestures/SilenceGesturePreferenceController.java deleted file mode 100644 index 8059304c355..00000000000 --- a/src/com/android/settings/gestures/SilenceGesturePreferenceController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import static android.provider.Settings.Secure.SILENCE_GESTURE; - -import android.content.Context; -import android.provider.Settings; -import android.text.TextUtils; - -public class SilenceGesturePreferenceController extends GesturePreferenceController { - - private static final int ON = 1; - private static final int OFF = 0; - - private static final String PREF_KEY_VIDEO = "gesture_silence_video"; - - public SilenceGesturePreferenceController(Context context, String key) { - super(context, key); - } - - @Override - public int getAvailabilityStatus() { - return mContext.getResources() - .getBoolean(com.android.internal.R.bool.config_silenceSensorAvailable) - ? AVAILABLE : UNSUPPORTED_ON_DEVICE; - } - - @Override - public boolean isSliceable() { - return true; - } - - @Override - protected String getVideoPrefKey() { - return PREF_KEY_VIDEO; - } - - @Override - public boolean isChecked() { - return Settings.Secure.getInt(mContext.getContentResolver(), SILENCE_GESTURE, ON) == ON; - } - - @Override - public boolean setChecked(boolean isChecked) { - return Settings.Secure.putInt(mContext.getContentResolver(), SILENCE_GESTURE, - isChecked ? ON : OFF); - } -} diff --git a/src/com/android/settings/gestures/SilenceGestureSettings.java b/src/com/android/settings/gestures/SilenceGestureSettings.java deleted file mode 100644 index e4acab7621c..00000000000 --- a/src/com/android/settings/gestures/SilenceGestureSettings.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import android.app.settings.SettingsEnums; -import android.content.Context; -import android.provider.SearchIndexableResource; - -import com.android.settings.R; -import com.android.settings.dashboard.DashboardFragment; -import com.android.settings.search.BaseSearchIndexProvider; -import com.android.settingslib.search.SearchIndexable; - -import java.util.Arrays; -import java.util.List; - -@SearchIndexable -public class SilenceGestureSettings extends DashboardFragment { - - private static final String TAG = "SilenceGestureSettings"; - - @Override - public int getMetricsCategory() { - return SettingsEnums.SETTINGS_GESTURE_SILENCE; - } - - @Override - protected String getLogTag() { - return TAG; - } - - @Override - protected int getPreferenceScreenResId() { - return R.xml.silence_gesture_settings; - } - - public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.silence_gesture_settings; - return Arrays.asList(sir); - } - }; - -} diff --git a/src/com/android/settings/gestures/SkipGesturePreferenceController.java b/src/com/android/settings/gestures/SkipGesturePreferenceController.java deleted file mode 100644 index d1c0a039853..00000000000 --- a/src/com/android/settings/gestures/SkipGesturePreferenceController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import static android.provider.Settings.Secure.SKIP_GESTURE; - -import android.content.Context; -import android.provider.Settings; -import android.text.TextUtils; - -public class SkipGesturePreferenceController extends GesturePreferenceController { - - private static final int ON = 1; - private static final int OFF = 0; - - private static final String PREF_KEY_VIDEO = "gesture_silence_video"; - - public SkipGesturePreferenceController(Context context, String key) { - super(context, key); - } - - @Override - public int getAvailabilityStatus() { - return mContext.getResources() - .getBoolean(com.android.internal.R.bool.config_skipSensorAvailable) ? AVAILABLE - : UNSUPPORTED_ON_DEVICE; - } - - @Override - public boolean isSliceable() { - return true; - } - - @Override - protected String getVideoPrefKey() { - return PREF_KEY_VIDEO; - } - - @Override - public boolean isChecked() { - return Settings.Secure.getInt(mContext.getContentResolver(), SKIP_GESTURE, ON) == ON; - } - - @Override - public boolean setChecked(boolean isChecked) { - return Settings.Secure.putInt(mContext.getContentResolver(), SKIP_GESTURE, - isChecked ? ON : OFF); - } -} diff --git a/src/com/android/settings/gestures/SkipGestureSettings.java b/src/com/android/settings/gestures/SkipGestureSettings.java deleted file mode 100644 index 7d1090bdfb9..00000000000 --- a/src/com/android/settings/gestures/SkipGestureSettings.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import android.app.settings.SettingsEnums; -import android.content.Context; -import android.provider.SearchIndexableResource; - -import com.android.settings.R; -import com.android.settings.dashboard.DashboardFragment; -import com.android.settings.search.BaseSearchIndexProvider; -import com.android.settingslib.search.SearchIndexable; - -import java.util.Arrays; -import java.util.List; - -@SearchIndexable -public class SkipGestureSettings extends DashboardFragment { - - private static final String TAG = "SkipGestureSettings"; - - @Override - public int getMetricsCategory() { - return SettingsEnums.SETTINGS_GESTURE_SKIP; - } - - @Override - protected String getLogTag() { - return TAG; - } - - @Override - protected int getPreferenceScreenResId() { - return R.xml.skip_gesture_settings; - } - - public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.skip_gesture_settings; - return Arrays.asList(sir); - } - }; - -} - diff --git a/tests/robotests/src/com/android/settings/gestures/SilenceGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/SilenceGesturePreferenceControllerTest.java deleted file mode 100644 index 2dc880bbe5a..00000000000 --- a/tests/robotests/src/com/android/settings/gestures/SilenceGesturePreferenceControllerTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import static android.provider.Settings.Secure.SILENCE_GESTURE; - -import static com.android.settings.core.BasePreferenceController.AVAILABLE; -import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE; - -import static com.google.common.truth.Truth.assertThat; - -import static org.mockito.Mockito.when; - -import android.content.Context; -import android.content.res.Resources; -import android.provider.Settings; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Answers; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -public class SilenceGesturePreferenceControllerTest { - - private static final String KEY_SILENCE = "gesture_silence"; - - @Mock(answer = Answers.RETURNS_DEEP_STUBS) - private Context mContext; - @Mock - private Resources mResources; - - private SilenceGesturePreferenceController mController; - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - when(mContext.getResources()).thenReturn(mResources); - mController = new SilenceGesturePreferenceController(mContext, KEY_SILENCE); - } - - @Test - public void getAvailabilityStatus_gestureNotSupported_UNSUPPORTED_ON_DEVICE() { - when(mResources.getBoolean( - com.android.internal.R.bool.config_silenceSensorAvailable)) - .thenReturn(false); - final int availabilityStatus = mController.getAvailabilityStatus(); - - assertThat(availabilityStatus).isEqualTo(UNSUPPORTED_ON_DEVICE); - } - - @Test - public void getAvailabilityStatus_gestureSupported_AVAILABLE() { - when(mResources.getBoolean( - com.android.internal.R.bool.config_silenceSensorAvailable)).thenReturn(true); - final int availabilityStatus = mController.getAvailabilityStatus(); - - assertThat(availabilityStatus).isEqualTo(AVAILABLE); - } - - @Test - public void isSliceableCorrectKey_returnsTrue() { - assertThat(mController.isSliceable()).isTrue(); - } - - @Test - public void isChecked_testTrue() { - Settings.Secure.putInt(mContext.getContentResolver(), SILENCE_GESTURE, 1); - assertThat(mController.isChecked()).isTrue(); - } - - @Test - public void isChecked_testFalse() { - Settings.Secure.putInt(mContext.getContentResolver(), SILENCE_GESTURE, 0); - assertThat(mController.isChecked()).isFalse(); - } -} diff --git a/tests/robotests/src/com/android/settings/gestures/SkipGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/SkipGesturePreferenceControllerTest.java deleted file mode 100644 index c544786bce7..00000000000 --- a/tests/robotests/src/com/android/settings/gestures/SkipGesturePreferenceControllerTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.gestures; - -import static android.provider.Settings.Secure.SKIP_GESTURE; - -import static com.android.settings.core.BasePreferenceController.AVAILABLE; -import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE; - -import static com.google.common.truth.Truth.assertThat; - -import static org.mockito.Mockito.when; - -import android.content.Context; -import android.content.res.Resources; -import android.provider.Settings; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Answers; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -public class SkipGesturePreferenceControllerTest { - - private static final String KEY_SKIP = "gesture_skip"; - - @Mock(answer = Answers.RETURNS_DEEP_STUBS) - private Context mContext; - @Mock - private Resources mResources; - - private SkipGesturePreferenceController mController; - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - when(mContext.getResources()).thenReturn(mResources); - mController = new SkipGesturePreferenceController(mContext, KEY_SKIP); - } - - @Test - public void getAvailabilityStatus_gestureNotSupported_UNSUPPORTED_ON_DEVICE() { - when(mResources.getBoolean( - com.android.internal.R.bool.config_skipSensorAvailable)) - .thenReturn(false); - final int availabilityStatus = mController.getAvailabilityStatus(); - - assertThat(availabilityStatus).isEqualTo(UNSUPPORTED_ON_DEVICE); - } - - @Test - public void getAvailabilityStatus_gestureSupported_AVAILABLE() { - when(mResources.getBoolean( - com.android.internal.R.bool.config_skipSensorAvailable)).thenReturn(true); - final int availabilityStatus = mController.getAvailabilityStatus(); - - assertThat(availabilityStatus).isEqualTo(AVAILABLE); - } - - @Test - public void isSliceableCorrectKey_returnsTrue() { - assertThat(mController.isSliceable()).isTrue(); - } - - @Test - public void isChecked_testTrue() { - Settings.Secure.putInt(mContext.getContentResolver(), SKIP_GESTURE, 1); - assertThat(mController.isChecked()).isTrue(); - } - - @Test - public void isChecked_testFalse() { - Settings.Secure.putInt(mContext.getContentResolver(), SKIP_GESTURE, 0); - assertThat(mController.isChecked()).isFalse(); - } -}