summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/Launcher.java54
-rw-r--r--src/com/android/launcher3/LauncherTab.java85
-rw-r--r--src/com/android/launcher3/SettingsActivity.java19
-rw-r--r--src/com/android/launcher3/Utilities.java5
4 files changed, 0 insertions, 163 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8bdd8836c..6fbbd52fd 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -368,10 +368,6 @@ public class Launcher extends BaseActivity
private EditText mIconEditTitle;
private IconsHandler mIconsHandler;
- // Feed integration
- private LauncherTab mLauncherTab;
- private boolean mFeedIntegrationEnabled;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
if (DEBUG_STRICT_MODE) {
@@ -500,9 +496,6 @@ public class Launcher extends BaseActivity
// we want the screen to auto-rotate based on the current orientation
setOrientation();
- mFeedIntegrationEnabled = isFeedIntegrationEnabled();
- mLauncherTab = new LauncherTab(this, mFeedIntegrationEnabled);
-
setContentView(mLauncherView);
// Listen for broadcasts
@@ -1085,9 +1078,6 @@ public class Launcher extends BaseActivity
if (shouldShowDiscoveryBounce()) {
mAllAppsController.showDiscoveryBounce();
}
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onResume();
- }
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onResume();
}
@@ -1112,10 +1102,6 @@ public class Launcher extends BaseActivity
mWorkspace.getCustomContentCallbacks().onHide();
}
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onPause();
- }
-
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onPause();
}
@@ -1627,11 +1613,6 @@ public class Launcher extends BaseActivity
super.onAttachedToWindow();
FirstFrameAnimatorHelper.initializeDrawListener(getWindow().getDecorView());
-
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onAttachedToWindow();
- }
-
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onAttachedToWindow();
}
@@ -1641,11 +1622,6 @@ public class Launcher extends BaseActivity
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
-
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onDetachedFromWindow();
- }
-
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onDetachedFromWindow();
}
@@ -1811,10 +1787,6 @@ public class Launcher extends BaseActivity
mIconEditDialog = null;
}
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().hideOverlay(true);
- }
-
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onHomeIntent();
}
@@ -1926,10 +1898,6 @@ public class Launcher extends BaseActivity
clearPendingBinds();
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onDestroy();
- }
-
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onDestroy();
}
@@ -4179,10 +4147,6 @@ public class Launcher extends BaseActivity
return super.onKeyShortcut(keyCode, event);
}
- private boolean isFeedIntegrationEnabled() {
- return Utilities.hasFeedIntegration(this);
- }
-
public static CustomAppWidget getCustomAppWidget(String name) {
return sCustomAppWidgets.get(name);
}
@@ -4207,24 +4171,6 @@ public class Launcher extends BaseActivity
// Recreate the activity so that it initializes the rotation preference again.
recreate();
}
- if (SettingsActivity.KEY_FEED_INTEGRATION.equals(key)) {
- if (mLauncherTab == null) {
- return;
- }
-
- mFeedIntegrationEnabled = isFeedIntegrationEnabled();
- mLauncherTab.updateLauncherTab(mFeedIntegrationEnabled);
-
- if (mLauncherTab.getClient() == null) {
- return;
- }
-
- if (mFeedIntegrationEnabled) {
- mLauncherTab.getClient().onAttachedToWindow();
- } else {
- mLauncherTab.getClient().onDestroy();
- }
- }
}
}
}
diff --git a/src/com/android/launcher3/LauncherTab.java b/src/com/android/launcher3/LauncherTab.java
deleted file mode 100644
index 2bb450070..000000000
--- a/src/com/android/launcher3/LauncherTab.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2017 Paranoid Android
- * Copyright (C) 2018 The LineageOS 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 com.android.launcher3.Launcher.LauncherOverlay;
-import com.android.launcher3.Launcher.LauncherOverlayCallbacks;
-
-import com.google.android.libraries.launcherclient.LauncherClient;
-import com.google.android.libraries.launcherclient.LauncherClientCallbacksAdapter;
-
-public class LauncherTab {
-
- public static final String SEARCH_PACKAGE = "com.google.android.googlequicksearchbox";
-
- private Launcher mLauncher;
- private LauncherClient mLauncherClient;
- private Workspace mWorkspace;
-
- public LauncherTab(Launcher launcher, boolean enabled) {
- mLauncher = launcher;
- mWorkspace = launcher.getWorkspace();
-
- updateLauncherTab(enabled);
- if (enabled && mLauncherClient.isConnected()) {
- launcher.setLauncherOverlay(new LauncherOverlays());
- }
- }
-
- protected void updateLauncherTab(boolean enabled) {
- if (enabled) {
- mLauncherClient = new LauncherClient(mLauncher,
- new LauncherClientCallbacks(), SEARCH_PACKAGE, true);
- mLauncher.setLauncherOverlay(new LauncherOverlays());
- } else {
- mLauncher.setLauncherOverlay(null);
- }
- }
-
- protected LauncherClient getClient() {
- return mLauncherClient;
- }
-
- private class LauncherOverlays implements LauncherOverlay {
- @Override
- public void onScrollInteractionBegin() {
- mLauncherClient.startMove();
- }
-
- @Override
- public void onScrollInteractionEnd() {
- mLauncherClient.endMove();
- }
-
- @Override
- public void onScrollChange(float progress, boolean rtl) {
- mLauncherClient.updateMove(progress);
- }
-
- @Override
- public void setOverlayCallbacks(LauncherOverlayCallbacks callbacks) {
- }
- }
-
- private class LauncherClientCallbacks extends LauncherClientCallbacksAdapter {
- @Override
- public void onOverlayScrollChanged(float progress) {
- mWorkspace.onOverlayScrollChanged(progress);
- }
- }
-}
diff --git a/src/com/android/launcher3/SettingsActivity.java b/src/com/android/launcher3/SettingsActivity.java
index e538df99b..63a01d122 100644
--- a/src/com/android/launcher3/SettingsActivity.java
+++ b/src/com/android/launcher3/SettingsActivity.java
@@ -30,9 +30,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
@@ -61,7 +58,6 @@ public class SettingsActivity extends Activity {
private static final String KEY_SHOW_DESKTOP_LABELS = "pref_desktop_show_labels";
private static final String KEY_SHOW_DRAWER_LABELS = "pref_drawer_show_labels";
- static final String KEY_FEED_INTEGRATION = "pref_feed_integration";
static final String KEY_PREDICTIVE_APPS = "pref_predictive_apps";
public static final String KEY_WORKSPACE_EDIT = "pref_workspace_edit";
public static final String KEY_FORCE_ADAPTIVE_ICONS = "pref_icon_force_adaptive";
@@ -139,11 +135,6 @@ public class SettingsActivity extends Activity {
mIconBadgingObserver.register(NOTIFICATION_BADGING, NOTIFICATION_ENABLED_LISTENERS);
}
- SwitchPreference feedIntegration = (SwitchPreference)
- findPreference(KEY_FEED_INTEGRATION);
- if (!hasPackageInstalled(LauncherTab.SEARCH_PACKAGE)) {
- homeGroup.removePreference(feedIntegration);
- }
SwitchPreference iconAdaptiveOverride = (SwitchPreference)
findPreference(KEY_FORCE_ADAPTIVE_ICONS);
@@ -205,16 +196,6 @@ public class SettingsActivity extends Activity {
manager.set(AlarmManager.RTC, java.lang.System.currentTimeMillis() + 1, pi);
java.lang.System.exit(0);
}
-
- private boolean hasPackageInstalled(String pkgName) {
- try {
- ApplicationInfo ai = getContext().getPackageManager()
- .getApplicationInfo(pkgName, 0);
- return ai.enabled;
- } catch (PackageManager.NameNotFoundException e) {
- return false;
- }
- }
}
/**
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index d6aaae445..2cb24ab5b 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -707,11 +707,6 @@ public final class Utilities {
return !(currentPack.equals(defaultPack) || currentPack.equals(defaultLocalizedPack));
}
- static boolean hasFeedIntegration(Context context) {
- SharedPreferences prefs = getPrefs(context.getApplicationContext());
- return prefs.getBoolean(SettingsActivity.KEY_FEED_INTEGRATION, false);
- }
-
public static boolean isWorkspaceEditAllowed(Context context) {
SharedPreferences prefs = getPrefs(context.getApplicationContext());
return prefs.getBoolean(SettingsActivity.KEY_WORKSPACE_EDIT, true);