From ecfb65e00008f0d762be8fc70658f7e7ce1c6460 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 15 Nov 2019 13:58:40 -0800 Subject: 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 --- .../server/wifi/p2p/WifiP2pServiceImpl.java | 24 +++++----------------- service/res/values/overlayable.xml | 5 ----- service/res/values/strings.xml | 6 ------ 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 @@ - - - - - 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 @@ An application - Wi-Fi Direct - Start Wi-Fi Direct. This will turn off Wi-Fi client/hotspot. - Couldn\'t start Wi-Fi Direct. - Wi-Fi Direct is on - Tap for settings - Accept Decline OK -- cgit v1.2.3