mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-08-22 18:25:54 +00:00
62 lines
3.0 KiB
Diff
62 lines
3.0 KiB
Diff
![]() |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Daniel Micay <danielmicay@gmail.com>
|
||
|
Date: Sat, 22 Jul 2017 21:43:50 -0400
|
||
|
Subject: [PATCH] always treat INTERNET as a runtime permission
|
||
|
|
||
|
---
|
||
|
.../permission/model/AppPermissionGroup.java | 5 +++--
|
||
|
.../packageinstaller/permission/model/Permission.java | 3 ++-
|
||
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
|
||
|
index da5277777..c9fa2ca3e 100644
|
||
|
--- a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
|
||
|
+++ b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
|
||
|
@@ -33,6 +33,7 @@ import android.content.pm.PackageManager;
|
||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||
|
import android.content.pm.PermissionGroupInfo;
|
||
|
import android.content.pm.PermissionInfo;
|
||
|
+import android.Manifest;
|
||
|
import android.os.Build;
|
||
|
import android.os.UserHandle;
|
||
|
import android.permission.PermissionManager;
|
||
|
@@ -785,7 +786,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
|
||
|
|
||
|
boolean wasGranted = permission.isGrantedIncludingAppOp();
|
||
|
|
||
|
- if (mAppSupportsRuntimePermissions) {
|
||
|
+ if (mAppSupportsRuntimePermissions || Manifest.permission.INTERNET.equals(permission.getName())) {
|
||
|
// Do not touch permissions fixed by the system.
|
||
|
if (permission.isSystemFixed()) {
|
||
|
wasAllGranted = false;
|
||
|
@@ -962,7 +963,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
- if (mAppSupportsRuntimePermissions) {
|
||
|
+ if (mAppSupportsRuntimePermissions || Manifest.permission.INTERNET.equals(permission.getName())) {
|
||
|
// Revoke the permission if needed.
|
||
|
if (permission.isGranted()) {
|
||
|
permission.setGranted(false);
|
||
|
diff --git a/src/com/android/packageinstaller/permission/model/Permission.java b/src/com/android/packageinstaller/permission/model/Permission.java
|
||
|
index 463c34795..c2ec88902 100644
|
||
|
--- a/src/com/android/packageinstaller/permission/model/Permission.java
|
||
|
+++ b/src/com/android/packageinstaller/permission/model/Permission.java
|
||
|
@@ -18,6 +18,7 @@ package com.android.packageinstaller.permission.model;
|
||
|
|
||
|
import android.content.pm.PackageManager;
|
||
|
import android.content.pm.PermissionInfo;
|
||
|
+import android.Manifest;
|
||
|
|
||
|
import androidx.annotation.NonNull;
|
||
|
|
||
|
@@ -136,7 +137,7 @@ public final class Permission {
|
||
|
* @return {@code true} if the permission (and the app-op) is granted.
|
||
|
*/
|
||
|
public boolean isGrantedIncludingAppOp() {
|
||
|
- return mGranted && (!affectsAppOp() || isAppOpAllowed()) && !isReviewRequired();
|
||
|
+ return mGranted && (!affectsAppOp() || isAppOpAllowed()) && (!isReviewRequired() || Manifest.permission.INTERNET.equals(mName));
|
||
|
}
|
||
|
|
||
|
public boolean isReviewRequired() {
|