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

Commit 05e552a6 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Support old/new package names for widgets."

parents 26b1ef95 ff3e61c6
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