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>
|
||||
<!-- Location settings screen, sub category for location services [CHAR LIMIT=30] -->
|
||||
<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 -->
|
||||
<string name="location_title">My Location</string>
|
||||
|
@@ -34,34 +34,27 @@
|
||||
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
||||
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 -->
|
||||
<Preference
|
||||
android:key="app_level_permissions"
|
||||
android:title="@string/location_app_level_permissions"
|
||||
settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
|
||||
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
||||
<Preference
|
||||
android:key="app_level_permissions"
|
||||
android:title="@string/location_app_level_permissions"
|
||||
settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
|
||||
<intent android:action="android.intent.action.MANAGE_PERMISSION_APPS">
|
||||
<extra android:name="android.intent.extra.PERMISSION_NAME"
|
||||
android:value="android.permission-group.LOCATION"/>
|
||||
</intent>
|
||||
</Preference>
|
||||
<extra android:name="android.intent.extra.PERMISSION_NAME"
|
||||
android:value="android.permission-group.LOCATION"/>
|
||||
</intent>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="location_scanning"
|
||||
android:title="@string/location_scanning_screen_title"
|
||||
android:fragment="com.android.settings.location.ScanningSettings"
|
||||
settings:controller="com.android.settings.location.LocationScanningPreferenceController"/>
|
||||
<Preference
|
||||
android:key="location_scanning"
|
||||
android:title="@string/location_scanning_screen_title"
|
||||
android:fragment="com.android.settings.location.ScanningSettings"
|
||||
settings:controller="com.android.settings.location.LocationScanningPreferenceController"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="location_services"
|
||||
android:layout="@layout/preference_category_no_label"
|
||||
settings:controller="com.android.settings.location.LocationServicePreferenceController"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:key="location_services"
|
||||
android:layout="@layout/preference_category_no_label"
|
||||
settings:controller="com.android.settings.location.LocationServicePreferenceController"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="location_footer"
|
||||
|
@@ -22,17 +22,9 @@
|
||||
android:title="@string/location_settings_title"
|
||||
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
|
||||
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"/>
|
||||
|
||||
<Preference
|
||||
@@ -42,29 +34,29 @@
|
||||
android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
|
||||
settings:searchable="false"/>
|
||||
|
||||
<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:selectable="true"/>
|
||||
|
||||
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
||||
<Preference
|
||||
android:key="app_level_permissions"
|
||||
android:title="@string/location_app_level_permissions"
|
||||
settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
|
||||
<intent android:action="android.intent.action.MANAGE_PERMISSION_APPS">
|
||||
<extra android:name="android.intent.extra.PERMISSION_NAME"
|
||||
android:value="android.permission-group.LOCATION"/>
|
||||
</intent>
|
||||
</Preference>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="location_advanced_settings"
|
||||
android:title="@string/managed_profile_location_services"
|
||||
android:layout="@layout/preference_category_no_label"
|
||||
settings:initialExpandedChildrenCount="2">
|
||||
|
||||
<!-- This preference category gets removed if new_recent_location_ui is disabled -->
|
||||
<Preference
|
||||
android:key="app_level_permissions"
|
||||
android:title="@string/location_app_level_permissions"
|
||||
settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
|
||||
<intent android:action="android.intent.action.MANAGE_PERMISSION_APPS">
|
||||
<extra android:name="android.intent.extra.PERMISSION_NAME"
|
||||
android:value="android.permission-group.LOCATION"/>
|
||||
</intent>
|
||||
</Preference>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/managed_profile_location_services"
|
||||
android:layout="@layout/preference_category_no_label"
|
||||
android:key="location_services_managed_profile"
|
||||
settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
android:key="location_services_managed_profile"
|
||||
settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="location_footer"
|
||||
|
@@ -74,12 +74,7 @@ public class RecentLocationRequestPreferenceController extends LocationBasePrefe
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
mCategoryRecentLocationRequests.removeAll();
|
||||
final Context prefContext = preference.getContext();
|
||||
final Context prefContext = mCategoryRecentLocationRequests.getContext();
|
||||
final List<RecentLocationApps.Request> recentLocationRequests =
|
||||
mRecentLocationApps.getAppListSorted(false);
|
||||
if (recentLocationRequests.size() > 3) {
|
||||
|
Reference in New Issue
Block a user