diff options
Diffstat (limited to 'src/com/android/providers/contacts/VoicemailContentProvider.java')
-rw-r--r-- | src/com/android/providers/contacts/VoicemailContentProvider.java | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/com/android/providers/contacts/VoicemailContentProvider.java b/src/com/android/providers/contacts/VoicemailContentProvider.java index cbebb9c..e1f44ca 100644 --- a/src/com/android/providers/contacts/VoicemailContentProvider.java +++ b/src/com/android/providers/contacts/VoicemailContentProvider.java @@ -23,14 +23,9 @@ import com.android.providers.contacts.ContactsDatabaseHelper.Tables; import com.android.providers.contacts.util.SelectionBuilder; import com.android.providers.contacts.util.TypedUriMatcherImpl; -import android.content.ComponentName; import android.content.ContentProvider; -import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; -import android.content.Intent; -import android.content.pm.ActivityInfo; -import android.content.pm.ResolveInfo; import android.database.Cursor; import android.net.Uri; import android.os.Binder; @@ -40,7 +35,6 @@ import android.provider.VoicemailContract; import android.provider.VoicemailContract.Voicemails; import java.io.FileNotFoundException; -import java.util.ArrayList; import java.util.List; /** @@ -53,7 +47,6 @@ public class VoicemailContentProvider extends ContentProvider implements VoicemailTable.DelegateHelper { private static final String TAG = "VoicemailContentProvider"; - private ContentResolver mContentResolver; private VoicemailPermissions mVoicemailPermissions; private VoicemailTable.Delegate mVoicemailContentTable; private VoicemailTable.Delegate mVoicemailStatusTable; @@ -61,7 +54,6 @@ public class VoicemailContentProvider extends ContentProvider @Override public boolean onCreate() { Context context = context(); - mContentResolver = context.getContentResolver(); mVoicemailPermissions = new VoicemailPermissions(context); mVoicemailContentTable = new VoicemailContentTable(Tables.CALLS, context, getDatabaseHelper(context), this); @@ -91,12 +83,6 @@ public class VoicemailContentProvider extends ContentProvider } @Override - public int bulkInsert(Uri uri, ContentValues[] valuesArray) { - UriData uriData = checkPermissionsAndCreateUriData(uri, valuesArray); - return getTableDelegate(uriData).bulkInsert(uriData, valuesArray); - } - - @Override public Uri insert(Uri uri, ContentValues values) { UriData uriData = checkPermissionsAndCreateUriData(uri, values); return getTableDelegate(uriData).insert(uriData, values); @@ -234,35 +220,6 @@ public class VoicemailContentProvider extends ContentProvider @Override // VoicemailTable.DelegateHelper interface. - public void notifyChange(Uri notificationUri, String... intentActions) { - // Notify the observers. - mContentResolver.notifyChange(notificationUri, null, true); - String callingPackage = getCallingPackage(); - // Fire notification intents. - for (String intentAction : intentActions) { - // TODO: We can possibly be more intelligent here and send targeted intents based on - // what voicemail permission the package has. If possible, here is what we would like to - // do for a given broadcast intent - - // 1) Send it to all packages that have READ_WRITE_ALL_VOICEMAIL permission. - // 2) Send it to only the owner package that has just READ_WRITE_OWN_VOICEMAIL, if not - // already sent in (1). - for (ComponentName component : - getBroadcastReceiverComponents(intentAction, notificationUri)) { - Intent intent = new Intent(intentAction, notificationUri); - intent.setComponent(component); - // self_change extra should be included only for provider_changed events. - if (intentAction.equals(Intent.ACTION_PROVIDER_CHANGED)) { - intent.putExtra(VoicemailContract.EXTRA_SELF_CHANGE, - callingPackage.equals(component.getPackageName())); - } - context().sendBroadcast(intent, - android.Manifest.permission.READ_WRITE_OWN_VOICEMAIL); - } - } - } - - @Override - // VoicemailTable.DelegateHelper interface. public void checkAndAddSourcePackageIntoValues(UriData uriData, ContentValues values) { // If content values don't contain the provider, calculate the right provider to use. if (!values.containsKey(SOURCE_PACKAGE_FIELD)) { @@ -406,17 +363,4 @@ public class VoicemailContentProvider extends ContentProvider } return getEqualityClause(Voicemails.SOURCE_PACKAGE, getCallingPackage()); } - - /** Determines the components that can possibly receive the specified intent. */ - protected List<ComponentName> getBroadcastReceiverComponents(String intentAction, Uri uri) { - Intent intent = new Intent(intentAction, uri); - List<ComponentName> receiverComponents = new ArrayList<ComponentName>(); - // For broadcast receivers ResolveInfo.activityInfo is the one that is populated. - for (ResolveInfo resolveInfo : - context().getPackageManager().queryBroadcastReceivers(intent, 0)) { - ActivityInfo activityInfo = resolveInfo.activityInfo; - receiverComponents.add(new ComponentName(activityInfo.packageName, activityInfo.name)); - } - return receiverComponents; - } } |