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

Commit afef60aa authored by Anushree Ganjam's avatar Anushree Ganjam
Browse files

Generate TargetId for Toast Session logging when Toast surface is visible and invisible

Bug: 264923689
Test: manual
Change-Id: Ibdb6c7e0bb523d77a1ed116b32fd167f7cea0c8e
parent 310023d7
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -107,4 +107,19 @@ public class SearchTargetEventHelper {
    public static String generatePlayTargetIdForLogging(String appPackage) {
        return "PLAY" + ":" + Process.myUserHandle().getIdentifier() + ":" + appPackage + ":Gms";
    }

    /**
     * Generate target id similar to AiAi targetId for logging Toast session based on surface
     * visible and invisible.
     * AiAi target id is of format "resultType:userId:packageName:extraInfo"
     *
     * @return string TargetId for Toast session
     * Example of Toast session target Id
     * targetId=SESSION_INFO:0:toast:SURFACE_VISIBLE
     * targetId=SESSION_INFO:0:toast:SURFACE_INVISIBLE
     */
    public static String generateToastSessionTargetIdForLogging(String surfaceVisibility) {
        return "SESSION_INFO:" + Process.myUserHandle().getIdentifier()
                + ":toast:" + surfaceVisibility;
    }
}