summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Quang Luong <qal@google.com> 2022-04-20 14:22:47 -0700
committer Quang Luong <qal@google.com> 2022-04-20 14:35:11 -0700
commit60a7265c8af8e544731bf3d80aac4055f1ae999d (patch)
treea82206870f1ff5365dda4c51aa765fb8cb002813
parent15210e793e479c0ce20b29758569e5e66ab939dc (diff)
Allow customization of P2P Invitation Received dialog style
Add an overlayable style item to ServiceWifiResources to allow the style of the P2P Invitation Received dialog to be customized. Bug: 208386468 Test: modify style, build, and observe P2P invitation received dialog style changes through adb shell cmd wifi launch-dialog-p2p-invitation-received Change-Id: I2252d771611e9f3b1207c2940f1def9e8fbf1ae8
-rw-r--r--WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java9
-rw-r--r--service/ServiceWifiResources/res/values/overlayable.xml1
-rw-r--r--service/ServiceWifiResources/res/values/styles.xml2
3 files changed, 11 insertions, 1 deletions
diff --git a/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java b/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
index c8856f7b06..18f3f56afb 100644
--- a/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
+++ b/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
@@ -137,6 +137,12 @@ public class WifiDialogActivity extends Activity {
name, "id", getWifiContext().getWifiOverlayApkPkgName());
}
+ private int getStyleId(@NonNull String name) {
+ Resources res = getResources();
+ return res.getIdentifier(
+ name, "style", getWifiContext().getWifiOverlayApkPkgName());
+ }
+
private WifiManager getWifiManager() {
if (mWifiManager == null) {
mWifiManager = getSystemService(WifiManager.class);
@@ -523,7 +529,8 @@ public class WifiDialogActivity extends Activity {
addRowToP2pDialog(group, getStringId("wifi_p2p_show_pin_message"), displayPin);
}
- AlertDialog dialog = new AlertDialog.Builder(this)
+ AlertDialog dialog = new AlertDialog.Builder(this,
+ getStyleId("wifi_p2p_invitation_received_dialog"))
.setTitle(getString(getStringId("wifi_p2p_invitation_to_connect_title")))
.setView(textEntryView)
.setPositiveButton(getStringId("accept"), (dialogPositive, which) -> {
diff --git a/service/ServiceWifiResources/res/values/overlayable.xml b/service/ServiceWifiResources/res/values/overlayable.xml
index 213012f6f7..ecf98b540f 100644
--- a/service/ServiceWifiResources/res/values/overlayable.xml
+++ b/service/ServiceWifiResources/res/values/overlayable.xml
@@ -324,6 +324,7 @@
<item type="style" name="wifi_item_label" />
<item type="style" name="wifi_item_content" />
<item type="style" name="wifi_section" />
+ <item type="style" name="wifi_p2p_invitation_received_dialog" />
<!-- Params from styles.xml that can be overlayed -->
<!-- Params from drawable/ that can be overlayed -->
diff --git a/service/ServiceWifiResources/res/values/styles.xml b/service/ServiceWifiResources/res/values/styles.xml
index 1de17d6356..a4cc4d63b9 100644
--- a/service/ServiceWifiResources/res/values/styles.xml
+++ b/service/ServiceWifiResources/res/values/styles.xml
@@ -42,4 +42,6 @@
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
</style>
+
+ <style name="wifi_p2p_invitation_received_dialog" />
</resources>