summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2016-04-26 19:09:51 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-26 19:09:51 +0000
commit886076751bbb6411a50a9cb8b5d76ce71f2bbd88 (patch)
treeb3f9975610221ea539504b1c05ea03da053d1489
parentef720f04e7ccb0ea85cdb4642daf69b0cfe8694a (diff)
parenta332ae84c1924472ab607a08f94c2da66dd23f27 (diff)
downloadandroid_packages_apps_Trebuchet-886076751bbb6411a50a9cb8b5d76ce71f2bbd88.tar.gz
android_packages_apps_Trebuchet-886076751bbb6411a50a9cb8b5d76ce71f2bbd88.tar.bz2
android_packages_apps_Trebuchet-886076751bbb6411a50a9cb8b5d76ce71f2bbd88.zip
Merge "Define a set of methods on Launcher which can be safely called externally" into ub-launcher3-calgary
am: a332ae8 * commit 'a332ae84c1924472ab607a08f94c2da66dd23f27': Define a set of methods on Launcher which can be safely called externally Change-Id: I71d87736aa9e08e2e7d934446b0068d0b2a6a04a
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/LauncherCallbacks.java16
-rw-r--r--src/com/android/launcher3/LauncherExterns.java32
3 files changed, 51 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 4e379a1d0..51df013f5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -136,8 +136,8 @@ import java.util.Locale;
* Default launcher application.
*/
public class Launcher extends Activity
- implements View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks,
- View.OnTouchListener, LauncherProviderChangeListener,
+ implements LauncherExterns, View.OnClickListener, OnLongClickListener,
+ LauncherModel.Callbacks, View.OnTouchListener, LauncherProviderChangeListener,
AccessibilityManager.AccessibilityStateChangeListener {
public static final String TAG = "Launcher";
static final boolean LOGD = false;
@@ -1842,7 +1842,7 @@ public class Launcher extends Activity
return mModel;
}
- protected SharedPreferences getSharedPrefs() {
+ public SharedPreferences getSharedPrefs() {
return mSharedPrefs;
}
diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java
index 89eef60ad..34117b6b1 100644
--- a/src/com/android/launcher3/LauncherCallbacks.java
+++ b/src/com/android/launcher3/LauncherCallbacks.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2016 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.content.Intent;
diff --git a/src/com/android/launcher3/LauncherExterns.java b/src/com/android/launcher3/LauncherExterns.java
new file mode 100644
index 000000000..c7a8668de
--- /dev/null
+++ b/src/com/android/launcher3/LauncherExterns.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 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.content.SharedPreferences;
+
+/**
+ * This interface defines the set of methods that the Launcher activity exposes. Methods
+ * here should be safe to call from classes outside of com.android.launcher3.*
+ */
+public interface LauncherExterns {
+
+ public boolean setLauncherCallbacks(LauncherCallbacks callbacks);
+
+ public SharedPreferences getSharedPrefs();
+
+ public void setLauncherOverlay(Launcher.LauncherOverlay overlay);
+}