mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Remove device profile dependency from UserEventDispatcher
Bug: 110122682 Change-Id: I31ba61e60e31f1cc84e6d0cf115193e45d9fcfdb
This commit is contained in:
@@ -37,7 +37,6 @@ import android.util.Log;
|
||||
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 @@ public class UserEventDispatcher implements ResourceBasedOverride {
|
||||
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 @@ public class UserEventDispatcher implements ResourceBasedOverride {
|
||||
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 @@ public class UserEventDispatcher implements ResourceBasedOverride {
|
||||
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 class UserEventDispatcher implements ResourceBasedOverride {
|
||||
|
||||
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 @@ public class UserEventDispatcher implements ResourceBasedOverride {
|
||||
ev.elapsedContainerMillis,
|
||||
ev.elapsedSessionMillis,
|
||||
ev.actionDurationMillis);
|
||||
log += "\n isInLandscapeMode " + ev.isInLandscapeMode;
|
||||
log += "\n isInMultiWindowMode " + ev.isInMultiWindowMode;
|
||||
log += "\n\n";
|
||||
Log.d(TAG, log);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user