mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-15 02:44:23 -05:00
82 lines
4.4 KiB
Diff
82 lines
4.4 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Daniel Micay <danielmicay@gmail.com>
|
||
|
Date: Sun, 17 Mar 2019 17:59:15 +0200
|
||
|
Subject: [PATCH] make INTERNET into a special runtime permission
|
||
|
|
||
|
Ported from 12: a980a4c3d6b6906eb0ee5fb07ca4cf0bae052d00
|
||
|
---
|
||
|
core/api/current.txt | 1 +
|
||
|
core/res/AndroidManifest.xml | 10 +++++++++-
|
||
|
core/res/res/values/strings.xml | 5 +++++
|
||
|
.../pm/permission/PermissionManagerServiceImpl.java | 2 +-
|
||
|
4 files changed, 16 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/core/api/current.txt b/core/api/current.txt
|
||
|
index 9b5316fb79b5..ab1becbad01f 100644
|
||
|
--- a/core/api/current.txt
|
||
|
+++ b/core/api/current.txt
|
||
|
@@ -331,6 +331,7 @@ package android {
|
||
|
field public static final String LOCATION = "android.permission-group.LOCATION";
|
||
|
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
|
||
|
field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES";
|
||
|
+ field public static final String NETWORK = "android.permission-group.NETWORK";
|
||
|
field public static final String NOTIFICATIONS = "android.permission-group.NOTIFICATIONS";
|
||
|
field public static final String PHONE = "android.permission-group.PHONE";
|
||
|
field public static final String READ_MEDIA_AURAL = "android.permission-group.READ_MEDIA_AURAL";
|
||
|
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
|
||
|
index 22591641cc66..6536d86432b4 100644
|
||
|
--- a/core/res/AndroidManifest.xml
|
||
|
+++ b/core/res/AndroidManifest.xml
|
||
|
@@ -2054,13 +2054,21 @@
|
||
|
<!-- ======================================= -->
|
||
|
<eat-comment />
|
||
|
|
||
|
+ <!-- Network access -->
|
||
|
+ <permission-group android:name="android.permission-group.NETWORK"
|
||
|
+ android:icon="@drawable/perm_group_network"
|
||
|
+ android:label="@string/permgrouplab_network"
|
||
|
+ android:description="@string/permgroupdesc_network"
|
||
|
+ android:priority="900" />
|
||
|
+
|
||
|
<!-- Allows applications to open network sockets.
|
||
|
<p>Protection level: normal
|
||
|
-->
|
||
|
<permission android:name="android.permission.INTERNET"
|
||
|
+ android:permissionGroup="android.permission-group.UNDEFINED"
|
||
|
android:description="@string/permdesc_createNetworkSockets"
|
||
|
android:label="@string/permlab_createNetworkSockets"
|
||
|
- android:protectionLevel="normal|instant" />
|
||
|
+ android:protectionLevel="dangerous|instant" />
|
||
|
|
||
|
<!-- Allows applications to access information about networks.
|
||
|
<p>Protection level: normal
|
||
|
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
|
||
|
index 4596ca74bf8f..5fe90e5510f5 100644
|
||
|
--- a/core/res/res/values/strings.xml
|
||
|
+++ b/core/res/res/values/strings.xml
|
||
|
@@ -946,6 +946,11 @@
|
||
|
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE]-->
|
||
|
<string name="permgroupdesc_notifications">show notifications</string>
|
||
|
|
||
|
+ <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
|
||
|
+ <string name="permgrouplab_network">Network</string>
|
||
|
+ <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
|
||
|
+ <string name="permgroupdesc_network">access the network</string>
|
||
|
+
|
||
|
<!-- Title for the capability of an accessibility service to retrieve window content. -->
|
||
|
<string name="capability_title_canRetrieveWindowContent">Retrieve window content</string>
|
||
|
<!-- Description for the capability of an accessibility service to retrieve window content. -->
|
||
|
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
index 8c51fec86a46..ad63a2d19779 100644
|
||
|
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
@@ -2477,7 +2477,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
|
||
|
}
|
||
|
|
||
|
public static boolean isSpecialRuntimePermission(final String permission) {
|
||
|
- return false;
|
||
|
+ return Manifest.permission.INTERNET.equals(permission);
|
||
|
}
|
||
|
|
||
|
/**
|