Merge "Fix non-unique keys for location settings"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8a6c737cb7
@@ -25,7 +25,7 @@
|
|||||||
android:title="@string/location_category_recent_location_requests"/>
|
android:title="@string/location_category_recent_location_requests"/>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="recent_location_requests_see_all"
|
android:key="recent_location_requests_see_all_button"
|
||||||
android:title="@string/location_recent_location_requests_see_all"
|
android:title="@string/location_recent_location_requests_see_all"
|
||||||
android:icon="@drawable/ic_chevron_right_24dp"
|
android:icon="@drawable/ic_chevron_right_24dp"
|
||||||
android:selectable="true"
|
android:selectable="true"
|
||||||
|
@@ -34,7 +34,7 @@ public class RecentLocationRequestPreferenceController extends LocationBasePrefe
|
|||||||
/** Key for preference category "Recent location requests" */
|
/** Key for preference category "Recent location requests" */
|
||||||
private static final String KEY_RECENT_LOCATION_REQUESTS = "recent_location_requests";
|
private static final String KEY_RECENT_LOCATION_REQUESTS = "recent_location_requests";
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final String KEY_SEE_ALL = "recent_location_requests_see_all";
|
static final String KEY_SEE_ALL_BUTTON = "recent_location_requests_see_all_button";
|
||||||
private final LocationSettings mFragment;
|
private final LocationSettings mFragment;
|
||||||
private final RecentLocationApps mRecentLocationApps;
|
private final RecentLocationApps mRecentLocationApps;
|
||||||
private PreferenceCategory mCategoryRecentLocationRequests;
|
private PreferenceCategory mCategoryRecentLocationRequests;
|
||||||
@@ -93,7 +93,7 @@ public class RecentLocationRequestPreferenceController extends LocationBasePrefe
|
|||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
mCategoryRecentLocationRequests =
|
mCategoryRecentLocationRequests =
|
||||||
(PreferenceCategory) screen.findPreference(KEY_RECENT_LOCATION_REQUESTS);
|
(PreferenceCategory) screen.findPreference(KEY_RECENT_LOCATION_REQUESTS);
|
||||||
mSeeAllButton = screen.findPreference(KEY_SEE_ALL);
|
mSeeAllButton = screen.findPreference(KEY_SEE_ALL_BUTTON);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,7 +86,7 @@ public class RecentLocationRequestPreferenceControllerTest {
|
|||||||
mController = spy(new RecentLocationRequestPreferenceController(
|
mController = spy(new RecentLocationRequestPreferenceController(
|
||||||
mContext, mFragment, mLifecycle, mRecentLocationApps));
|
mContext, mFragment, mLifecycle, mRecentLocationApps));
|
||||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mCategory);
|
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mCategory);
|
||||||
when(mScreen.findPreference(mController.KEY_SEE_ALL)).thenReturn(mSeeAllButton);
|
when(mScreen.findPreference(mController.KEY_SEE_ALL_BUTTON)).thenReturn(mSeeAllButton);
|
||||||
final String key = mController.getPreferenceKey();
|
final String key = mController.getPreferenceKey();
|
||||||
when(mCategory.getKey()).thenReturn(key);
|
when(mCategory.getKey()).thenReturn(key);
|
||||||
when(mCategory.getContext()).thenReturn(mContext);
|
when(mCategory.getContext()).thenReturn(mContext);
|
||||||
|
Reference in New Issue
Block a user