Fields Summary |
---|
private static final String | TAG |
private static final boolean | DBG |
private static final String | NETWORKTYPE |
private android.content.Context | mContext |
private String | mInterface |
private android.app.Notification | mNotification |
android.os.INetworkManagementService | mNwService |
private android.net.DhcpStateMachine | mDhcpStateMachine |
private P2pStateMachine | mP2pStateMachine |
private com.android.internal.util.AsyncChannel | mReplyChannel |
private com.android.internal.util.AsyncChannel | mWifiChannel |
private static final Boolean | JOIN_GROUP |
private static final Boolean | FORM_GROUP |
private static final Boolean | RELOAD |
private static final Boolean | NO_RELOAD |
private static final int | GROUP_CREATING_WAIT_TIME_MS |
private static int | mGroupCreatingTimeoutIndex |
private static final int | DISABLE_P2P_WAIT_TIME_MS |
private static int | mDisableP2pTimeoutIndex |
private static final int | DISCOVER_TIMEOUT_S |
private static final int | GROUP_IDLE_TIME_S |
private static final int | BASE |
public static final int | GROUP_CREATING_TIMED_OUT |
private static final int | PEER_CONNECTION_USER_ACCEPT |
private static final int | PEER_CONNECTION_USER_REJECT |
private static final int | DROP_WIFI_USER_ACCEPT |
private static final int | DROP_WIFI_USER_REJECT |
public static final int | DISABLE_P2P_TIMED_OUT |
public static final int | P2P_CONNECTION_CHANGED |
public static final int | DISCONNECT_WIFI_REQUEST |
public static final int | DISCONNECT_WIFI_RESPONSE |
public static final int | SET_MIRACAST_MODE |
public static final int | BLOCK_DISCOVERY |
public static final int | SET_COUNTRY_CODE |
public static final int | ENABLED |
public static final int | DISABLED |
private final boolean | mP2pSupported |
private android.net.wifi.p2p.WifiP2pDevice | mThisDevice |
private boolean | mAutonomousGroup |
private boolean | mJoinExistingGroup |
private boolean | mDiscoveryStarted |
private boolean | mDiscoveryBlocked |
private String | mLastSetCountryCode |
private boolean | mDiscoveryPostponed |
private android.net.NetworkInfo | mNetworkInfo |
private boolean | mTemporarilyDisconnectedWifi |
private byte | mServiceTransactionId |
private String | mServiceDiscReqId |
private HashMap | mClientInfoList |
private static final String | SERVER_ADDRESS |
private ClientHandler | mClientHandler |
Methods Summary |
---|
private int | checkConnectivityInternalPermission()
return mContext.checkCallingOrSelfPermission(
android.Manifest.permission.CONNECTIVITY_INTERNAL);
|
private int | checkLocationHardwarePermission()
return mContext.checkCallingOrSelfPermission(
android.Manifest.permission.LOCATION_HARDWARE);
|
public void | connectivityServiceReady()
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
mNwService = INetworkManagementService.Stub.asInterface(b);
|
protected void | dump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
!= PackageManager.PERMISSION_GRANTED) {
pw.println("Permission Denial: can't dump WifiP2pService from from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid());
return;
}
mP2pStateMachine.dump(fd, pw, args);
pw.println("mAutonomousGroup " + mAutonomousGroup);
pw.println("mJoinExistingGroup " + mJoinExistingGroup);
pw.println("mDiscoveryStarted " + mDiscoveryStarted);
pw.println("mNetworkInfo " + mNetworkInfo);
pw.println("mTemporarilyDisconnectedWifi " + mTemporarilyDisconnectedWifi);
pw.println("mServiceDiscReqId " + mServiceDiscReqId);
pw.println();
|
private void | enforceAccessPermission()
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_WIFI_STATE,
"WifiP2pService");
|
private void | enforceChangePermission()
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.CHANGE_WIFI_STATE,
"WifiP2pService");
|
private void | enforceConnectivityInternalOrLocationHardwarePermission()
if (checkConnectivityInternalPermission() != PackageManager.PERMISSION_GRANTED
&& checkLocationHardwarePermission() != PackageManager.PERMISSION_GRANTED) {
enforceConnectivityInternalPermission();
}
|
private void | enforceConnectivityInternalPermission()
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.CONNECTIVITY_INTERNAL,
"WifiP2pService");
|
public android.os.Messenger | getMessenger()Get a reference to handler. This is used by a client to establish
an AsyncChannel communication with WifiP2pService
enforceAccessPermission();
enforceChangePermission();
return new Messenger(mClientHandler);
|
public android.os.Messenger | getP2pStateMachineMessenger()Get a reference to handler. This is used by a WifiStateMachine to establish
an AsyncChannel communication with P2pStateMachine
enforceConnectivityInternalOrLocationHardwarePermission();
enforceAccessPermission();
enforceChangePermission();
return new Messenger(mP2pStateMachine.getHandler());
|
public void | setMiracastMode(int mode)This is used to provide information to drivers to optimize performance depending
on the current mode of operation.
0 - disabled
1 - source operation
2 - sink operation
As an example, the driver could reduce the channel dwell time during scanning
when acting as a source or sink to minimize impact on miracast.
enforceConnectivityInternalPermission();
mP2pStateMachine.sendMessage(SET_MIRACAST_MODE, mode);
|