Define separate view styles outside of P2P dialog layout

If OEMs overlay the P2P dialog layout entirely, each of the child Views
are assigned a separate resource ID from the default resource APK. This
results in WifiDialogActivity not being able to reference these Views
using ViewGroup.findViewById(), which does not translate the default
View resource IDs to the overlayed IDs. Thus we should separate the
styles from the P2P dialog layout and have OEMs simply overlay the
styles instead.

Bug: 234326049
Test: adb shell cmd wifi launch-dialog-p2p-invitation-received with
overlays on wifi_p2p_dialog_row_lable and wifi_p2p_dialog_row_content

Change-Id: I0d2d25d0683ffc9c1eb93859487869d6eb188f2e
diff --git a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog.xml b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog.xml
index 86dcbfa..8579493 100644
--- a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog.xml
+++ b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog.xml
@@ -19,7 +19,7 @@
     android:layout_height="wrap_content">
 
     <LinearLayout
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical">
 
@@ -34,13 +34,10 @@
                 style="@style/wifi_item">
                 <TextView
                     android:text="@string/wifi_p2p_enter_pin_message"
-                    style="@style/wifi_item_label" />
+                    style="@style/wifi_p2p_dialog_enter_pin_message" />
 
                 <EditText android:id="@+id/wifi_p2p_wps_pin"
-                        android:singleLine="true"
-                        android:maxLines="8"
-                        android:inputType="number"
-                        style="@style/wifi_item_content" />
+                        style="@style/wifi_p2p_dialog_pin_input" />
             </LinearLayout>
         </LinearLayout>
     </LinearLayout>
diff --git a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog_row.xml b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog_row.xml
index 2c88b10..ca9bbb2 100644
--- a/service/ServiceWifiResources/res/layout/wifi_p2p_dialog_row.xml
+++ b/service/ServiceWifiResources/res/layout/wifi_p2p_dialog_row.xml
@@ -17,12 +17,10 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     style="@style/wifi_item">
     <TextView
-            style="@style/wifi_item_label"
-            android:id="@+id/name" />
+            android:id="@+id/name"
+            style="@style/wifi_p2p_dialog_row_label"/>
 
     <TextView
             android:id="@+id/value"
-            style="@style/wifi_item_content"
-            android:textStyle="bold"
-            android:textAlignment="viewStart" />
+            style="@style/wifi_p2p_dialog_row_content"/>
 </LinearLayout>
diff --git a/service/ServiceWifiResources/res/values/overlayable.xml b/service/ServiceWifiResources/res/values/overlayable.xml
index 2b43cdf..2d6d08d 100644
--- a/service/ServiceWifiResources/res/values/overlayable.xml
+++ b/service/ServiceWifiResources/res/values/overlayable.xml
@@ -328,6 +328,10 @@
           <item type="style" name="wifi_item_content" />
           <item type="style" name="wifi_section" />
           <item type="style" name="wifi_p2p_invitation_received_dialog" />
+          <item type="style" name="wifi_p2p_dialog_row_label" />
+          <item type="style" name="wifi_p2p_dialog_row_content" />
+          <item type="style" name="wifi_p2p_dialog_enter_pin_message" />
+          <item type="style" name="wifi_p2p_dialog_pin_input" />
           <!-- 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 a4cc4d6..db06ef3 100644
--- a/service/ServiceWifiResources/res/values/styles.xml
+++ b/service/ServiceWifiResources/res/values/styles.xml
@@ -44,4 +44,19 @@
     </style>
 
     <style name="wifi_p2p_invitation_received_dialog" />
+
+    <style name="wifi_p2p_dialog_row_label" parent="@style/wifi_item_label" />
+
+    <style name="wifi_p2p_dialog_row_content" parent="@style/wifi_item_content">
+        <item name="android:textStyle">bold</item>
+        <item name="android:textAlignment">viewStart</item>
+    </style>
+
+    <style name="wifi_p2p_dialog_enter_pin_message" parent="@style/wifi_item_label" />
+
+    <style name="wifi_p2p_dialog_pin_input" parent="@style/wifi_item_content">
+        <item name="android:singleLine">true</item>
+        <item name="android:maxLength">8</item>
+        <item name="android:inputType">number</item>
+    </style>
 </resources>