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

Commit b6242443 authored by Svetoslav's avatar Svetoslav
Browse files

Keep existing API behavior that regressed.

If RemoteViews get a null package in the constructor we are
using the context in which they are applied to obtain resources
during inflation. In such a case if we call the getPackage()
method we were getting null, i.e. the package passed in the
contructor, but now we are returning the package if the app
that created the remote views.

bug:17513823
Change-Id: I0c4a8953c8320469a9160dbaae46ce31465b313b
parent ddc5e5f1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1807,7 +1807,7 @@ public class RemoteViews implements Parcelable, Filter {
    }

    public String getPackage() {
        return mApplication.packageName;
        return (mApplication != null) ? mApplication.packageName : null;
    }

    /**
@@ -2663,6 +2663,10 @@ public class RemoteViews implements Parcelable, Filter {
    }

    private static ApplicationInfo getApplicationInfo(String packageName, int userId) {
        if (packageName == null) {
            return null;
        }

        // Get the application for the passed in package and user.
        Application application = ActivityThread.currentApplication();
        if (application == null) {