diff options
| author | Chiao Cheng <chiaocheng@google.com> | 2012-08-17 16:59:12 -0700 |
|---|---|---|
| committer | Chiao Cheng <chiaocheng@google.com> | 2012-08-21 13:31:19 -0700 |
| commit | 94b10b530c0fc297e2974e57e094c500d3ee6003 (patch) | |
| tree | b74d663c2663b5db2f6da888081648ce054480f5 /src/com/android/dialer/calllog/CallLogReceiver.java | |
| parent | dab5cd8890c0d0ca9001a13c2197114a4002338a (diff) | |
| download | packages_apps_Dialer-94b10b530c0fc297e2974e57e094c500d3ee6003.tar.gz packages_apps_Dialer-94b10b530c0fc297e2974e57e094c500d3ee6003.tar.bz2 packages_apps_Dialer-94b10b530c0fc297e2974e57e094c500d3ee6003.zip | |
Initial move of dialer features from contacts app.
Bug: 6993891
Change-Id: I758ce359ca7e87a1d184303822979318be171921
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogReceiver.java')
| -rw-r--r-- | src/com/android/dialer/calllog/CallLogReceiver.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/com/android/dialer/calllog/CallLogReceiver.java b/src/com/android/dialer/calllog/CallLogReceiver.java new file mode 100644 index 000000000..97d2951c1 --- /dev/null +++ b/src/com/android/dialer/calllog/CallLogReceiver.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.calllog; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.provider.VoicemailContract; +import android.util.Log; + +/** + * Receiver for call log events. + * <p> + * It is currently used to handle {@link VoicemailContract#ACTION_NEW_VOICEMAIL} and + * {@link Intent#ACTION_BOOT_COMPLETED}. + */ +public class CallLogReceiver extends BroadcastReceiver { + private static final String TAG = "CallLogReceiver"; + + @Override + public void onReceive(Context context, Intent intent) { + if (VoicemailContract.ACTION_NEW_VOICEMAIL.equals(intent.getAction())) { + Intent serviceIntent = new Intent(context, CallLogNotificationsService.class); + serviceIntent.setAction(CallLogNotificationsService.ACTION_UPDATE_NOTIFICATIONS); + serviceIntent.putExtra( + CallLogNotificationsService.EXTRA_NEW_VOICEMAIL_URI, intent.getData()); + context.startService(serviceIntent); + } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + Intent serviceIntent = new Intent(context, CallLogNotificationsService.class); + serviceIntent.setAction(CallLogNotificationsService.ACTION_UPDATE_NOTIFICATIONS); + context.startService(serviceIntent); + } else { + Log.w(TAG, "onReceive: could not handle: " + intent); + } + } +} |
