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

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

Merge "Salt the package hash code using the device serial Bug: 62676166" into...

Merge "Salt the package hash code using the device serial Bug: 62676166" into ub-launcher3-dorval-polish
parents cbfdbeae e8ca2817
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.util.Log;
@@ -131,14 +132,20 @@ public class UserEventDispatcher {
        LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.TAP),
                newItemTarget(v), newTarget(Target.Type.CONTAINER));

        String serial;
        if (Utilities.isAtLeastO()) {
            serial = Build.getSerial();
        } else {
            serial = Build.SERIAL;
        }
        // TODO: make idx percolate up the view hierarchy if needed.
        int idx = 0;
        if (fillInLogContainerData(event, v)) {
            ItemInfo itemInfo = (ItemInfo) v.getTag();
            event.srcTarget[idx].intentHash = intentHashCode;
            if (cn != null) {
                event.srcTarget[idx].packageNameHash = cn.getPackageName().hashCode();
                event.srcTarget[idx].componentHash = cn.hashCode();
                event.srcTarget[idx].packageNameHash = (cn.getPackageName() + serial).hashCode();
                event.srcTarget[idx].componentHash = (cn.flattenToString() + serial).hashCode();
                if (mPredictedApps != null) {
                    event.srcTarget[idx].predictedRank = mPredictedApps.indexOf(
                            new ComponentKey(cn, itemInfo.user));