Add a hidden API to toggle airplane mode.
Added a hidden API under ConnectivityManager to toggle airplane mode. This may be a temp solution for b/10653570. bug:10653570 Change-Id: I0b2b42230073289eb8dc6891317d62b84e26c133
This commit is contained in:
@@ -1476,4 +1476,20 @@ public class ConnectivityManager {
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for enabling/disabling airplane mode
|
||||
*
|
||||
* @param enable whether to enable airplane mode or not
|
||||
*
|
||||
* <p>This method requires the call to hold the permission
|
||||
* {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
|
||||
* @hide
|
||||
*/
|
||||
public void setAirplaneMode(boolean enable) {
|
||||
try {
|
||||
mService.setAirplaneMode(enable);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,4 +156,6 @@ interface IConnectivityManager
|
||||
LinkQualityInfo[] getAllLinkQualityInfo();
|
||||
|
||||
void setProvisioningNotificationVisible(boolean visible, int networkType, in String extraInfo, in String url);
|
||||
|
||||
void setAirplaneMode(boolean enable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user