mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-07-24 23:25:34 -04:00
20.0: Network & Sensors permission from GrapheneOS
This revokes the permissions to all user installed apps on update. Likely an expected quirk of being on 20.0 without the permission. 19.1 upgrades and new 20.0 installs should be fine. TODO: update 19.1 with the SpecialRuntimePermAppUtils too Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
cdca2c032e
commit
0c4db149e1
33 changed files with 2211 additions and 65 deletions
|
@ -1,48 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
||||
Date: Fri, 29 Jul 2022 20:45:30 +0300
|
||||
Subject: [PATCH] bugfix: reportNetworkConnectivity() wasn't switched to
|
||||
isInternetCompatEnabled()
|
||||
|
||||
---
|
||||
framework/src/android/net/ConnectivityManager.java | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java
|
||||
index 8857b7996..0fa34a46b 100644
|
||||
--- a/framework/src/android/net/ConnectivityManager.java
|
||||
+++ b/framework/src/android/net/ConnectivityManager.java
|
||||
@@ -25,7 +25,6 @@ import static android.net.NetworkRequest.Type.TRACK_DEFAULT;
|
||||
import static android.net.NetworkRequest.Type.TRACK_SYSTEM_DEFAULT;
|
||||
import static android.net.QosCallback.QosCallbackRegistrationException;
|
||||
|
||||
-import android.Manifest;
|
||||
import android.annotation.CallbackExecutor;
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
@@ -43,7 +42,7 @@ import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
-import android.content.pm.PackageManager;
|
||||
+import android.content.pm.SpecialRuntimePermAppUtils;
|
||||
import android.net.ConnectivityDiagnosticsManager.DataStallReport.DetectionMethod;
|
||||
import android.net.IpSecManager.UdpEncapsulationSocket;
|
||||
import android.net.SocketKeepalive.Callback;
|
||||
@@ -3141,12 +3140,12 @@ public class ConnectivityManager {
|
||||
*/
|
||||
public void reportNetworkConnectivity(@Nullable Network network, boolean hasConnectivity) {
|
||||
printStackTrace();
|
||||
- if (mContext.checkSelfPermission(Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED) {
|
||||
- // ConnectivityService enforces this by throwing an unexpected SecurityException,
|
||||
- // which puts GMS into a crash loop. Also useful for other apps that don't expect that
|
||||
- // INTERNET permission might get revoked.
|
||||
+
|
||||
+ if (SpecialRuntimePermAppUtils.isInternetCompatEnabled()) {
|
||||
+ // caller doesn't have INTERNET, but expects to always have it
|
||||
return;
|
||||
}
|
||||
+
|
||||
try {
|
||||
mService.reportNetworkConnectivity(network, hasConnectivity);
|
||||
} catch (RemoteException e) {
|
Loading…
Add table
Add a link
Reference in a new issue