Add permission check for CaptivePortal#reevaluateNetwork
CaptivePortal#reevaluateNetwork is added as a system API which
requires a proper permission check.
Bug: 148379628
Test: Manually check with captive portal
Test: atest FrameworksNetTests
Test: make test-api-stubs-docs-update-current-api \
system-api-stubs-docs-update-current-api
Change-Id: I3f974339d5bd53a6f6ecb0842c02a8264dc3a5f9
Merged-In: I559d42089aeb09801d14c251c5165fca793c3cb3
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -153,6 +154,7 @@ public class CaptivePortal implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@TestApi
|
@TestApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.NETWORK_STACK)
|
||||||
public void reevaluateNetwork() {
|
public void reevaluateNetwork() {
|
||||||
try {
|
try {
|
||||||
ICaptivePortal.Stub.asInterface(mBinder).appRequest(APP_REQUEST_REEVALUATION_REQUIRED);
|
ICaptivePortal.Stub.asInterface(mBinder).appRequest(APP_REQUEST_REEVALUATION_REQUIRED);
|
||||||
|
|||||||
@@ -3744,6 +3744,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
if (nm == null) return;
|
if (nm == null) return;
|
||||||
|
|
||||||
if (request == CaptivePortal.APP_REQUEST_REEVALUATION_REQUIRED) {
|
if (request == CaptivePortal.APP_REQUEST_REEVALUATION_REQUIRED) {
|
||||||
|
checkNetworkStackPermission();
|
||||||
nm.forceReevaluation(Binder.getCallingUid());
|
nm.forceReevaluation(Binder.getCallingUid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user