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

Commit 3326b3f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make sure apps cannot forge package name on AssistStructure used for Autofill."

parents d8dd05e7 3f3fa1b5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2139,6 +2139,16 @@ public class AssistStructure implements Parcelable {
        return mActivityComponent;
    }

    /**
     * Called by Autofill server when app forged a different value.
     *
     * @hide
     */
    public void setActivityComponent(ComponentName componentName) {
        ensureData();
        mActivityComponent = componentName;
    }

    /** @hide */
    public int getFlags() {
        return mFlags;
+5 −0
Original line number Diff line number Diff line
@@ -236,6 +236,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                structure.ensureData();

                // Sanitize structure before it's sent to service.
                if (!mComponentName.equals(structure.getActivityComponent())) {
                    Slog.w(TAG, "Activity " + mComponentName + " forged different component on "
                            + "AssistStructure: " + structure.getActivityComponent());
                    structure.setActivityComponent(mComponentName);
                }
                structure.sanitizeForParceling(true);

                // Flags used to start the session.