summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2010-03-11 15:30:02 -0800
committerRomain Guy <romainguy@android.com>2010-03-11 15:30:02 -0800
commitff3e61c6d5de339300d26227b69bfd9ee0827103 (patch)
tree63398503885803b1ef6cf4edc195dc0ca507acc8 /services
parentb51132cb4f262e48c35f012d0aa45237a2f97f13 (diff)
downloadframeworks_base-ff3e61c6d5de339300d26227b69bfd9ee0827103.zip
frameworks_base-ff3e61c6d5de339300d26227b69bfd9ee0827103.tar.gz
frameworks_base-ff3e61c6d5de339300d26227b69bfd9ee0827103.tar.bz2
Support old/new package names for widgets.
Change-Id: I134c4e694e66aaea47ad7da83d37b6621f4a527a
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/AppWidgetService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index 5de68f9..7350213 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -935,6 +935,16 @@ class AppWidgetService extends IAppWidgetService.Stub
// as before?
String pkg = parser.getAttributeValue(null, "pkg");
String cl = parser.getAttributeValue(null, "cl");
+
+ final PackageManager packageManager = mContext.getPackageManager();
+ try {
+ packageManager.getReceiverInfo(new ComponentName(pkg, cl), 0);
+ } catch (PackageManager.NameNotFoundException e) {
+ String[] pkgs = packageManager.currentToCanonicalPackageNames(
+ new String[] { pkg });
+ pkg = pkgs[0];
+ }
+
Provider p = lookupProviderLocked(new ComponentName(pkg, cl));
if (p == null && mSafeMode) {
// if we're in safe mode, make a temporary one