diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-02-27 10:07:13 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-02-27 10:09:09 -0800 |
commit | a535ae423bdb3272095e8d83b4c9deff342227b1 (patch) | |
tree | 5a6e401320600260e0481ddee58c35470f20a88d /src/com/android/launcher3/logging | |
parent | 54d4e645b3c2b2c153e97f776e33685b292f8c2b (diff) | |
download | android_packages_apps_Trebuchet-a535ae423bdb3272095e8d83b4c9deff342227b1.tar.gz android_packages_apps_Trebuchet-a535ae423bdb3272095e8d83b4c9deff342227b1.tar.bz2 android_packages_apps_Trebuchet-a535ae423bdb3272095e8d83b4c9deff342227b1.zip |
Moving Event dispatcher definition from LAuncher to BaseActivity so that
it can be used in other activities as well.
Bug: 34766840
Change-Id: Ie4b723483792bee93fb75e63146ebea7dfeebeda
Diffstat (limited to 'src/com/android/launcher3/logging')
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 5f45c6176..90e453117 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -18,6 +18,7 @@ package com.android.launcher3.logging; import android.app.PendingIntent; import android.content.ComponentName; +import android.content.Context; import android.content.Intent; import android.os.SystemClock; import android.util.Log; @@ -26,6 +27,7 @@ import android.view.ViewParent; import com.android.launcher3.DropTarget; import com.android.launcher3.ItemInfo; +import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.userevent.nano.LauncherLogProto; @@ -61,6 +63,19 @@ public class UserEventDispatcher { private static final boolean IS_VERBOSE = ProviderConfig.IS_DOGFOOD_BUILD && Utilities.isPropertyEnabled(LogConfig.USEREVENT); + private static UserEventDispatcher sInstance; + private static final Object LOCK = new Object(); + + public static UserEventDispatcher get(Context context) { + synchronized (LOCK) { + if (sInstance == null) { + sInstance = Utilities.getOverrideObject(UserEventDispatcher.class, + context.getApplicationContext(), R.string.user_event_dispatcher_class); + } + return sInstance; + } + } + /** * Implemented by containers to provide a container source for a given child. */ |