diff options
author | 2022-04-20 14:22:47 -0700 | |
---|---|---|
committer | 2022-04-20 14:35:11 -0700 | |
commit | 60a7265c8af8e544731bf3d80aac4055f1ae999d (patch) | |
tree | a82206870f1ff5365dda4c51aa765fb8cb002813 /WifiDialog | |
parent | 15210e793e479c0ce20b29758569e5e66ab939dc (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
Diffstat (limited to 'WifiDialog')
-rw-r--r-- | WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java | 9 |
1 files changed, 8 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) -> { |