Rename Double Tap Power To Open Camera Gesture Xml

Rename double_tap_power_settings.xml to
double_tap_power_to_open_camera_settings.xml

Android Settings Feature Request: b/380287172

Bug: 381554683
Test: atest DoubleTapPowerSettingsTest
Flag: android.service.quickaccesswallet.launch_wallet_option_on_power_double_tap
Change-Id: I6ff3c0384602a5f0eeeafcc560e7854af8480f99
This commit is contained in:
Lorenzo Lucena Maguire
2024-11-29 19:43:27 +00:00
parent 75536b091f
commit 406a01dfab
3 changed files with 15 additions and 8 deletions

View File

@@ -18,19 +18,18 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/double_tap_power_for_camera_title">
<com.android.settingslib.widget.IllustrationPreference
android:key="gesture_double_tap_power_video"
settings:searchable="false"
app:lottie_rawRes="@drawable/quickly_open_camera"/>
settings:lottie_rawRes="@drawable/quickly_open_camera"/>
<SwitchPreferenceCompat
android:key="gesture_double_tap_power"
android:title="@string/double_tap_power_for_camera_title"
android:summary="@string/double_tap_power_for_camera_summary"
app:keywords="@string/keywords_gesture"
app:controller="com.android.settings.gestures.DoubleTapPowerToOpenCameraPreferenceController"/>
settings:keywords="@string/keywords_gesture"
settings:controller="com.android.settings.gestures.DoubleTapPowerToOpenCameraPreferenceController"/>
</PreferenceScreen>

View File

@@ -56,9 +56,9 @@ public class DoubleTapPowerSettings extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
return R.xml.double_tap_power_settings;
return R.xml.double_tap_power_to_open_camera_settings;
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.double_tap_power_settings);
new BaseSearchIndexProvider(R.xml.double_tap_power_to_open_camera_settings);
}

View File

@@ -20,6 +20,8 @@ import static com.google.common.truth.Truth.assertThat;
import android.provider.SearchIndexableResource;
import com.android.settings.R;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,11 +40,17 @@ public class DoubleTapPowerSettingsTest {
mSettings = new DoubleTapPowerSettings();
}
@Test
public void getPreferenceResId_returnsResId() {
assertThat(mSettings.getPreferenceScreenResId())
.isEqualTo(R.xml.double_tap_power_to_open_camera_settings);
}
@Test
public void testSearchIndexProvider_shouldIndexResource() {
final List<SearchIndexableResource> indexRes =
DoubleTapPowerSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
RuntimeEnvironment.application, true /* enabled */);
DoubleTapPowerSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
RuntimeEnvironment.application, true /* enabled */);
assertThat(indexRes).isNotNull();
assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());