2022-10-18 21:13:17 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
|
|
Date: Tue, 14 Dec 2021 18:17:11 +0200
|
|
|
|
Subject: [PATCH] skip reportNetworkConnectivity() when permission is revoked
|
|
|
|
|
|
|
|
---
|
|
|
|
framework/src/android/net/ConnectivityManager.java | 7 +++++++
|
|
|
|
1 file changed, 7 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java
|
2023-07-19 20:05:51 +00:00
|
|
|
index 0a05d4308..26c05c8ec 100644
|
2022-10-18 21:13:17 +00:00
|
|
|
--- a/framework/src/android/net/ConnectivityManager.java
|
|
|
|
+++ b/framework/src/android/net/ConnectivityManager.java
|
|
|
|
@@ -41,6 +41,7 @@ import android.compat.annotation.UnsupportedAppUsage;
|
|
|
|
import android.content.ComponentName;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
+import android.content.pm.SpecialRuntimePermAppUtils;
|
|
|
|
import android.net.ConnectivityDiagnosticsManager.DataStallReport.DetectionMethod;
|
|
|
|
import android.net.IpSecManager.UdpEncapsulationSocket;
|
|
|
|
import android.net.SocketKeepalive.Callback;
|
2023-07-19 20:05:51 +00:00
|
|
|
@@ -3406,6 +3407,12 @@ public class ConnectivityManager {
|
2022-10-18 21:13:17 +00:00
|
|
|
*/
|
|
|
|
public void reportNetworkConnectivity(@Nullable Network network, boolean hasConnectivity) {
|
|
|
|
printStackTrace();
|
|
|
|
+
|
|
|
|
+ if (SpecialRuntimePermAppUtils.isInternetCompatEnabled()) {
|
|
|
|
+ // caller doesn't have INTERNET, but expects to always have it
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
try {
|
|
|
|
mService.reportNetworkConnectivity(network, hasConnectivity);
|
|
|
|
} catch (RemoteException e) {
|