Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在android中添加新组权限_Android_Android Permissions_Android Source_Cts_Android Cts - Fatal编程技术网

无法在android中添加新组权限

无法在android中添加新组权限,android,android-permissions,android-source,cts,android-cts,Android,Android Permissions,Android Source,Cts,Android Cts,我正在尝试在Android中添加一个新的组权限,但它在我的应用程序中没有生效(新CTS测试)。以下是变化: test@test-ubuntu:~/android_aosp/system/core$ git diff diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index d2193b7..7725126 100644 --- a/inc

我正在尝试在Android中添加一个新的组权限,但它在我的应用程序中没有生效(新CTS测试)。以下是变化:

test@test-ubuntu:~/android_aosp/system/core$ git diff
diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h
index d2193b7..7725126 100644
--- a/include/private/android_filesystem_config.h
+++ b/include/private/android_filesystem_config.h
@@ -77,6 +77,7 @@
#define AID_SDCARD_ALL    1035  /* access all users external storage */
#define AID_LOGD          1036  /* log daemon */
#define AID_SHARED_RELRO  1037  /* creator of shared GNU RELRO files */
+#define AID_XYZ           1038  /* files which XYZ needs to access */

#define AID_SHELL         2000  /* adb and debug shell user */
#define AID_CACHE         2001  /* cache access */
@@ -189,6 +190,7 @@ static const struct android_id_info android_ids[] = {
     { "sdcard_all",    AID_SDCARD_ALL, },
     { "logd",          AID_LOGD, },
     { "shared_relro",  AID_SHARED_RELRO, },
+    { "xyz",           AID_XYZ, },

     { "shell",         AID_SHELL, },
     { "cache",         AID_CACHE, },
test@test-ubuntu:~/android_aosp/system/core$
test@test-ubuntu:~/android_aosp/system/core$ cd ../../frameworks/base/
test@test-ubuntu:~/android_aosp/frameworks/base$
test@test-ubuntu:~/android_aosp/frameworks/base$
test@test-ubuntu:~/android_aosp/frameworks/base$ git diff
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index d3d7559..2e5d8c24 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -109,6 +109,10 @@
         <group gid="media" />
     </permission>

+    <permission name="android.permission.XYZ" >
+        <group gid="xyz" />
+    </permission>
+
     <!-- ================================================================== -->
     <!-- ================================================================== -->
     <!-- ================================================================== -->
test@test-ubuntu:~/android_aosp/frameworks/base$
test@test-ubuntu:~/android_aosp/frameworks/base$ cd ../../cts/tests/tests/newCtsTest/
test@test-ubuntu:~/android_aosp/cts/tests/tests/newCtsTest$
test@test-ubuntu:~/android_aosp/cts/tests/tests/newCtsTest$ git diff .
diff --git a/tests/tests/newCtsTest/AndroidManifest.xml b/tests/tests/newCtsTest/AndroidManifest.xml
index 52a0332..9dc3b1b 100755
--- a/tests/tests/newCtsTest/AndroidManifest.xml
+++ b/tests/tests/newCtsTest/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.newCtsTest.cts">

     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+    <uses-permission android:name="android.permission.XYZ" />
+
     <application>
         <uses-library android:name="android.test.runner" />
         <activity android:name="android.newCtsTest.SampleDeviceActivity" >
test@test-ubuntu:~/android_aosp/cts/tests/tests/newCtsTest$

注:上述文件的权限为664。如果我将其更改为666,那么代码本身就不会有任何问题,但不知何故,组权限没有应用到应用程序中,我能够解决这个问题。必须在
frameworks/base/core/res/AndroidManifest.xml
中进行其他更改:

test@test-ubuntu:~/android_aosp/frameworks/base$ git diff core/res/AndroidManifest.xml
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 4b1c534..a4ba0b5 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1054,6 +1054,12 @@
     <permission android:name="android.permission.BLUETOOTH_STACK"
         android:protectionLevel="signature" />

+    <!-- Allows applications to access files in xyz group.
+         <p>Protection level: normal
+    -->
+    <permission android:name="android.permission.XYZ"
+        android:protectionLevel="normal" />
+
     <!-- Allows applications to perform I/O operations over NFC.
          <p>Protection level: normal
     -->
test@test-ubuntu:~/android\u aosp/frameworks/base$git diff core/res/AndroidManifest.xml
diff——git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
索引4b1c534..a4ba0b5 100644
---a/core/res/AndroidManifest.xml
+++b/core/res/AndroidManifest.xml
@@ -1054,6 +1054,12 @@
+    
+    
+
之后,需要执行
生成更新api
,然后再次构建完整的Android

test@test-ubuntu:~/android_aosp/frameworks/base$ git diff core/res/AndroidManifest.xml
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 4b1c534..a4ba0b5 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1054,6 +1054,12 @@
     <permission android:name="android.permission.BLUETOOTH_STACK"
         android:protectionLevel="signature" />

+    <!-- Allows applications to access files in xyz group.
+         <p>Protection level: normal
+    -->
+    <permission android:name="android.permission.XYZ"
+        android:protectionLevel="normal" />
+
     <!-- Allows applications to perform I/O operations over NFC.
          <p>Protection level: normal
     -->