Only current IME and spell checker can access user dictionary

Change-Id: I6c5716d4d6ea9d5f55a71b6268d34f4faa3ac043
diff --git a/api/current.txt b/api/current.txt
index a19e3e9..f5d6e94 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -108,7 +108,6 @@
     field public static final java.lang.String READ_SMS = "android.permission.READ_SMS";
     field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
     field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
-    field public static final java.lang.String READ_USER_DICTIONARY = "android.permission.READ_USER_DICTIONARY";
     field public static final java.lang.String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";
     field public static final java.lang.String REBOOT = "android.permission.REBOOT";
     field public static final java.lang.String RECEIVE_BOOT_COMPLETED = "android.permission.RECEIVE_BOOT_COMPLETED";
@@ -153,7 +152,6 @@
     field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
     field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS";
     field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS";
-    field public static final java.lang.String WRITE_USER_DICTIONARY = "android.permission.WRITE_USER_DICTIONARY";
     field public static final java.lang.String WRITE_VOICEMAIL = "com.android.voicemail.permission.WRITE_VOICEMAIL";
   }
 
@@ -169,7 +167,6 @@
     field public static final java.lang.String SENSORS = "android.permission-group.SENSORS";
     field public static final java.lang.String SMS = "android.permission-group.SMS";
     field public static final java.lang.String STORAGE = "android.permission-group.STORAGE";
-    field public static final java.lang.String USER_DICTIONARY = "android.permission-group.USER_DICTIONARY";
   }
 
   public final class R {
diff --git a/api/system-current.txt b/api/system-current.txt
index d1d4fe4..9703dc7 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -160,7 +160,6 @@
     field public static final java.lang.String READ_SMS = "android.permission.READ_SMS";
     field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
     field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
-    field public static final java.lang.String READ_USER_DICTIONARY = "android.permission.READ_USER_DICTIONARY";
     field public static final java.lang.String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";
     field public static final java.lang.String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL";
     field public static final java.lang.String REAL_GET_TASKS = "android.permission.REAL_GET_TASKS";
@@ -228,7 +227,6 @@
     field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
     field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS";
     field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS";
-    field public static final java.lang.String WRITE_USER_DICTIONARY = "android.permission.WRITE_USER_DICTIONARY";
     field public static final java.lang.String WRITE_VOICEMAIL = "com.android.voicemail.permission.WRITE_VOICEMAIL";
   }
 
@@ -244,7 +242,6 @@
     field public static final java.lang.String SENSORS = "android.permission-group.SENSORS";
     field public static final java.lang.String SMS = "android.permission-group.SMS";
     field public static final java.lang.String STORAGE = "android.permission-group.STORAGE";
-    field public static final java.lang.String USER_DICTIONARY = "android.permission-group.USER_DICTIONARY";
   }
 
   public final class R {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index bb52609..9637cf5 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -714,6 +714,16 @@
         android:protectionLevel="normal"
         android:permissionFlags="hide"/>
 
+    <!-- @hide We need to keep this around for backwards compatibility -->
+    <permission android:name="android.permission.READ_USER_DICTIONARY"
+        android:protectionLevel="normal"
+        android:permissionFlags="hide"/>
+
+    <!-- @hide We need to keep this around for backwards compatibility -->
+    <permission android:name="android.permission.WRITE_USER_DICTIONARY"
+        android:protectionLevel="normal"
+        android:permissionFlags="hide"/>
+
     <!-- ====================================================================== -->
     <!-- INSTALL PERMISSIONS                                                    -->
     <!-- ====================================================================== -->
@@ -754,36 +764,6 @@
         android:protectionLevel="signature|system" />
 
     <!-- =============================================================== -->
-    <!-- Permissions for accessing the user dictionary-->
-    <!-- =============================================================== -->
-    <eat-comment />
-
-    <!-- Used for permissions that provide access to the user
-         calendar to create / view events.-->
-    <permission-group android:name="android.permission-group.USER_DICTIONARY"
-        android:label="@string/permgrouplab_dictionary"
-        android:icon="@drawable/perm_group_user_dictionary"
-        android:description="@string/permgroupdesc_dictionary"
-        android:permissionGroupFlags="personalInfo"
-        android:priority="1100" />
-
-    <!-- Allows an application to read the user dictionary. This should
-         really only be required by an IME, or a dictionary editor like
-         the Settings app. -->
-    <permission android:name="android.permission.READ_USER_DICTIONARY"
-        android:permissionGroup="android.permission-group.USER_DICTIONARY"
-        android:label="@string/permlab_readDictionary"
-        android:description="@string/permdesc_readDictionary"
-        android:protectionLevel="dangerous"/>
-
-    <!-- Allows an application to write to the user dictionary. -->
-    <permission android:name="android.permission.WRITE_USER_DICTIONARY"
-        android:permissionGroup="android.permission-group.USER_DICTIONARY"
-        android:label="@string/permlab_writeDictionary"
-        android:description="@string/permdesc_writeDictionary"
-        android:protectionLevel="normal"/>
-
-    <!-- =============================================================== -->
     <!-- Permissions for setting the device alarm                        -->
     <!-- =============================================================== -->
     <eat-comment />
diff --git a/core/res/res/drawable-hdpi/perm_group_user_dictionary.png b/core/res/res/drawable-hdpi/perm_group_user_dictionary.png
deleted file mode 100644
index 62fbcdc..0000000
--- a/core/res/res/drawable-hdpi/perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_user_dictionary_write.png b/core/res/res/drawable-hdpi/perm_group_user_dictionary_write.png
deleted file mode 100644
index c62dd4c..0000000
--- a/core/res/res/drawable-hdpi/perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_user_dictionary.png b/core/res/res/drawable-mdpi/perm_group_user_dictionary.png
deleted file mode 100644
index a303dc1..0000000
--- a/core/res/res/drawable-mdpi/perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_user_dictionary_write.png b/core/res/res/drawable-mdpi/perm_group_user_dictionary_write.png
deleted file mode 100644
index 2fc4056..0000000
--- a/core/res/res/drawable-mdpi/perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_user_dictionary.png b/core/res/res/drawable-xhdpi/perm_group_user_dictionary.png
deleted file mode 100644
index 35d7d5f..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_user_dictionary_write.png b/core/res/res/drawable-xhdpi/perm_group_user_dictionary_write.png
deleted file mode 100644
index 74e25ac..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary.png b/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary.png
deleted file mode 100644
index 8c2cd17..0000000
--- a/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary_write.png b/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary_write.png
deleted file mode 100644
index 121d6cf..0000000
--- a/core/res/res/drawable-xxhdpi/ic_perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_user_dictionary.png b/core/res/res/drawable-xxhdpi/perm_group_user_dictionary.png
deleted file mode 100644
index 5b6ea3b..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_user_dictionary_write.png b/core/res/res/drawable-xxhdpi/perm_group_user_dictionary_write.png
deleted file mode 100644
index d92e719..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary.png b/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary.png
deleted file mode 100644
index 32942ca..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary_write.png b/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary_write.png
deleted file mode 100644
index 343551f..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_user_dictionary_write.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 0e5df50..246e43a33 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -568,16 +568,6 @@
     <!-- 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_storage">access photos, media, and files on your device</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_dictionary">User Dictionary</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_dictionary">Read or write words in user dictionary.</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_bookmarks">Bookmarks and History</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_bookmarks">Direct access to bookmarks and browser history.</string>
-
     <!-- Title of a category of application permissioncds, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permgrouplab_microphone">Microphone</string>
     <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
@@ -1246,18 +1236,6 @@
     <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permdesc_readSyncStats">Allows an app to read the sync stats for an account, including the history of sync events and how much data is synced. </string>
 
-    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
-    <string name="permlab_readDictionary">read terms you added to the dictionary</string>
-    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
-    <string name="permdesc_readDictionary">Allows the app to read all words,
-       names and phrases that the user may have stored in the user dictionary.</string>
-
-    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
-    <string name="permlab_writeDictionary">add words to user-defined dictionary</string>
-    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
-    <string name="permdesc_writeDictionary">Allows the app to write new words into the
-      user dictionary.</string>
-
     <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
     <string name="permlab_sdcardRead" product="nosdcard">read the contents of your USB storage</string>
     <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
diff --git a/docs/html/about/versions/android-4.1.jd b/docs/html/about/versions/android-4.1.jd
index 76b90ac..f8770fa 100644
--- a/docs/html/about/versions/android-4.1.jd
+++ b/docs/html/about/versions/android-4.1.jd
@@ -871,7 +871,7 @@
 automatically get read access as well.  There is a new developer option to turn on read access
 restriction, for developers to test their applications against how Android will behave in the
 future.</dd>
-  <dt>{@link android.Manifest.permission#READ_USER_DICTIONARY}</dt>
+  <dt>android.Manifest.permission.READ_USER_DICTIONARY</dt>
     <dd>Allows an application to read the user dictionary. This should only be required by an
 IME, or a dictionary editor like the Settings app.</dd>
   <dt>{@link android.Manifest.permission#READ_CALL_LOG}</dt>
@@ -879,7 +879,7 @@
       incoming and outgoing calls.</dd>
   <dt>{@link android.Manifest.permission#WRITE_CALL_LOG}</dt>
     <dd>Allows an application to modify the system's call log stored on your phone</dd>
-  <dt>{@link android.Manifest.permission#WRITE_USER_DICTIONARY}</dt>
+  <dt>android.Manifest.permission.WRITE_USER_DICTIONARY</dt>
     <dd>Allows an application to write to the user's word dictionary.</dd>
 </dl>