summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-11-15 13:58:40 -0800
committerRoshan Pius <rpius@google.com>2019-11-15 22:17:29 +0000
commitecfb65e00008f0d762be8fc70658f7e7ce1c6460 (patch)
tree345cc37a1f0ab8e186196dd81151a45b77ca16e0
parent739153adae450723311a8e01fee6cadb6aaea003 (diff)
WifiP2pServiceImpl: Use resources from context
The wifi resources are no longer in the system resource. So, use the local context to retrieve resources. Also, removed an unused method and some unused p2p resources. Bug: 144443881 Test: Compiles Change-Id: Ic581481e67125aba5ba1d9ff6f4af513acc9e75d
-rw-r--r--service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java24
-rw-r--r--service/res/values/overlayable.xml5
-rw-r--r--service/res/values/strings.xml6
3 files changed, 5 insertions, 30 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
index 3ed56a619..8fc0a8f6b 100644
--- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
+++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
@@ -2492,7 +2492,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
private void notifyFrequencyConflict() {
logd("Notify frequency conflict");
- Resources r = Resources.getSystem();
+ Resources r = mContext.getResources();
AlertDialog dialog = new AlertDialog.Builder(mContext)
.setMessage(r.getString(R.string.wifi_p2p_frequency_conflict_message,
@@ -3096,22 +3096,8 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
}
- private void notifyP2pEnableFailure() {
- Resources r = Resources.getSystem();
- AlertDialog dialog = new AlertDialog.Builder(mContext)
- .setTitle(r.getString(R.string.wifi_p2p_dialog_title))
- .setMessage(r.getString(R.string.wifi_p2p_failed_message))
- .setPositiveButton(r.getString(R.string.ok), null)
- .create();
- dialog.setCanceledOnTouchOutside(false);
- dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
- dialog.getWindow().addSystemFlags(
- WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS);
- dialog.show();
- }
-
private void addRowToDialog(ViewGroup group, int stringId, String value) {
- Resources r = Resources.getSystem();
+ Resources r = mContext.getResources();
View row = LayoutInflater.from(mContext).inflate(R.layout.wifi_p2p_dialog_row,
group, false);
((TextView) row.findViewById(R.id.name)).setText(r.getString(stringId));
@@ -3120,7 +3106,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
private void notifyInvitationSent(String pin, String peerAddress) {
- Resources r = Resources.getSystem();
+ Resources r = mContext.getResources();
final View textEntryView = LayoutInflater.from(mContext)
.inflate(R.layout.wifi_p2p_dialog, null);
@@ -3142,7 +3128,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
private void notifyP2pProvDiscShowPinRequest(String pin, String peerAddress) {
- Resources r = Resources.getSystem();
+ Resources r = mContext.getResources();
final View textEntryView = LayoutInflater.from(mContext)
.inflate(R.layout.wifi_p2p_dialog, null);
@@ -3167,7 +3153,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
private void notifyInvitationReceived() {
- Resources r = Resources.getSystem();
+ Resources r = mContext.getResources();
final WpsInfo wps = mSavedPeerConfig.wps;
final View textEntryView = LayoutInflater.from(mContext)
.inflate(R.layout.wifi_p2p_dialog, null);
diff --git a/service/res/values/overlayable.xml b/service/res/values/overlayable.xml
index 581f0be7f..5d20c24c9 100644
--- a/service/res/values/overlayable.xml
+++ b/service/res/values/overlayable.xml
@@ -126,11 +126,6 @@
<item type="string" name="wifi_connect_alert_title" />
<item type="string" name="wifi_connect_alert_message" />
<item type="string" name="wifi_connect_default_application" />
- <item type="string" name="wifi_p2p_dialog_title" />
- <item type="string" name="wifi_p2p_turnon_message" />
- <item type="string" name="wifi_p2p_failed_message" />
- <item type="string" name="wifi_p2p_enabled_notification_title" />
- <item type="string" name="wifi_p2p_enabled_notification_message" />
<item type="string" name="accept" />
<item type="string" name="decline" />
<item type="string" name="ok" />
diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml
index a899e72be..69d210670 100644
--- a/service/res/values/strings.xml
+++ b/service/res/values/strings.xml
@@ -91,12 +91,6 @@
<!-- default application in case name can not be found -->
<string name="wifi_connect_default_application">An application</string>
- <string name="wifi_p2p_dialog_title">Wi-Fi Direct</string>
- <string name="wifi_p2p_turnon_message">Start Wi-Fi Direct. This will turn off Wi-Fi client/hotspot.</string>
- <string name="wifi_p2p_failed_message">Couldn\'t start Wi-Fi Direct.</string>
- <string name="wifi_p2p_enabled_notification_title">Wi-Fi Direct is on</string>
- <string name="wifi_p2p_enabled_notification_message">Tap for settings</string>
-
<string name="accept">Accept</string>
<string name="decline">Decline</string>
<string name="ok">OK</string>