Loading res/xml/allowed_denied.xml +0 −8 Original line number Diff line number Diff line Loading @@ -17,14 +17,6 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:key="allowed_storage_full" android:title="@string/allowed_storage_full" /> <PreferenceCategory android:key="allowed_storage_scoped" android:title="@string/allowed_storage_scoped" /> <PreferenceCategory android:key="allowed" android:title="@string/allowed_header" /> Loading res/xml/allowed_denied_storage.xml 0 → 100644 +41 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:key="allowed_storage_full" android:title="@string/allowed_storage_full" /> <PreferenceCategory android:key="allowed_storage_scoped" android:title="@string/allowed_storage_scoped" /> <PreferenceCategory android:key="allowed_foreground" android:title="@string/allowed_foreground_header" /> <PreferenceCategory android:key="ask" android:title="@string/ask_header" /> <PreferenceCategory android:key="denied" android:title="@string/denied_header" /> </PreferenceScreen> src/com/android/permissioncontroller/permission/ui/handheld/PermissionAppsFragment.java +10 −13 Original line number Diff line number Diff line Loading @@ -229,18 +229,13 @@ public final class PermissionAppsFragment extends SettingsWithLargeHeader { private void onPackagesLoaded(Map<Category, List<Pair<String, UserHandle>>> categories) { boolean isStorage = mPermGroupName.equals(Manifest.permission_group.STORAGE); if (getPreferenceScreen() == null) { addPreferencesFromResource(R.xml.allowed_denied); // Hide allowed foreground label by default, to avoid briefly showing it before updating findPreference(ALLOWED_FOREGROUND.getCategoryName()).setVisible(false); // If this is the storage permission, hide the allowed category, and show the storage // specific allowed categories if (isStorage) { findPreference(ALLOWED.getCategoryName()).setVisible(false); addPreferencesFromResource(R.xml.allowed_denied_storage); } else { findPreference(STORAGE_ALLOWED_FULL).setVisible(false); findPreference(STORAGE_ALLOWED_SCOPED).setVisible(false); addPreferencesFromResource(R.xml.allowed_denied); } // Hide allowed foreground label by default, to avoid briefly showing it before updating findPreference(ALLOWED_FOREGROUND.getCategoryName()).setVisible(false); } Context context = getPreferenceManager().getContext(); Loading @@ -266,11 +261,13 @@ public final class PermissionAppsFragment extends SettingsWithLargeHeader { long sessionId = getArguments().getLong(EXTRA_SESSION_ID, INVALID_SESSION_ID); Boolean showAlways = mViewModel.getShowAllowAlwaysStringLiveData().getValue(); if (!isStorage) { if (showAlways != null && showAlways) { findPreference(ALLOWED.getCategoryName()).setTitle(R.string.allowed_always_header); } else { findPreference(ALLOWED.getCategoryName()).setTitle(R.string.allowed_header); } } for (Category grantCategory : categories.keySet()) { List<Pair<String, UserHandle>> packages = categories.get(grantCategory); Loading Loading
res/xml/allowed_denied.xml +0 −8 Original line number Diff line number Diff line Loading @@ -17,14 +17,6 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:key="allowed_storage_full" android:title="@string/allowed_storage_full" /> <PreferenceCategory android:key="allowed_storage_scoped" android:title="@string/allowed_storage_scoped" /> <PreferenceCategory android:key="allowed" android:title="@string/allowed_header" /> Loading
res/xml/allowed_denied_storage.xml 0 → 100644 +41 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:key="allowed_storage_full" android:title="@string/allowed_storage_full" /> <PreferenceCategory android:key="allowed_storage_scoped" android:title="@string/allowed_storage_scoped" /> <PreferenceCategory android:key="allowed_foreground" android:title="@string/allowed_foreground_header" /> <PreferenceCategory android:key="ask" android:title="@string/ask_header" /> <PreferenceCategory android:key="denied" android:title="@string/denied_header" /> </PreferenceScreen>
src/com/android/permissioncontroller/permission/ui/handheld/PermissionAppsFragment.java +10 −13 Original line number Diff line number Diff line Loading @@ -229,18 +229,13 @@ public final class PermissionAppsFragment extends SettingsWithLargeHeader { private void onPackagesLoaded(Map<Category, List<Pair<String, UserHandle>>> categories) { boolean isStorage = mPermGroupName.equals(Manifest.permission_group.STORAGE); if (getPreferenceScreen() == null) { addPreferencesFromResource(R.xml.allowed_denied); // Hide allowed foreground label by default, to avoid briefly showing it before updating findPreference(ALLOWED_FOREGROUND.getCategoryName()).setVisible(false); // If this is the storage permission, hide the allowed category, and show the storage // specific allowed categories if (isStorage) { findPreference(ALLOWED.getCategoryName()).setVisible(false); addPreferencesFromResource(R.xml.allowed_denied_storage); } else { findPreference(STORAGE_ALLOWED_FULL).setVisible(false); findPreference(STORAGE_ALLOWED_SCOPED).setVisible(false); addPreferencesFromResource(R.xml.allowed_denied); } // Hide allowed foreground label by default, to avoid briefly showing it before updating findPreference(ALLOWED_FOREGROUND.getCategoryName()).setVisible(false); } Context context = getPreferenceManager().getContext(); Loading @@ -266,11 +261,13 @@ public final class PermissionAppsFragment extends SettingsWithLargeHeader { long sessionId = getArguments().getLong(EXTRA_SESSION_ID, INVALID_SESSION_ID); Boolean showAlways = mViewModel.getShowAllowAlwaysStringLiveData().getValue(); if (!isStorage) { if (showAlways != null && showAlways) { findPreference(ALLOWED.getCategoryName()).setTitle(R.string.allowed_always_header); } else { findPreference(ALLOWED.getCategoryName()).setTitle(R.string.allowed_header); } } for (Category grantCategory : categories.keySet()) { List<Pair<String, UserHandle>> packages = categories.get(grantCategory); Loading