am 9dd94464: am 272a02df: am cbc60886: Merge "Remove unused CallerInfoCacheUpdateReceiver" into lmp-dev
* commit '9dd944644ac1dc540e51e4c562b5d051960fb2b9':
Remove unused CallerInfoCacheUpdateReceiver
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9a5a5b1..5e8d832 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -557,12 +557,6 @@
android:exported="false">
</activity>
- <receiver android:name="CallerInfoCacheUpdateReceiver">
- <intent-filter>
- <action android:name="com.android.phone.UPDATE_CALLER_INFO_CACHE" />
- </intent-filter>
- </receiver>
-
<!-- BroadcastReceiver for receiving Intents from Notification mechanism. -->
<receiver android:name="PhoneGlobals$NotificationBroadcastReceiver" android:exported="false">
<intent-filter>
diff --git a/src/com/android/phone/CallerInfoCache.java b/src/com/android/phone/CallerInfoCache.java
index 76f79af..644aa22 100644
--- a/src/com/android/phone/CallerInfoCache.java
+++ b/src/com/android/phone/CallerInfoCache.java
@@ -50,12 +50,6 @@
/** This must not be set to true when submitting changes. */
private static final boolean VDBG = false;
- /**
- * Interval used with {@link AlarmManager#setInexactRepeating(int, long, long, PendingIntent)},
- * which means the actually interval may not be very accurate.
- */
- private static final int CACHE_REFRESH_INTERVAL = 8 * 60 * 60 * 1000; // 8 hours in millis.
-
public static final int MESSAGE_UPDATE_CACHE = 0;
// Assuming DATA.DATA1 corresponds to Phone.NUMBER and SipAddress.ADDRESS, we just use
@@ -162,7 +156,6 @@
CallerInfoCache cache = new CallerInfoCache(context);
// The first cache should be available ASAP.
cache.startAsyncCache();
- cache.setRepeatingCacheUpdateAlarm();
return cache;
}
@@ -182,23 +175,6 @@
mCacheAsyncTask.acquireWakeLockAndExecute();
}
- /**
- * Set up periodic alarm for cache update.
- */
- private void setRepeatingCacheUpdateAlarm() {
- if (DBG) log("setRepeatingCacheUpdateAlarm");
-
- Intent intent = new Intent(CallerInfoCacheUpdateReceiver.ACTION_UPDATE_CALLER_INFO_CACHE);
- intent.setClass(mContext, CallerInfoCacheUpdateReceiver.class);
- PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
- AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
- // We don't need precise timer while this should be power efficient.
- alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME,
- SystemClock.uptimeMillis() + CACHE_REFRESH_INTERVAL,
- CACHE_REFRESH_INTERVAL, pendingIntent);
- }
-
private void refreshCacheEntry() {
if (VDBG) log("refreshCacheEntry() started");
diff --git a/src/com/android/phone/CallerInfoCacheUpdateReceiver.java b/src/com/android/phone/CallerInfoCacheUpdateReceiver.java
deleted file mode 100644
index c0a2d83..0000000
--- a/src/com/android/phone/CallerInfoCacheUpdateReceiver.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2012 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.phone;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.SystemProperties;
-import android.util.Log;
-
-/**
- * BroadcastReceiver responsible for (periodic) update of {@link CallerInfoCache}.
- *
- * This broadcast can be sent from Contacts edit screen, implying relevant settings have changed
- * and the cache may become obsolete.
- */
-public class CallerInfoCacheUpdateReceiver extends BroadcastReceiver {
- private static final String LOG_TAG = CallerInfoCacheUpdateReceiver.class.getSimpleName();
- private static final boolean DBG =
- (PhoneGlobals.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
-
- public static final String ACTION_UPDATE_CALLER_INFO_CACHE =
- "com.android.phone.UPDATE_CALLER_INFO_CACHE";
-
- @Override
- public void onReceive(Context context, Intent intent) {
- if (DBG) log("CallerInfoCacheUpdateReceiver#onReceive(). Intent: " + intent);
- PhoneGlobals.getInstance().callerInfoCache.startAsyncCache();
- }
-
- private static void log(String msg) {
- Log.d(LOG_TAG, msg);
- }
-}
\ No newline at end of file