Merge "Add permission check for CaptivePortal#reevaluateNetwork"
This commit is contained in:
commit
d0f3cb625e
2 changed files with 3 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue