Remove device profile dependency from UserEventDispatcher
Bug: 110122682
Change-Id: I31ba61e60e31f1cc84e6d0cf115193e45d9fcfdb
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index a4b6f5b..fd69377 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -107,7 +107,7 @@
public final UserEventDispatcher getUserEventDispatcher() {
if (mUserEventDispatcher == null) {
- mUserEventDispatcher = UserEventDispatcher.newInstance(this, mDeviceProfile, this);
+ mUserEventDispatcher = UserEventDispatcher.newInstance(this, this);
}
return mUserEventDispatcher;
}
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index d9d3f68..7087fdb 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -37,7 +37,6 @@
import android.view.View;
import android.view.ViewParent;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DropTarget;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.R;
@@ -71,7 +70,7 @@
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,
UserEventDelegate delegate) {
SharedPreferences sharedPrefs = Utilities.getDevicePrefs(context);
String uuidStr = sharedPrefs.getString(UUID_STORAGE, null);
@@ -82,15 +81,13 @@
UserEventDispatcher ued = Overrides.getObject(UserEventDispatcher.class,
context.getApplicationContext(), R.string.user_event_dispatcher_class);
ued.mDelegate = delegate;
- ued.mIsInLandscapeMode = dp.isVerticalBarLayout();
- ued.mIsInMultiWindowMode = dp.isMultiWindowMode;
ued.mUuidStr = uuidStr;
ued.mInstantAppResolver = InstantAppResolver.newInstance(context);
return ued;
}
- public static UserEventDispatcher newInstance(Context context, DeviceProfile dp) {
- return newInstance(context, dp, null);
+ public static UserEventDispatcher newInstance(Context context) {
+ return newInstance(context, null);
}
public interface UserEventDelegate {
@@ -140,8 +137,6 @@
private long mElapsedContainerMillis;
private long mElapsedSessionMillis;
private long mActionDurationMillis;
- private boolean mIsInMultiWindowMode;
- private boolean mIsInLandscapeMode;
private String mUuidStr;
protected InstantAppResolver mInstantAppResolver;
private boolean mAppOrTaskLaunch;
@@ -435,8 +430,6 @@
public void dispatchUserEvent(LauncherEvent ev, Intent intent) {
mAppOrTaskLaunch = false;
- ev.isInLandscapeMode = mIsInLandscapeMode;
- ev.isInMultiWindowMode = mIsInMultiWindowMode;
ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis;
ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis;
@@ -456,8 +449,6 @@
ev.elapsedContainerMillis,
ev.elapsedSessionMillis,
ev.actionDurationMillis);
- log += "\n isInLandscapeMode " + ev.isInLandscapeMode;
- log += "\n isInMultiWindowMode " + ev.isInMultiWindowMode;
log += "\n\n";
Log.d(TAG, log);
}