Permalink
Browse files

Renamed permission READ_WRITE_OWN_VOICEMAIL to ADD_VOICEMAIL

The framework changes to add new permission ADD_VOICEMAIL went in
change-Id: I515e7967bdb0e8498a60a32983f9122ce10dcc4a.
And the contacts app to start using the new permission went in
change-id: I188a109b69228e58a2c9b1d9a234a270df60555a

Bug: 5098551
  • Loading branch information...
1 parent 61db4f7 commit 98a77ec8057c5fe0ff487ca7d0910312693e5689 Debashish Chatterjee committed Aug 3, 2011
View
@@ -55,7 +55,7 @@
<provider android:name="VoicemailContentProvider"
android:authorities="com.android.voicemail"
android:syncable="false" android:multiprocess="false"
- android:permission="com.android.voicemail.permission.READ_WRITE_OWN_VOICEMAIL">
+ android:permission="com.android.voicemail.permission.ADD_VOICEMAIL">
</provider>
<!-- TODO: create permissions for social data -->
@@ -17,7 +17,7 @@
package com.android.providers.contacts;
-import static android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL;
+import static android.Manifest.permission.ADD_VOICEMAIL;
import static com.android.providers.contacts.Manifest.permission.READ_WRITE_ALL_VOICEMAIL;
import com.android.providers.contacts.ContactsDatabaseHelper.Tables;
@@ -197,7 +197,7 @@ private void notifyChange(Uri notificationUri, Set<String> modifiedPackages,
callingPackages.contains(component.getPackageName()));
}
String permissionNeeded = modifiedPackages.contains(component.getPackageName()) ?
- READ_WRITE_OWN_VOICEMAIL : READ_WRITE_ALL_VOICEMAIL;
+ ADD_VOICEMAIL : READ_WRITE_ALL_VOICEMAIL;
mContext.sendBroadcast(intent, permissionNeeded);
Log.v(TAG, String.format("Sent intent. act:%s, url:%s, comp:%s, perm:%s," +
" self_change:%s", intent.getAction(), intent.getData(),
@@ -297,7 +297,7 @@ private final void checkPackagesMatch(String callingPackage, String voicemailSou
/**
* Checks that either the caller has READ_WRITE_ALL_VOICEMAIL permission, or has the
- * READ_WRITE_OWN_VOICEMAIL permission and is using a URI that matches
+ * ADD_VOICEMAIL permission and is using a URI that matches
* /voicemail/?source_package=[source-package] where [source-package] is the same as the calling
* package.
*
@@ -33,12 +33,12 @@ public VoicemailPermissions(Context context) {
/** Determines if the calling process has access to its own voicemails. */
public boolean callerHasOwnVoicemailAccess() {
- return callerHasPermission(android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL);
+ return callerHasPermission(android.Manifest.permission.ADD_VOICEMAIL);
}
/** Determines if the calling process has access to all voicemails. */
public boolean callerHasFullAccess() {
- return callerHasPermission(android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL) &&
+ return callerHasPermission(android.Manifest.permission.ADD_VOICEMAIL) &&
callerHasPermission(Manifest.permission.READ_WRITE_ALL_VOICEMAIL);
}
@@ -50,7 +50,7 @@ public boolean callerHasFullAccess() {
public void checkCallerHasOwnVoicemailAccess() {
if (!callerHasOwnVoicemailAccess()) {
throw new SecurityException("The caller must have permission: " +
- android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL);
+ android.Manifest.permission.ADD_VOICEMAIL);
}
}
@@ -62,21 +62,21 @@ public void checkCallerHasOwnVoicemailAccess() {
public void checkCallerHasFullAccess() {
if (!callerHasFullAccess()) {
throw new SecurityException(String.format("The caller must have permissions %s AND %s",
- android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL,
+ android.Manifest.permission.ADD_VOICEMAIL,
Manifest.permission.READ_WRITE_ALL_VOICEMAIL));
}
}
/** Determines if the given package has access to its own voicemails. */
public boolean packageHasOwnVoicemailAccess(String packageName) {
return packageHasPermission(packageName,
- android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL);
+ android.Manifest.permission.ADD_VOICEMAIL);
}
/** Determines if the given package has full access. */
public boolean packageHasFullAccess(String packageName) {
return packageHasPermission(
- packageName, android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL) &&
+ packageName, android.Manifest.permission.ADD_VOICEMAIL) &&
packageHasPermission(packageName, Manifest.permission.READ_WRITE_ALL_VOICEMAIL);
}

0 comments on commit 98a77ec

Please sign in to comment.