Adjust preferene to align the lastest mock
- Because removeAll in updateState will cause preference list janking, move updateState code to displayPreference. Bug: 141601408 Fixes: 145369584 Test: manual and robolectric Change-Id: Ic6ffeedfdd7a64671e497a61894d7c0d443750ef
This commit is contained in:
@@ -3776,8 +3776,6 @@
|
|||||||
<string name="location_recent_location_requests_see_all">See all</string>
|
<string name="location_recent_location_requests_see_all">See all</string>
|
||||||
<!-- Location settings screen, sub category for location services [CHAR LIMIT=30] -->
|
<!-- Location settings screen, sub category for location services [CHAR LIMIT=30] -->
|
||||||
<string name="location_category_location_services">Location services</string>
|
<string name="location_category_location_services">Location services</string>
|
||||||
<!-- Location settings screen, sub category for recent work profile app location requests [CHAR LIMIT=NONE] -->
|
|
||||||
<string name="location_category_recent_location_work_requests">Recent work app location requests</string>
|
|
||||||
|
|
||||||
<!-- Security & location settings screen, section header for settings relating to location -->
|
<!-- Security & location settings screen, section header for settings relating to location -->
|
||||||
<string name="location_title">My Location</string>
|
<string name="location_title">My Location</string>
|
||||||
|
@@ -34,11 +34,6 @@
|
|||||||
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
||||||
settings:searchable="false"/>
|
settings:searchable="false"/>
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:key="location_advanced_settings"
|
|
||||||
android:layout="@layout/preference_category_no_label"
|
|
||||||
settings:initialExpandedChildrenCount="2">
|
|
||||||
|
|
||||||
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
||||||
<Preference
|
<Preference
|
||||||
android:key="app_level_permissions"
|
android:key="app_level_permissions"
|
||||||
@@ -61,8 +56,6 @@
|
|||||||
android:layout="@layout/preference_category_no_label"
|
android:layout="@layout/preference_category_no_label"
|
||||||
settings:controller="com.android.settings.location.LocationServicePreferenceController"/>
|
settings:controller="com.android.settings.location.LocationServicePreferenceController"/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="location_footer"
|
android:key="location_footer"
|
||||||
android:layout="@layout/preference_category_no_label"
|
android:layout="@layout/preference_category_no_label"
|
||||||
|
@@ -22,17 +22,9 @@
|
|||||||
android:title="@string/location_settings_title"
|
android:title="@string/location_settings_title"
|
||||||
settings:keywords="@string/keywords_location">
|
settings:keywords="@string/keywords_location">
|
||||||
|
|
||||||
<com.android.settingslib.RestrictedSwitchPreference
|
|
||||||
android:key="managed_profile_location_switch"
|
|
||||||
android:title="@string/managed_profile_location_switch_title"
|
|
||||||
settings:useAdminDisabledSummary="true"
|
|
||||||
settings:controller="com.android.settings.location.LocationForWorkPreferenceController"
|
|
||||||
android:enabled="false"
|
|
||||||
android:selectable="true"/>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="recent_location_requests"
|
android:key="recent_location_requests"
|
||||||
android:title="@string/location_category_recent_location_work_requests"
|
android:title="@string/location_category_recent_location_requests"
|
||||||
settings:controller="com.android.settings.location.RecentLocationRequestPreferenceController"/>
|
settings:controller="com.android.settings.location.RecentLocationRequestPreferenceController"/>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
@@ -42,10 +34,12 @@
|
|||||||
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
||||||
settings:searchable="false"/>
|
settings:searchable="false"/>
|
||||||
|
|
||||||
<PreferenceCategory
|
<com.android.settingslib.RestrictedSwitchPreference
|
||||||
android:key="location_advanced_settings"
|
android:key="managed_profile_location_switch"
|
||||||
android:layout="@layout/preference_category_no_label"
|
android:title="@string/managed_profile_location_switch_title"
|
||||||
settings:initialExpandedChildrenCount="2">
|
settings:useAdminDisabledSummary="true"
|
||||||
|
settings:controller="com.android.settings.location.LocationForWorkPreferenceController"
|
||||||
|
android:selectable="true"/>
|
||||||
|
|
||||||
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
||||||
<Preference
|
<Preference
|
||||||
@@ -64,8 +58,6 @@
|
|||||||
android:key="location_services_managed_profile"
|
android:key="location_services_managed_profile"
|
||||||
settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>
|
settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="location_footer"
|
android:key="location_footer"
|
||||||
android:layout="@layout/preference_category_no_label"
|
android:layout="@layout/preference_category_no_label"
|
||||||
|
@@ -74,12 +74,7 @@ public class RecentLocationRequestPreferenceController extends LocationBasePrefe
|
|||||||
public void displayPreference(PreferenceScreen screen) {
|
public void displayPreference(PreferenceScreen screen) {
|
||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey());
|
mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey());
|
||||||
}
|
final Context prefContext = mCategoryRecentLocationRequests.getContext();
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateState(Preference preference) {
|
|
||||||
mCategoryRecentLocationRequests.removeAll();
|
|
||||||
final Context prefContext = preference.getContext();
|
|
||||||
final List<RecentLocationApps.Request> recentLocationRequests =
|
final List<RecentLocationApps.Request> recentLocationRequests =
|
||||||
mRecentLocationApps.getAppListSorted(false);
|
mRecentLocationApps.getAppListSorted(false);
|
||||||
if (recentLocationRequests.size() > 3) {
|
if (recentLocationRequests.size() > 3) {
|
||||||
|
Reference in New Issue
Block a user