Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff3e61c6 authored by Romain Guy's avatar Romain Guy
Browse files

Support old/new package names for widgets.

Change-Id: I134c4e694e66aaea47ad7da83d37b6621f4a527a
parent b51132cb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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