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

Commit 8f4986ff authored by Holly Sun's avatar Holly Sun
Browse files

[play] Add generatePlayTargetIdForLogging.

Bug: 270187834
Test: manual
Change-Id: I7544d1cd31bc8b8a3bf59c1370e817546f10bfbb
parent 2e28f315
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -71,4 +71,16 @@ public class SearchTargetEventHelper {
        return appTargetId + appComponentName.getPackageName() + ":"
                + appComponentName.getClassName();
    }

    /**
     * Generate gms play target id similar to AiAi targetId for logging only n-state.
     * AiAi target id is of format "resultType:userId:packageName:extraInfo"
     *
     * @return string playTargetId
     * Example playTargetId for Candy Crush
     * PLAY:0:com.king.candycrushsaga:Gms
     */
    public static String generatePlayTargetIdForLogging(String appPackage) {
        return "PLAY" + ":" + Process.myUserHandle().getIdentifier() + ":" + appPackage + ":Gms";
    }
}