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

Commit c1011c1d authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "Fix security issue in bindRemoteViewsService"

parents d618555e 1c5bffbf
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -843,6 +843,15 @@ class AppWidgetServiceImpl {
                throw new IllegalArgumentException("Unknown component " + componentName);
            }

            // Ensure that the service specified by the passed intent belongs to the same package
            // as provides the passed widget id.
            String widgetIdPackage = id.provider.info.provider.getPackageName();
            String servicePackage = componentName.getPackageName();
            if (!servicePackage.equals(widgetIdPackage)) {
                throw new SecurityException("Specified intent doesn't belong to the same package"
                        + " as the provided AppWidget id");
            }

            // If there is already a connection made for this service intent, then disconnect from
            // that first. (This does not allow multiple connections to the same service under
            // the same key)