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/BaseActivity.java | |
| parent | 54d4e645b3c2b2c153e97f776e33685b292f8c2b (diff) | |
| download | packages_apps_Trebuchet-a535ae423bdb3272095e8d83b4c9deff342227b1.tar.gz packages_apps_Trebuchet-a535ae423bdb3272095e8d83b4c9deff342227b1.tar.bz2 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/BaseActivity.java')
| -rw-r--r-- | src/com/android/launcher3/BaseActivity.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java index 9f4f1f9c4..e1a3ad0d6 100644 --- a/src/com/android/launcher3/BaseActivity.java +++ b/src/com/android/launcher3/BaseActivity.java @@ -21,9 +21,12 @@ import android.content.Context; import android.content.ContextWrapper; import android.view.View.AccessibilityDelegate; +import com.android.launcher3.logging.UserEventDispatcher; + public abstract class BaseActivity extends Activity { protected DeviceProfile mDeviceProfile; + protected UserEventDispatcher mUserEventDispatcher; public DeviceProfile getDeviceProfile() { return mDeviceProfile; @@ -33,6 +36,13 @@ public abstract class BaseActivity extends Activity { return null; } + public final UserEventDispatcher getUserEventDispatcher() { + if (mUserEventDispatcher == null) { + mUserEventDispatcher = UserEventDispatcher.get(this); + } + return mUserEventDispatcher; + } + public static BaseActivity fromContext(Context context) { if (context instanceof BaseActivity) { return (BaseActivity) context; |
