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

Commit e4de4914 authored by Todd Kennedy's avatar Todd Kennedy Committed by Android (Google) Code Review
Browse files

Merge "Only log resolution when starting activities" into oc-mr1-dev

parents e3911753 6ebabca5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -38,14 +38,18 @@ public final class InstantAppRequest {
     * Optional extra bundle provided by the source application to the installer for additional
     * verification. */
    public final Bundle verificationBundle;
    /** Whether resolution occurs because an application is starting */
    public final boolean resolveForStart;

    public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent,
            String resolvedType, String callingPackage, int userId, Bundle verificationBundle) {
            String resolvedType, String callingPackage, int userId, Bundle verificationBundle,
            boolean resolveForStart) {
        this.responseObj = responseObj;
        this.origIntent = origIntent;
        this.resolvedType = resolvedType;
        this.callingPackage = callingPackage;
        this.userId = userId;
        this.verificationBundle = verificationBundle;
        this.resolveForStart = resolveForStart;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ public abstract class InstantAppResolver {
            }
        }
        // Only log successful instant application resolution
        if (resolutionStatus == RESOLUTION_SUCCESS) {
        if (requestObj.resolveForStart && resolutionStatus == RESOLUTION_SUCCESS) {
            logMetrics(ACTION_INSTANT_APP_RESOLUTION_PHASE_ONE, startTime, token,
                    resolutionStatus);
        }
+6 −4
Original line number Diff line number Diff line
@@ -6778,7 +6778,7 @@ public class PackageManagerService extends IPackageManager.Stub
            Bundle verificationBundle, int userId) {
        final Message msg = mHandler.obtainMessage(INSTANT_APP_RESOLUTION_PHASE_TWO,
                new InstantAppRequest(responseObj, origIntent, resolvedType,
                        callingPackage, userId, verificationBundle));
                        callingPackage, userId, verificationBundle, false /*resolveForStart*/));
        mHandler.sendMessage(msg);
    }
@@ -7362,7 +7362,8 @@ public class PackageManagerService extends IPackageManager.Stub
            }
        }
        if (addEphemeral) {
            result = maybeAddInstantAppInstaller(result, intent, resolvedType, flags, userId);
            result = maybeAddInstantAppInstaller(
                    result, intent, resolvedType, flags, userId, resolveForStart);
        }
        if (sortResult) {
            Collections.sort(result, mResolvePrioritySorter);
@@ -7372,7 +7373,7 @@ public class PackageManagerService extends IPackageManager.Stub
    }
    private List<ResolveInfo> maybeAddInstantAppInstaller(List<ResolveInfo> result, Intent intent,
            String resolvedType, int flags, int userId) {
            String resolvedType, int flags, int userId, boolean resolveForStart) {
        // first, check to see if we've got an instant app already installed
        final boolean alreadyResolvedLocally = (flags & PackageManager.MATCH_INSTANT) != 0;
        ResolveInfo localInstantApp = null;
@@ -7421,7 +7422,8 @@ public class PackageManagerService extends IPackageManager.Stub
                Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral");
                final InstantAppRequest requestObject = new InstantAppRequest(
                        null /*responseObj*/, intent /*origIntent*/, resolvedType,
                        null /*callingPackage*/, userId, null /*verificationBundle*/);
                        null /*callingPackage*/, userId, null /*verificationBundle*/,
                        resolveForStart);
                auxiliaryResponse =
                        InstantAppResolver.doInstantAppResolutionPhaseOne(
                                mContext, mInstantAppResolverConnection, requestObject);