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

Commit d136e77a authored by Jeff Chang's avatar Jeff Chang
Browse files

Convert EventLogTags.AM* events log points to EventLogTags.WM

Since all activity management is now under the WM package we should also
convert the event log points for activities from EventLogTags.AM* to
EventLogTags.WM*.

Bug: 143461660
Test: Build and run, check event logs.
Change-Id: I62034ee353f65ef95b069e1f36db214ccb3c6d85
parent 2c5887a4
Loading
Loading
Loading
Loading
+20 −26
Original line number Diff line number Diff line
@@ -769,17 +769,6 @@ public class Activity extends ContextThemeWrapper

    private static final String KEYBOARD_SHORTCUTS_RECEIVER_PKG_NAME = "com.android.systemui";

    private static final int LOG_AM_ON_CREATE_CALLED = 30057;
    private static final int LOG_AM_ON_START_CALLED = 30059;
    private static final int LOG_AM_ON_RESUME_CALLED = 30022;
    private static final int LOG_AM_ON_PAUSE_CALLED = 30021;
    private static final int LOG_AM_ON_STOP_CALLED = 30049;
    private static final int LOG_AM_ON_RESTART_CALLED = 30058;
    private static final int LOG_AM_ON_DESTROY_CALLED = 30060;
    private static final int LOG_AM_ON_ACTIVITY_RESULT_CALLED = 30062;
    private static final int LOG_AM_ON_TOP_RESUMED_GAINED_CALLED = 30064;
    private static final int LOG_AM_ON_TOP_RESUMED_LOST_CALLED = 30065;

    private static class ManagedDialog {
        Dialog mDialog;
        Bundle mArgs;
@@ -1863,8 +1852,13 @@ public class Activity extends ContextThemeWrapper
    final void performTopResumedActivityChanged(boolean isTopResumedActivity, String reason) {
        onTopResumedActivityChanged(isTopResumedActivity);

        writeEventLog(isTopResumedActivity
                ? LOG_AM_ON_TOP_RESUMED_GAINED_CALLED : LOG_AM_ON_TOP_RESUMED_LOST_CALLED, reason);
        if (isTopResumedActivity) {
            EventLogTags.writeWmOnTopResumedGainedCalled(mIdent, getComponentName().getClassName(),
                    reason);
        } else {
            EventLogTags.writeWmOnTopResumedLostCalled(mIdent, getComponentName().getClassName(),
                    reason);
        }
    }

    void setVoiceInteractor(IVoiceInteractor voiceInteractor) {
@@ -7898,7 +7892,8 @@ public class Activity extends ContextThemeWrapper
        } else {
            onCreate(icicle);
        }
        writeEventLog(LOG_AM_ON_CREATE_CALLED, "performCreate");
        EventLogTags.writeWmOnCreateCalled(mIdent, getComponentName().getClassName(),
                "performCreate");
        mActivityTransitionState.readState(icicle);

        mVisibleFromClient = !mWindow.getWindowStyle().getBoolean(
@@ -7920,7 +7915,7 @@ public class Activity extends ContextThemeWrapper
        mCalled = false;
        mFragments.execPendingActions();
        mInstrumentation.callActivityOnStart(this);
        writeEventLog(LOG_AM_ON_START_CALLED, reason);
        EventLogTags.writeWmOnStartCalled(mIdent, getComponentName().getClassName(), reason);

        if (!mCalled) {
            throw new SuperNotCalledException(
@@ -7998,7 +7993,7 @@ public class Activity extends ContextThemeWrapper

            mCalled = false;
            mInstrumentation.callActivityOnRestart(this);
            writeEventLog(LOG_AM_ON_RESTART_CALLED, reason);
            EventLogTags.writeWmOnRestartCalled(mIdent, getComponentName().getClassName(), reason);
            if (!mCalled) {
                throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() +
@@ -8031,7 +8026,7 @@ public class Activity extends ContextThemeWrapper
        mCalled = false;
        // mResumed is set by the instrumentation
        mInstrumentation.callActivityOnResume(this);
        writeEventLog(LOG_AM_ON_RESUME_CALLED, reason);
        EventLogTags.writeWmOnResumeCalled(mIdent, getComponentName().getClassName(), reason);
        if (!mCalled) {
            throw new SuperNotCalledException(
                "Activity " + mComponent.toShortString() +
@@ -8070,7 +8065,8 @@ public class Activity extends ContextThemeWrapper
        mFragments.dispatchPause();
        mCalled = false;
        onPause();
        writeEventLog(LOG_AM_ON_PAUSE_CALLED, "performPause");
        EventLogTags.writeWmOnPausedCalled(mIdent, getComponentName().getClassName(),
                "performPause");
        mResumed = false;
        if (!mCalled && getApplicationInfo().targetSdkVersion
                >= android.os.Build.VERSION_CODES.GINGERBREAD) {
@@ -8110,7 +8106,7 @@ public class Activity extends ContextThemeWrapper

            mCalled = false;
            mInstrumentation.callActivityOnStop(this);
            writeEventLog(LOG_AM_ON_STOP_CALLED, reason);
            EventLogTags.writeWmOnStopCalled(mIdent, getComponentName().getClassName(), reason);
            if (!mCalled) {
                throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() +
@@ -8140,7 +8136,8 @@ public class Activity extends ContextThemeWrapper
        mWindow.destroy();
        mFragments.dispatchDestroy();
        onDestroy();
        writeEventLog(LOG_AM_ON_DESTROY_CALLED, "performDestroy");
        EventLogTags.writeWmOnDestroyCalled(mIdent, getComponentName().getClassName(),
                "performDestroy");
        mFragments.doLoaderDestroy();
        if (mVoiceInteractor != null) {
            mVoiceInteractor.detachActivity();
@@ -8233,7 +8230,9 @@ public class Activity extends ContextThemeWrapper
                frag.onActivityResult(requestCode, resultCode, data);
            }
        }
        writeEventLog(LOG_AM_ON_ACTIVITY_RESULT_CALLED, reason);

        EventLogTags.writeWmOnActivityResultCalled(mIdent, getComponentName().getClassName(),
                reason);
    }

    /**
@@ -8660,11 +8659,6 @@ public class Activity extends ContextThemeWrapper
        }
    }

    /** Log a lifecycle event for current user id and component class. */
    private void writeEventLog(int event, String reason) {
        EventLog.writeEvent(event, mIdent, getComponentName().getClassName(), reason);
    }

    class HostCallbacks extends FragmentHostCallback<Activity> {
        public HostCallbacks() {
            super(Activity.this /*activity*/);
+36 −0
Original line number Diff line number Diff line
# See system/core/logcat/event.logtags for a description of the format of this file.

option java_package android.app

# Do not change these names without updating the checkin_events setting in
# google3/googledata/wireless/android/provisioning/gservices.config !!
#
# The activity's onPause has been called.
30021 wm_on_paused_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onResume has been called.
30022 wm_on_resume_called (Token|1|5),(Component Name|3),(Reason|3)

# Attempting to stop an activity
30048 wm_stop_activity (User|1|5),(Token|1|5),(Component Name|3)
# The activity's onStop has been called.
30049 wm_on_stop_called (Token|1|5),(Component Name|3),(Reason|3)

# The activity's onCreate has been called.
30057 wm_on_create_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onRestart has been called.
30058 wm_on_restart_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onStart has been called.
30059 wm_on_start_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onDestroy has been called.
30060 wm_on_destroy_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onActivityResult has been called.
30062 wm_on_activity_result_called (Token|1|5),(Component Name|3),(Reason|3)

# The activity's onTopResumedActivityChanged(true) has been called.
30064 wm_on_top_resumed_gained_called (Token|1|5),(Component Name|3),(Reason|3)
# The activity's onTopResumedActivityChanged(false) has been called.
30065 wm_on_top_resumed_lost_called (Token|1|5),(Component Name|3),(Reason|3)

# An activity been add into stopping list
30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3)
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ java_library_static {
        ":tethering-servicescore-srcs",
        "java/com/android/server/EventLogTags.logtags",
        "java/com/android/server/am/EventLogTags.logtags",
        "java/com/android/server/wm/EventLogTags.logtags",
        "java/com/android/server/policy/EventLogTags.logtags",
    ],

+0 −21
Original line number Diff line number Diff line
@@ -174,27 +174,6 @@ option java_package com.android.server
# Disk usage stats for verifying quota correctness
3121 pm_package_stats (manual_time|2|3),(quota_time|2|3),(manual_data|2|2),(quota_data|2|2),(manual_cache|2|2),(quota_cache|2|2)

# ---------------------------
# WindowManagerService.java
# ---------------------------
# Out of memory for surfaces.
31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3)
# Task created.
31001 wm_task_created (TaskId|1|5),(StackId|1|5)
# Task moved to top (1) or bottom (0).
31002 wm_task_moved (TaskId|1|5),(ToTop|1),(Index|1)
# Task removed with source explanation.
31003 wm_task_removed (TaskId|1|5),(Reason|3)
# Stack created.
31004 wm_stack_created (StackId|1|5)
# Home stack moved to top (1) or bottom (0).
31005 wm_home_stack_moved (ToTop|1)
# Stack removed.
31006 wm_stack_removed (StackId|1|5)
# bootanim finished:
31007 wm_boot_animation_done (time|2|3)


# ---------------------------
# InputMethodManagerService.java
# ---------------------------
+16 −14
Original line number Diff line number Diff line
@@ -2786,7 +2786,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                        int total = user + system + iowait + irq + softIrq + idle;
                        if (total == 0) total = 1;
                        EventLog.writeEvent(EventLogTags.CPU,
                        EventLogTags.writeCpu(
                                ((user + system + iowait + irq + softIrq) * 100) / total,
                                (user * 100) / total,
                                (system * 100) / total,
@@ -3656,7 +3656,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            final ArrayList<ProcessMemInfo> memInfos
                    = doReport ? new ArrayList<ProcessMemInfo>(mProcessList.getLruSizeLocked())
                    : null;
            EventLog.writeEvent(EventLogTags.AM_LOW_MEMORY, mProcessList.getLruSizeLocked());
            EventLogTags.writeAmLowMemory(mProcessList.getLruSizeLocked());
            long now = SystemClock.uptimeMillis();
            for (int i = mProcessList.mLruProcesses.size() - 1; i >= 0; i--) {
                ProcessRecord rec = mProcessList.mLruProcesses.get(i);
@@ -3737,8 +3737,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                mAllowLowerMemLevel = false;
                doLowMem = false;
            }
            EventLog.writeEvent(EventLogTags.AM_PROC_DIED, app.userId, app.pid, app.processName,
                    app.setAdj, app.setProcState);
            EventLogTags.writeAmProcDied(app.userId, app.pid, app.processName, app.setAdj,
                    app.setProcState);
            if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP,
                "Dying app: " + app + ", pid: " + pid + ", thread: " + thread.asBinder());
            handleAppDiedLocked(app, false, true);
@@ -3761,7 +3761,8 @@ public class ActivityManagerService extends IActivityManager.Stub
            // Execute the callback if there is any.
            doAppDiedCallbackLocked(app);
            EventLog.writeEvent(EventLogTags.AM_PROC_DIED, app.userId, app.pid, app.processName);
            EventLogTags.writeAmProcDied(app.userId, app.pid, app.processName, app.setAdj,
                    app.setProcState);
        } else if (DEBUG_PROCESSES) {
            Slog.d(TAG_PROCESSES, "Received spurious death notification for thread "
                    + thread.asBinder());
@@ -4755,8 +4756,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        if (gone) {
            Slog.w(TAG, "Process " + app + " failed to attach");
            EventLog.writeEvent(EventLogTags.AM_PROCESS_START_TIMEOUT, app.userId,
                    pid, app.uid, app.processName);
            EventLogTags.writeAmProcessStartTimeout(app.userId, pid, app.uid, app.processName);
            mProcessList.removeProcessNameLocked(app.processName, app.uid);
            mAtmInternal.clearHeavyWeightProcessIfEquals(app.getWindowProcessController());
            mBatteryStatsService.noteProcessFinish(app.processName, app.info.uid);
@@ -4847,7 +4847,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        if (app == null) {
            Slog.w(TAG, "No pending application record for pid " + pid
                    + " (IApplicationThread " + thread + "); dropping process");
            EventLog.writeEvent(EventLogTags.AM_DROP_PROCESS, pid);
            EventLogTags.writeAmDropProcess(pid);
            if (pid > 0 && pid != MY_PID) {
                killProcessQuiet(pid);
                //TODO: killProcessGroup(app.info.uid, pid);
@@ -4885,7 +4885,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            return false;
        }
        EventLog.writeEvent(EventLogTags.AM_PROC_BOUND, app.userId, app.pid, app.processName);
        EventLogTags.writeAmProcBound(app.userId, app.pid, app.processName);
        app.curAdj = app.setAdj = app.verifiedAdj = ProcessList.INVALID_ADJ;
        mOomAdjuster.setAttachingSchedGroupLocked(app);
@@ -7163,7 +7163,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                            + cpi.applicationInfo.packageName + "/"
                            + cpi.applicationInfo.uid + " for provider "
                            + name + ": launching app became null");
                    EventLog.writeEvent(EventLogTags.AM_PROVIDER_LOST_PROCESS,
                    EventLogTags.writeAmProviderLostProcess(
                            UserHandle.getUserId(cpi.applicationInfo.uid),
                            cpi.applicationInfo.packageName,
                            cpi.applicationInfo.uid, name);
@@ -9156,7 +9156,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        t.traceEnd(); // KillProcesses
        Slog.i(TAG, "System now ready");
        EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_AMS_READY, SystemClock.uptimeMillis());
        EventLogTags.writeBootProgressAmsReady(SystemClock.uptimeMillis());
        t.traceBegin("updateTopComponentForFactoryTest");
        mAtmInternal.updateTopComponentForFactoryTest();
@@ -9410,7 +9411,8 @@ public class ActivityManagerService extends IActivityManager.Stub
     */
    void handleApplicationCrashInner(String eventType, ProcessRecord r, String processName,
            ApplicationErrorReport.CrashInfo crashInfo) {
        EventLog.writeEvent(EventLogTags.AM_CRASH, Binder.getCallingPid(),
        EventLogTags.writeAmCrash(Binder.getCallingPid(),
                UserHandle.getUserId(Binder.getCallingUid()), processName,
                r == null ? -1 : r.info.flags,
                crashInfo.exceptionClassName,
@@ -9613,7 +9615,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        final String processName = app == null ? "system_server"
                : (r == null ? "unknown" : r.processName);
        EventLog.writeEvent(EventLogTags.AM_WTF, UserHandle.getUserId(callingUid), callingPid,
        EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid,
                processName, r == null ? -1 : r.info.flags, tag, crashInfo.exceptionMessage);
        StatsLog.write(StatsLog.WTF_OCCURRED, callingUid, tag, processName,
Loading