Add DO API to get wifi mac address

Bug 25496044

Change-Id: Ib1f0ce4ca10951edcfaa0aa79ae5c2d142a74599
This commit is contained in:
Makoto Onuki
2015-11-23 17:15:21 -08:00
parent d79a245ac2
commit a31ebbc439
8 changed files with 121 additions and 0 deletions

View File

@@ -4649,4 +4649,21 @@ public class DevicePolicyManager {
return false;
}
}
/**
* Called by device owner to get the MAC address of the Wi-Fi device.
*
* @return the MAC address of the Wi-Fi device, or null when the information is not
* available. (For example, Wi-Fi hasn't been enabled, or the device doesn't support Wi-Fi.)
*
* <p>The address will be in the {@code XX:XX:XX:XX:XX:XX} format.
*/
public String getWifiMacAddress() {
try {
return mService.getWifiMacAddress();
} catch (RemoteException re) {
Log.w(TAG, "Failed talking with device policy service", re);
return null;
}
}
}

View File

@@ -236,4 +236,5 @@ interface IDevicePolicyManager {
List<String> getKeepUninstalledPackages(in ComponentName admin);
boolean isManagedProfile(in ComponentName admin);
boolean isSystemOnlyUser(in ComponentName admin);
String getWifiMacAddress();
}