commit | ff5ddd768175b1a6c511910d80b6cbd720b8e005 | [log] [tgz] |
---|---|---|
author | JianYang Liu <jianyliu@google.com> | Thu Feb 06 14:10:04 2020 -0800 |
committer | Jian-Yang Liu <jianyliu@google.com> | Fri Feb 07 01:25:57 2020 +0000 |
tree | dc5b13f4f19dcb30639be777b2d7bdacb96de1f1 | |
parent | 1adb35a6312f3d402ddebb1559dfd9e69bf6d812 [diff] |
Updated Location footer preferences so they are not selectable since they are informational. Bug: 149038794 Test: Robolectric, manual Change-Id: Ib8187bd8bae5ed735982ffd0ffe0950e81939f4f
diff --git a/src/com/android/car/settings/location/LocationFooterPreferenceController.java b/src/com/android/car/settings/location/LocationFooterPreferenceController.java index 71ba2ba..ece3da7 100644 --- a/src/com/android/car/settings/location/LocationFooterPreferenceController.java +++ b/src/com/android/car/settings/location/LocationFooterPreferenceController.java
@@ -78,6 +78,7 @@ CarUiPreference newPreference = new CarUiPreference(getContext()); newPreference.setSummary(footerString); newPreference.setIcon(R.drawable.ic_settings_about); + newPreference.setSelectable(false); getPreference().addPreference(newPreference); } catch (PackageManager.NameNotFoundException exception) { LOG.w("Resources not found for application "
diff --git a/tests/robotests/src/com/android/car/settings/location/LocationFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/car/settings/location/LocationFooterPreferenceControllerTest.java index 7440e94..d5a3851 100644 --- a/tests/robotests/src/com/android/car/settings/location/LocationFooterPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/car/settings/location/LocationFooterPreferenceControllerTest.java
@@ -129,6 +129,15 @@ assertThat(mGroup.getPreference(0).getSummary()).isEqualTo(TEST_TEXT); } + @Test + public void onCreate_injectedFooterIsNotSelectable() { + mResolveInfos.add( + getTestResolveInfo(/* isSystemApp= */ true, /* hasRequiredMetadata= */ true)); + mControllerHelper.sendLifecycleEvent(Lifecycle.Event.ON_CREATE); + + assertThat(mGroup.getPreference(0).isSelectable()).isFalse(); + } + /** * Returns a ResolveInfo object for testing. *