Add StatsLog*Manager for logging.

Bug: 113043444

Verification: (19) is our event classifier number
11-05 11:24:28.188   932   994 I statsd  : { 1541445868000000000 766293363001 (19)0x10000->1[I] 0x20000->0[I] 0x30000->0[I] 0x40000->[S] 0x50000->1[I]  }

Change-Id: I75403837f9fa8e51efa012fb708bce7efc9c4488
This commit is contained in:
Hyunyoung Song committed 2018-11-05 11:41:38 -08:00
1 parent f107c9ef6d
commit fc00747909
16 files changed
+271 -66

No files matched your search

+14 -1
View File
@@ -28,6 +28,9 @@ import android.view.ContextThemeWrapper;
import android.view.View.AccessibilityDelegate;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogUtils;
import com.android.launcher3.logging.StatsLogUtils.LogStateProvider;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.logging.UserEventDispatcher.UserEventDelegate;
import com.android.launcher3.uioverrides.UiFactory;
@@ -41,7 +44,7 @@ import java.util.ArrayList;
import androidx.annotation.IntDef;
public abstract class BaseActivity extends Activity implements UserEventDelegate{
public abstract class BaseActivity extends Activity implements UserEventDelegate, LogStateProvider{
public static final int INVISIBLE_BY_STATE_HANDLER = 1 << 0;
public static final int INVISIBLE_BY_APP_TRANSITIONS = 1 << 1;
@@ -72,6 +75,7 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
protected DeviceProfile mDeviceProfile;
protected UserEventDispatcher mUserEventDispatcher;
protected StatsLogManager mStatsLogManager;
protected SystemUiController mSystemUiController;
private static final int ACTIVITY_STATE_STARTED = 1 << 0;
@@ -104,8 +108,17 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
return null;
}
public int getCurrentState() { return StatsLogUtils.LAUNCHER_STATE_BACKGROUND; }
public void modifyUserEvent(LauncherLogProto.LauncherEvent event) {}
public final StatsLogManager getStatsLogManager() {
if (mStatsLogManager == null) {
mStatsLogManager = StatsLogManager.newInstance(this, this);
}
return mStatsLogManager;
}
public final UserEventDispatcher getUserEventDispatcher() {
if (mUserEventDispatcher == null) {
mUserEventDispatcher = UserEventDispatcher.newInstance(this, this);