Jelajahi Sumber

add max SDK to permissions

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
tobiaskaminsky 7 tahun lalu
induk
melakukan
964faa54ec
1 mengubah file dengan 27 tambahan dan 14 penghapusan
  1. 27 14
      src/main/AndroidManifest.xml

+ 27 - 14
src/main/AndroidManifest.xml

@@ -21,29 +21,42 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.owncloud.android">
           package="com.owncloud.android">
 
 
-    <!-- GET_ACCOUNTS is needed for API < 23.
+    <!-- GET_ACCOUNTS is needed for API <= 22.
         For API >= 23 results in the addition of CONTACTS group to the list of permissions that may be
         For API >= 23 results in the addition of CONTACTS group to the list of permissions that may be
         dynamically disabled or enabled by the user after installation; but it is not important,
         dynamically disabled or enabled by the user after installation; but it is not important,
         since GET_ACCOUNTS is an special case, the permission is not really needed to access accounts
         since GET_ACCOUNTS is an special case, the permission is not really needed to access accounts
         owned by the app, our use case.
         owned by the app, our use case.
         See note in http://developer.android.com/intl/es/reference/android/Manifest.permission.html#GET_ACCOUNTS -->
         See note in http://developer.android.com/intl/es/reference/android/Manifest.permission.html#GET_ACCOUNTS -->
-    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
-
-    <uses-permission android:name="android.permission.READ_CONTACTS" />
-    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
-
-    <!-- USE_CREDENTIALS, MANAGE_ACCOUNTS and AUTHENTICATE_ACCOUNTS are needed for API < 23.
-        In API >= 23 the do not exist anymore -->
-    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
-    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
-    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.GET_ACCOUNTS" />
+
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.READ_CONTACTS" />
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.WRITE_CONTACTS" />
+
+    <!-- USE_CREDENTIALS, MANAGE_ACCOUNTS and AUTHENTICATE_ACCOUNTS are needed for API <= 22.
+        In API >= 23 they do not exist anymore -->
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.USE_CREDENTIALS" />
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.MANAGE_ACCOUNTS" />
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
 
 
     <!-- WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
     <!-- WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
         API >= 23; the app needs to handle this -->
         API >= 23; the app needs to handle this -->
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission
+        android:maxSdkVersion="22"
+        android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
 
-    <!-- Next permissions are always approved in installation time,
-        the apps needs to do nothing special in runtime -->
+    <!-- Next permissions are always approved in installation time, the apps needs to do nothing special in runtime -->
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.READ_SYNC_STATS" />
     <uses-permission android:name="android.permission.READ_SYNC_STATS" />
     <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
     <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />