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

Commit 6d5db5e3 authored by Kishore Srivenkata Ganesh Bolisetty's avatar Kishore Srivenkata Ganesh Bolisetty Committed by Linux Build Service Account
Browse files

frameworks/base: add app launch timeline instrumentation

Displayed Activity is often being used to measure application
launch times. However Displayed Activity only accounts for a
subset of the app launch. This additional instrumentation will
allow for more accurate measurements of applications launch
times.

ActivityManager: Update timeline debug statements
Update the timeline debug messages so that
'ActivityManager' is not used as the tag in log
messages as it interferes with some CTS tests.
CRs-fixed: 628703

This commit combines the changes from KK gerrit 668250 & 543988

Change-Id: I0af42520dc30d89a910e60aebdddf0c4fdd32b3e
parent 1fca0e71
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.StrictMode;
import android.service.voice.IVoiceInteractionSession;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.util.Singleton;
@@ -2355,6 +2356,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM

class ActivityManagerProxy implements IActivityManager
{
    static final String TAG_TIMELINE = "Timeline";
    public ActivityManagerProxy(IBinder remote)
    {
        mRemote = remote;
@@ -2370,6 +2372,13 @@ class ActivityManagerProxy implements IActivityManager
            int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();

        if (intent.getComponent() != null) {
            Log.i(TAG_TIMELINE, "Timeline: Activity_launch_request id:"
                + intent.getComponent().getPackageName() + " time:"
                + SystemClock.uptimeMillis());
        }

        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(caller != null ? caller.asBinder() : null);
        data.writeString(callingPackage);
@@ -2836,6 +2845,8 @@ class ActivityManagerProxy implements IActivityManager
    public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
            throws RemoteException
    {
        Log.i(TAG_TIMELINE, "Timeline: Activity_idle id: " + token + " time:"
             + SystemClock.uptimeMillis());
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
+3 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import org.codeaurora.Performance;
 */
final class ActivityRecord {
    static final String TAG = ActivityManagerService.TAG;
    static final String TAG_TIMELINE = "Timeline";
    static final boolean DEBUG_SAVED_STATE = ActivityStackSupervisor.DEBUG_SAVED_STATE;
    final public static String RECENTS_PACKAGE_NAME = "com.android.systemui.recent";

@@ -974,6 +975,8 @@ final class ActivityRecord {
                service.scheduleAppGcsLocked();
            }
        }
        Log.i(TAG_TIMELINE, "Timeline: Activity_windows_visible id: "
            + this + " time:" + SystemClock.uptimeMillis());
    }

    public void windowsGone() {