Log the parent of the PREDICTION container type (ALLAPPS OR TASKSWITCHER)

Bug: 79423536

Change-Id: I23ff0d4d0aa3fec781e9b6c8792d2d7a738ca6c8
This commit is contained in:
Hyunyoung Song
2018-05-22 15:41:25 -07:00
parent 8417a7b514
commit 46d07f7cb0
3 changed files with 44 additions and 5 deletions

View File

@@ -70,7 +70,8 @@ public class UserEventDispatcher {
FeatureFlags.IS_DOGFOOD_BUILD && Utilities.isPropertyEnabled(LogConfig.USEREVENT);
private static final String UUID_STORAGE = "uuid";
public static UserEventDispatcher newInstance(Context context, DeviceProfile dp) {
public static UserEventDispatcher newInstance(Context context, DeviceProfile dp,
UserEventDelegate delegate) {
SharedPreferences sharedPrefs = Utilities.getDevicePrefs(context);
String uuidStr = sharedPrefs.getString(UUID_STORAGE, null);
if (uuidStr == null) {
@@ -79,6 +80,7 @@ public class UserEventDispatcher {
}
UserEventDispatcher ued = Utilities.getOverrideObject(UserEventDispatcher.class,
context.getApplicationContext(), R.string.user_event_dispatcher_class);
ued.mDelegate = delegate;
ued.mIsInLandscapeMode = dp.isVerticalBarLayout();
ued.mIsInMultiWindowMode = dp.isMultiWindowMode;
ued.mUuidStr = uuidStr;
@@ -86,6 +88,14 @@ public class UserEventDispatcher {
return ued;
}
public static UserEventDispatcher newInstance(Context context, DeviceProfile dp) {
return newInstance(context, dp, null);
}
public interface UserEventDelegate {
void modifyUserEvent(LauncherEvent event);
}
/**
* Implemented by containers to provide a container source for a given child.
*/
@@ -134,6 +144,7 @@ public class UserEventDispatcher {
private String mUuidStr;
protected InstantAppResolver mInstantAppResolver;
private boolean mAppOrTaskLaunch;
private UserEventDelegate mDelegate;
// APP_ICON SHORTCUT WIDGET
// --------------------------------------------------------------
@@ -162,6 +173,9 @@ public class UserEventDispatcher {
newItemTarget(v, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
if (fillInLogContainerData(event, v)) {
if (mDelegate != null) {
mDelegate.modifyUserEvent(event);
}
fillIntentInfo(event.srcTarget[0], intent);
}
dispatchUserEvent(event, intent);