From: Mario Bertschler Date: Tue, 16 May 2017 20:08:05 +0000 (+0000) Subject: Merge "Minor polishment on app discovery UI." into ub-launcher3-dorval X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8ffddbb7c215f280b714661b8cae01246bde9956;hp=0287a44c81244d7b03cd964949203d58f548af93;p=android-x86%2Fpackages-apps-Launcher3.git Merge "Minor polishment on app discovery UI." into ub-launcher3-dorval --- diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto index 909a42987..93e09aea8 100644 --- a/protos/launcher_log.proto +++ b/protos/launcher_log.proto @@ -156,4 +156,5 @@ message LauncherEvent { optional int64 elapsed_session_millis = 6; optional bool is_in_multi_window_mode = 7; + optional bool is_in_landscape_mode = 8; } diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java index 410d590ad..08cd955a5 100644 --- a/src/com/android/launcher3/BaseActivity.java +++ b/src/com/android/launcher3/BaseActivity.java @@ -39,7 +39,7 @@ public abstract class BaseActivity extends Activity { public final UserEventDispatcher getUserEventDispatcher() { if (mUserEventDispatcher == null) { mUserEventDispatcher = UserEventDispatcher.newInstance(this, - isInMultiWindowModeCompat()); + mDeviceProfile.isLandscape, isInMultiWindowModeCompat()); } return mUserEventDispatcher; } diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 07e99c693..258af1689 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -62,9 +62,11 @@ public class UserEventDispatcher { private static final boolean IS_VERBOSE = ProviderConfig.IS_DOGFOOD_BUILD && Utilities.isPropertyEnabled(LogConfig.USEREVENT); - public static UserEventDispatcher newInstance(Context context, boolean isInMultiWindowMode) { + public static UserEventDispatcher newInstance(Context context, boolean isInLandscapeMode, + boolean isInMultiWindowMode) { UserEventDispatcher ued = Utilities.getOverrideObject(UserEventDispatcher.class, context.getApplicationContext(), R.string.user_event_dispatcher_class); + ued.mIsInLandscapeMode = isInLandscapeMode; ued.mIsInMultiWindowMode = isInMultiWindowMode; return ued; } @@ -112,6 +114,7 @@ public class UserEventDispatcher { private long mElapsedSessionMillis; private long mActionDurationMillis; private boolean mIsInMultiWindowMode; + private boolean mIsInLandscapeMode; // Used for filling in predictedRank on {@link Target}s. private List mPredictedApps; @@ -296,6 +299,7 @@ public class UserEventDispatcher { } public void dispatchUserEvent(LauncherEvent ev, Intent intent) { + ev.isInLandscapeMode = mIsInLandscapeMode; ev.isInMultiWindowMode = mIsInMultiWindowMode; ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; @@ -315,6 +319,7 @@ public class UserEventDispatcher { ev.elapsedContainerMillis, ev.elapsedSessionMillis, ev.actionDurationMillis); + log += "\n isInLandscapeMode " + ev.isInLandscapeMode; log += "\n isInMultiWindowMode " + ev.isInMultiWindowMode; Log.d(TAG, log); }