summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BaseActivity.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-01-13 12:15:53 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-01-18 18:38:34 -0800
commit278359539c02ca160caf1df54ce96053a2a2ef59 (patch)
treee4dc8afc511fd553ffe8766855bb9cefdf54656e /src/com/android/launcher3/BaseActivity.java
parent627006eeb4a9ba3bedacd7c0e4edce4fafdb9ac2 (diff)
downloadandroid_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.tar.gz
android_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.tar.bz2
android_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.zip
Adding support for requesting addition of shortcut/widget
on the workspace. Bug: 33584624 Change-Id: I664366822fe8088742faff2cce006239ab0771bc
Diffstat (limited to 'src/com/android/launcher3/BaseActivity.java')
-rw-r--r--src/com/android/launcher3/BaseActivity.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
new file mode 100644
index 000000000..9f4f1f9c4
--- /dev/null
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.ContextWrapper;
+import android.view.View.AccessibilityDelegate;
+
+public abstract class BaseActivity extends Activity {
+
+ protected DeviceProfile mDeviceProfile;
+
+ public DeviceProfile getDeviceProfile() {
+ return mDeviceProfile;
+ }
+
+ public AccessibilityDelegate getAccessibilityDelegate() {
+ return null;
+ }
+
+ public static BaseActivity fromContext(Context context) {
+ if (context instanceof BaseActivity) {
+ return (BaseActivity) context;
+ }
+ return ((BaseActivity) ((ContextWrapper) context).getBaseContext());
+ }
+}