summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2022-06-23 23:25:47 +0000
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2022-06-23 23:25:47 +0000
commit5f5b9c8f0440680393ed9ebb33a206245fda83ad (patch)
tree8c7ad91ec0ddd30ca0bb2d59904ca9f9dd5ed7ed
parentda41087257c79d0c3884863559cc4181fd02d112 (diff)
parentd38cfe2f93b8cee42ea4a252d23e6889d1853738 (diff)
Snap for 8762204 from d38cfe2f93b8cee42ea4a252d23e6889d1853738 to tm-release
Change-Id: I1a6d5ba935c296b1f8d4efc0a2cdb24e98ac2dd9
-rw-r--r--PermissionController/res/drawable/qs_dialog_button_outline.xml40
-rw-r--r--PermissionController/res/layout/storage_dialog_header.xml27
-rw-r--r--PermissionController/res/values-night/themes.xml2
-rw-r--r--PermissionController/res/values/overlayable.xml13
-rw-r--r--PermissionController/res/values/styles.xml53
-rw-r--r--PermissionController/res/values/themes.xml10
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionFragment.java13
7 files changed, 3 insertions, 155 deletions
diff --git a/PermissionController/res/drawable/qs_dialog_button_outline.xml b/PermissionController/res/drawable/qs_dialog_button_outline.xml
deleted file mode 100644
index e2564d597..000000000
--- a/PermissionController/res/drawable/qs_dialog_button_outline.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2022 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.
--->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:insetTop="6dp"
- android:insetBottom="6dp">
- <ripple android:color="?android:attr/colorControlHighlight">
- <item android:id="@android:id/mask">
- <shape android:shape="rectangle">
- <solid android:color="@android:color/white"/>
- <corners android:radius="?android:attr/buttonCornerRadius"/>
- </shape>
- </item>
- <item>
- <shape android:shape="rectangle">
- <corners android:radius="?android:attr/buttonCornerRadius"/>
- <solid android:color="@android:color/transparent"/>
- <stroke android:color="?android:colorAccent"
- android:width="1dp"
- />
- <padding android:left="16dp"
- android:top="8dp"
- android:right="16dp"
- android:bottom="8dp"/>
- </shape>
- </item>
- </ripple>
-</inset>
diff --git a/PermissionController/res/layout/storage_dialog_header.xml b/PermissionController/res/layout/storage_dialog_header.xml
deleted file mode 100644
index 8985a2e2f..000000000
--- a/PermissionController/res/layout/storage_dialog_header.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2022 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.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/StorageDialogHeaderStyle">
-
- <ImageView
- android:id="@+id/storage_dialog_icon"
- style="@style/StorageDialogHeaderIconStyle"/>
-
- <TextView
- android:id="@+id/storage_dialog_title"
- style="@style/StorageDialogHeaderTitleStyle"/>
-
-</LinearLayout>
diff --git a/PermissionController/res/values-night/themes.xml b/PermissionController/res/values-night/themes.xml
index f5237a5ca..b4257ab4e 100644
--- a/PermissionController/res/values-night/themes.xml
+++ b/PermissionController/res/values-night/themes.xml
@@ -41,6 +41,4 @@
</style>
<style name="Theme.DeviceDefault.Dialog.Alert.DayNight" parent="@android:style/Theme.DeviceDefault.Dialog.Alert" />
-
- <style name="StoragePermissionDialogBase" parent="android:Theme.DeviceDefault.Dialog.Alert" />
</resources>
diff --git a/PermissionController/res/values/overlayable.xml b/PermissionController/res/values/overlayable.xml
index 2de6f3b04..7d36d2742 100644
--- a/PermissionController/res/values/overlayable.xml
+++ b/PermissionController/res/values/overlayable.xml
@@ -292,19 +292,6 @@
<item type="style" name="WarningBannerWidgetFrame" />
<!-- END WARNING BANNER PREFERENCE STYLE -->
- <!-- START STORAGE PERMISSION DIALOG -->
- <item type="style" name="StoragePermissionDialogPositiveButton" />
- <item type="style" name="StoragePermissionDialogNegativeButton" />
- <item type="style" name="StoragePermissionDialogButtonBar" />
-
- <item type="style" name="StorageDialogHeaderStyle" />
- <item type="style" name="StorageDialogHeaderIconStyle" />
- <item type="style" name="StorageDialogHeaderTitleStyle" />
-
- <!-- dialog theme -->
- <item type="style" name="StoragePermissionDialog" />
- <!-- END STORAGE PERMISSION DIALOG -->
-
</policy>
</overlayable>
diff --git a/PermissionController/res/values/styles.xml b/PermissionController/res/values/styles.xml
index e42e14154..a7424bfbc 100644
--- a/PermissionController/res/values/styles.xml
+++ b/PermissionController/res/values/styles.xml
@@ -1177,57 +1177,4 @@
<!-- END WARNING BANNER -->
- <!-- START STORAGE PERMISSION DIALOG -->
-
- <style name="StoragePermissionDialogPositiveButton">
- <item name="android:buttonCornerRadius">28dp</item>
- <item name="android:background">@drawable/qs_dialog_button_outline</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:layout_marginStart">4dp</item>
- <item name="android:layout_marginEnd">20dp</item>
- </style>
-
- <style name="StoragePermissionDialogNegativeButton">
- <item name="android:buttonCornerRadius">28dp</item>
- <item name="android:background">@drawable/qs_dialog_button_outline</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:layout_marginEnd">4dp</item>
- </style>
-
- <style name="StoragePermissionDialogButtonBar">
- <item name="android:background">@drawable/qs_dialog_button_outline</item>
- <item name="android:minHeight">56dp</item>
- <item name="android:paddingBottom">18dp</item>
- <item name="android:paddingStart">24dp</item>
- <item name="android:paddingEnd">24dp</item>
- </style>
-
- <style name="StorageDialogHeaderStyle">
- <item name="android:orientation">vertical</item>
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">match_parent</item>
- <item name="android:paddingTop">24dp</item>
- <item name="android:paddingStart">24dp</item>
- <item name="android:paddingEnd">24dp</item>
- </style>
-
- <style name="StorageDialogHeaderIconStyle">
- <item name="android:layout_width">32dp</item>
- <item name="android:layout_height">32dp</item>
- <item name="android:layout_gravity">center</item>
- </style>
-
- <style name="StorageDialogHeaderTitleStyle">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginTop">16dp</item>
- <item name="android:layout_marginBottom">8dp</item>
- <item name="android:layout_gravity">center</item>
- <item name="android:textAppearance">@android:style/TextAppearance.DeviceDefault.DialogWindowTitle</item>
- <item name="android:textSize">24sp</item>
- <item name="android:gravity">center</item>
- </style>
-
- <!-- END STORAGE PERMISSION DIALOG -->
-
</resources>
diff --git a/PermissionController/res/values/themes.xml b/PermissionController/res/values/themes.xml
index cbf7e745a..fe74cf39b 100644
--- a/PermissionController/res/values/themes.xml
+++ b/PermissionController/res/values/themes.xml
@@ -103,16 +103,6 @@
<style name="Theme.DeviceDefault.Dialog.Alert.DayNight" parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
- <style name="StoragePermissionDialogBase" parent="android:Theme.DeviceDefault.Light.Dialog.Alert" />
-
- <style name="StoragePermissionDialog" parent="StoragePermissionDialogBase">
- <item name="android:buttonCornerRadius">28dp</item>
- <item name="android:gravity">center</item>
- <item name="android:buttonBarPositiveButtonStyle">@style/StoragePermissionDialogPositiveButton</item>
- <item name="android:buttonBarNegativeButtonStyle">@style/StoragePermissionDialogNegativeButton</item>
- <item name="android:buttonBarButtonStyle">@style/StoragePermissionDialogButtonBar</item>
- </style>
-
<!-- Do not allow OEMs to overlay these themes.
Must Guarantee that filterTouches is set for these activities -->
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionFragment.java
index 1786d9c69..dad64abbe 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionFragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/AppPermissionFragment.java
@@ -58,7 +58,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.Switch;
import android.widget.TextView;
@@ -628,14 +627,8 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
@Override
public void showAdvancedConfirmDialog(AdvancedConfirmDialogArgs args) {
- LayoutInflater li = LayoutInflater.from(getContext());
- LinearLayout header = (LinearLayout) li.inflate(R.layout.storage_dialog_header, null);
- ((ImageView) header.findViewById(R.id.storage_dialog_icon))
- .setImageResource(args.getIconId());
-
- AlertDialog.Builder b = new AlertDialog.Builder(getContext(),
- R.style.StoragePermissionDialog)
- .setCustomTitle(header)
+ AlertDialog.Builder b = new AlertDialog.Builder(getContext())
+ .setIcon(args.getIconId())
.setMessage(args.getMessageId())
.setNegativeButton(args.getNegativeButtonTextId(),
(DialogInterface dialog, int which) -> {
@@ -648,7 +641,7 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
args.getChangeRequest(), args.getButtonClicked());
});
if (args.getTitleId() != 0) {
- ((TextView) header.findViewById(R.id.storage_dialog_title)).setText(args.getTitleId());
+ b.setTitle(args.getTitleId());
}
b.show();
}