Adds necessary permissions to system apis

adds privileged permission for getCaptivePortalServerUrl
adds tether privileged permission for
startTethering,isTetheringSupported

bug:62348162

Test: make and manual testing
Change-Id: I8eb8e3c9dcd7201abe9ea303ee57fe99073d67eb
This commit is contained in:
Udam Saini
2017-06-07 12:06:28 -07:00
committed by Chalard Jean
parent bff14ae56f
commit c3b640cf48
3 changed files with 14 additions and 6 deletions

View File

@@ -1125,6 +1125,7 @@ public class ConnectivityManager {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.LOCAL_MAC_ADDRESS)
public String getCaptivePortalServerUrl() {
try {
return mService.getCaptivePortalServerUrl();
@@ -2088,10 +2089,11 @@ public class ConnectivityManager {
* {@hide}
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
@RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)
public boolean isTetheringSupported() {
try {
return mService.isTetheringSupported();
String pkgName = mContext.getOpPackageName();
return mService.isTetheringSupported(pkgName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -2121,6 +2123,7 @@ public class ConnectivityManager {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)
public void startTethering(int type, boolean showProvisioningUi,
final OnStartTetheringCallback callback) {
startTethering(type, showProvisioningUi, callback, null);

View File

@@ -75,7 +75,7 @@ interface IConnectivityManager
int getLastTetherError(String iface);
boolean isTetheringSupported();
boolean isTetheringSupported(String callerPkg);
void startTethering(int type, in ResultReceiver receiver, boolean showProvisioningUi,
String callerPkg);