summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-09-06 19:49:08 -0700
committerIrfan Sheriff <isheriff@google.com>2011-09-06 19:49:08 -0700
commitdff28d5293c16ac75f6db7a1c3b78fbaad1f2f6a (patch)
tree8f79543fcb8b8bbf70ea7a1c2a348e4e3c985f19 /wifi
parent8b55e926f1a50cf38596be915603c08afd1f27ac (diff)
downloadframeworks_base-dff28d5293c16ac75f6db7a1c3b78fbaad1f2f6a.zip
frameworks_base-dff28d5293c16ac75f6db7a1c3b78fbaad1f2f6a.tar.gz
frameworks_base-dff28d5293c16ac75f6db7a1c3b78fbaad1f2f6a.tar.bz2
Handle state transition for p2p enable reject
Bug: 5265878 Change-Id: Ifd0ecb98876ffe098af06d67226f312d2a3d49c7
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/p2p/WifiP2pService.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index 5297302..49e87d3 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -128,7 +128,9 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
public static final int GROUP_NEGOTIATION_TIMED_OUT = BASE + 3;
/* User accepted to disable Wi-Fi in order to enable p2p */
- private static final int WIFI_DISABLE_USER_ACCEPT = BASE + 11;
+ private static final int WIFI_DISABLE_USER_ACCEPT = BASE + 4;
+ /* User rejected to disable Wi-Fi in order to enable p2p */
+ private static final int WIFI_DISABLE_USER_REJECT = BASE + 5;
private final boolean mP2pSupported;
private final String mDeviceType;
@@ -359,6 +361,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
break;
// Ignore
case WIFI_DISABLE_USER_ACCEPT:
+ case WIFI_DISABLE_USER_REJECT:
case GROUP_NEGOTIATION_TIMED_OUT:
break;
default:
@@ -457,8 +460,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
if (which == DialogInterface.BUTTON_POSITIVE) {
sendMessage(WIFI_DISABLE_USER_ACCEPT);
} else {
- logd("User rejected enabling p2p");
- //ignore
+ sendMessage(WIFI_DISABLE_USER_REJECT);
}
}
};
@@ -509,6 +511,11 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
mWifiChannel.sendMessage(P2P_ENABLE_PENDING);
transitionTo(mWaitForWifiDisableState);
break;
+ case WIFI_DISABLE_USER_REJECT:
+ logd("User rejected enabling p2p");
+ sendP2pStateChangedBroadcast(false);
+ transitionTo(mP2pDisabledState);
+ break;
case WifiP2pManager.ENABLE_P2P:
case WifiP2pManager.DISABLE_P2P:
deferMessage(message);