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

Commit 613ba2d2 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Support latency metrics for recents gesture

Accpet the event time from RecentsAnimation#startRecentsActivity.
Also remove unused method of recents animation in activity manager.

Bug: 169221287
Test: Enable statsd log: "adb shell cmd stats print-logs"
      Touch gesture navigation bar.
      adb logcat | grep statsd | grep "(48)"
      The line may contain 0x100000->4[I] 0x110000->20[I]
      that means 4=by recents and 20=latency 20ms.

Change-Id: Ia188a6a3b0dab9edaa0052df3b18508f8cc895d3
parent 4a681f2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ public class RecentsAnimationPerfTest extends WindowManagerPerfTestBase
            mMeasuredTimeNs = 0;

            final long startTime = SystemClock.elapsedRealtimeNanos();
            atm.startRecentsActivity(sRecentsIntent, null /* unused */, anim);
            atm.startRecentsActivity(sRecentsIntent, 0 /* eventTime */, anim);
            final long elapsedTimeNsOfStart = SystemClock.elapsedRealtimeNanos() - startTime;
            mMeasuredTimeNs += elapsedTimeNsOfStart;
            state.addExtraResult("start", elapsedTimeNsOfStart);
+1 −0
Original line number Diff line number Diff line
@@ -3777,6 +3777,7 @@ message AppStartOccurred {
        LAUNCHER = 1;
        NOTIFICATION = 2;
        LOCKSCREEN = 3;
        RECENTS_ANIMATION = 4;
    }
    // The type of the startup source.
    optional SourceType source_type = 16;
+2 −0
Original line number Diff line number Diff line
@@ -1910,6 +1910,8 @@ public class ActivityOptions {
        public static final int TYPE_NOTIFICATION = 2;
        /** Launched from lockscreen, including notification while the device is locked. */
        public static final int TYPE_LOCKSCREEN = 3;
        /** Launched from recents gesture handler. */
        public static final int TYPE_RECENTS_ANIMATION = 4;

        @IntDef(flag = true, prefix = { "TYPE_" }, value = {
                TYPE_LAUNCHER,
+0 −7
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.app.GrantedUriPermission;
import android.app.IApplicationThread;
import android.app.IActivityController;
import android.app.IAppTask;
import android.app.IAssistDataReceiver;
import android.app.IInstrumentationWatcher;
import android.app.IProcessObserver;
import android.app.IServiceConnection;
@@ -70,7 +69,6 @@ import android.os.RemoteCallback;
import android.os.StrictMode;
import android.os.WorkSource;
import android.service.voice.IVoiceInteractionSession;
import android.view.IRecentsAnimationRunner;
import android.view.RemoteAnimationDefinition;
import android.view.RemoteAnimationAdapter;
import com.android.internal.app.IVoiceInteractor;
@@ -470,11 +468,6 @@ interface IActivityManager {
    @UnsupportedAppUsage
    boolean isInLockTaskMode();
    @UnsupportedAppUsage
    void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
            in IRecentsAnimationRunner recentsAnimationRunner);
    @UnsupportedAppUsage
    void cancelRecentsAnimation(boolean restoreHomeStackPosition);
    @UnsupportedAppUsage
    int startActivityFromRecents(int taskId, in Bundle options);
    @UnsupportedAppUsage
    void startSystemLockTaskMode(int taskId);
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ interface IActivityTaskManager {
            in ProfilerInfo profilerInfo, in Bundle options, int userId);
    int startAssistantActivity(in String callingPackage, in String callingFeatureId, int callingPid,
            int callingUid, in Intent intent, in String resolvedType, in Bundle options, int userId);
    void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
    void startRecentsActivity(in Intent intent, in long eventTime,
            in IRecentsAnimationRunner recentsAnimationRunner);
    int startActivityFromRecents(int taskId, in Bundle options);
    int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
Loading