summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/p2p
diff options
context:
space:
mode:
authorVinit Deshapnde <vinitd@google.com>2013-09-09 16:28:31 -0700
committerVinit Deshapnde <vinitd@google.com>2013-09-09 16:28:31 -0700
commit2c385ecb1c390f7b695842fedfdebf95fd5e842c (patch)
tree97aa4dcafc92f4ef037eb7313a7046626546a426 /wifi/java/android/net/wifi/p2p
parent2def61485413084e68233c89ba956a2282fbacd1 (diff)
downloadframeworks_base-2c385ecb1c390f7b695842fedfdebf95fd5e842c.zip
frameworks_base-2c385ecb1c390f7b695842fedfdebf95fd5e842c.tar.gz
frameworks_base-2c385ecb1c390f7b695842fedfdebf95fd5e842c.tar.bz2
Set country code on P2p interfaces as well
This change will set country code on P2p interfaces as well, so the drivers are free to use channels that are permitted regionally. This is required for FCC style compliance and Miracast certification. Bug: 10513263 Change-Id: I88c645bd488066d5167e23e2772f2e0e1f40fa8a
Diffstat (limited to 'wifi/java/android/net/wifi/p2p')
-rw-r--r--wifi/java/android/net/wifi/p2p/WifiP2pService.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index 05196b8..625ffb8 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -174,6 +174,9 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
// msg.obj = StateMachine to send to when blocked
public static final int BLOCK_DISCOVERY = BASE + 15;
+ // set country code
+ public static final int SET_COUNTRY_CODE = BASE + 16;
+
public static final int ENABLED = 1;
public static final int DISABLED = 0;
@@ -632,6 +635,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
case WifiP2pManager.START_LISTEN:
case WifiP2pManager.STOP_LISTEN:
case WifiP2pManager.SET_CHANNEL:
+ case SET_COUNTRY_CODE:
break;
case WifiStateMachine.CMD_ENABLE_P2P:
// Enable is lazy and has no response
@@ -1064,6 +1068,10 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
replyToMessage(message, WifiP2pManager.SET_CHANNEL_FAILED);
}
break;
+ case SET_COUNTRY_CODE:
+ String countryCode = (String) message.obj;
+ mWifiNative.setCountryCode(countryCode);
+ break;
default:
return NOT_HANDLED;
}
@@ -2537,6 +2545,12 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
mServiceTransactionId = 0;
mServiceDiscReqId = null;
+ String countryCode = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.WIFI_COUNTRY_CODE);
+ if (countryCode != null && !countryCode.isEmpty()) {
+ mP2pStateMachine.sendMessage(SET_COUNTRY_CODE, countryCode);
+ }
+
updatePersistentNetworks(RELOAD);
}