Merge "Add permission check for CaptivePortal#reevaluateNetwork" am: 4940da0b98 am: 8c5e78eae6
Change-Id: Iebeb70078906b5eb12b17ee14c8ac7ea749917b2
This commit is contained in:
@@ -4368,7 +4368,7 @@ package android.net {
|
||||
|
||||
public class CaptivePortal implements android.os.Parcelable {
|
||||
method public void logEvent(int, @NonNull String);
|
||||
method public void reevaluateNetwork();
|
||||
method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork();
|
||||
method public void useNetwork();
|
||||
field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64
|
||||
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
|
||||
|
||||
@@ -1398,7 +1398,7 @@ package android.net {
|
||||
|
||||
public class CaptivePortal implements android.os.Parcelable {
|
||||
method public void logEvent(int, @NonNull String);
|
||||
method public void reevaluateNetwork();
|
||||
method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork();
|
||||
method public void useNetwork();
|
||||
field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64
|
||||
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package android.net;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.IBinder;
|
||||
@@ -153,6 +154,7 @@ public class CaptivePortal implements Parcelable {
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
@RequiresPermission(android.Manifest.permission.NETWORK_STACK)
|
||||
public void reevaluateNetwork() {
|
||||
try {
|
||||
ICaptivePortal.Stub.asInterface(mBinder).appRequest(APP_REQUEST_REEVALUATION_REQUIRED);
|
||||
|
||||
@@ -3739,6 +3739,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
if (nm == null) return;
|
||||
|
||||
if (request == CaptivePortal.APP_REQUEST_REEVALUATION_REQUIRED) {
|
||||
checkNetworkStackPermission();
|
||||
nm.forceReevaluation(Binder.getCallingUid());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user