Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24fa33f8 authored by Nilesh Agrawal's avatar Nilesh Agrawal Committed by Android (Google) Code Review
Browse files

Merge "Allow DISABLE_ALL_APPS to be set using a system property." into jb-ub-now-kermit

parents b54a5989 16f3ea87
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -94,4 +94,7 @@
         filter the activities shown in the launcher. Can be empty. -->
    <string name="app_filter_class" translatable="false"></string>

    <!-- Name of a subclass of com.android.launcher3.BuildInfo used to
         get build information. Can be empty. -->
    <string name="build_info_class" translatable="false"></string>
</resources>
+6 −8
Original line number Diff line number Diff line
@@ -199,8 +199,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
    private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f);
    private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4);

    public static boolean DISABLE_ALL_APPS = false;

    // Previews & outlines
    ArrayList<AppsCustomizeAsyncTask> mRunningTasks;
    private static final int sPageSleepDelay = 200;
@@ -427,7 +425,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
        int width = MeasureSpec.getSize(widthMeasureSpec);
        int height = MeasureSpec.getSize(heightMeasureSpec);
        if (!isDataReady()) {
            if ((DISABLE_ALL_APPS || !mApps.isEmpty()) && !mWidgets.isEmpty()) {
            if ((LauncherAppState.isDisableAllApps() || !mApps.isEmpty()) && !mWidgets.isEmpty()) {
                setDataIsReady();
                setMeasuredDimension(width, height);
                onDataReady(width, height);
@@ -1558,7 +1556,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
    }

    public void setApps(ArrayList<AppInfo> list) {
        if (!DISABLE_ALL_APPS) {
        if (!LauncherAppState.isDisableAllApps()) {
            mApps = list;
            Collections.sort(mApps, LauncherModel.getAppNameComparator());
            updatePageCountsAndInvalidateData();
@@ -1576,7 +1574,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
        }
    }
    public void addApps(ArrayList<AppInfo> list) {
        if (!DISABLE_ALL_APPS) {
        if (!LauncherAppState.isDisableAllApps()) {
            addAppsWithoutInvalidate(list);
            updatePageCountsAndInvalidateData();
        }
@@ -1604,7 +1602,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
        }
    }
    public void removeApps(ArrayList<AppInfo> appInfos) {
        if (!DISABLE_ALL_APPS) {
        if (!LauncherAppState.isDisableAllApps()) {
            removeAppsWithoutInvalidate(appInfos);
            updatePageCountsAndInvalidateData();
        }
@@ -1613,7 +1611,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
        // We remove and re-add the updated applications list because it's properties may have
        // changed (ie. the title), and this will ensure that the items will be in their proper
        // place in the list.
        if (!DISABLE_ALL_APPS) {
        if (!LauncherAppState.isDisableAllApps()) {
            removeAppsWithoutInvalidate(list);
            addAppsWithoutInvalidate(list);
            updatePageCountsAndInvalidateData();
+32 −0
Original line number Diff line number Diff line
package com.android.launcher3;

import android.text.TextUtils;
import android.util.Log;

public class BuildInfo {
    private static final boolean DBG = false;
    private static final String TAG = "BuildInfo";

    public boolean isDogfoodBuild() {
        return false;
    }

    public static BuildInfo loadByName(String className) {
        if (TextUtils.isEmpty(className)) return new BuildInfo();

        if (DBG) Log.d(TAG, "Loading BuildInfo: " + className);
        try {
            Class<?> cls = Class.forName(className);
            return (BuildInfo) cls.newInstance();
        } catch (ClassNotFoundException e) {
            Log.e(TAG, "Bad BuildInfo class", e);
        } catch (InstantiationException e) {
            Log.e(TAG, "Bad BuildInfo class", e);
        } catch (IllegalAccessException e) {
            Log.e(TAG, "Bad BuildInfo class", e);
        } catch (ClassCastException e) {
            Log.e(TAG, "Bad BuildInfo class", e);
        }
        return new BuildInfo();
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -146,12 +146,12 @@ public class DeleteDropTarget extends ButtonDropTarget {
                return true;
            }

            if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
            if (!LauncherAppState.isDisableAllApps() &&
                    item.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
                return true;
            }

            if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
            if (!LauncherAppState.isDisableAllApps() &&
                    item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION &&
                    item instanceof AppInfo) {
                AppInfo appInfo = (AppInfo) info;
@@ -160,7 +160,7 @@ public class DeleteDropTarget extends ButtonDropTarget {

            if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION &&
                item instanceof ShortcutInfo) {
                if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
                if (LauncherAppState.isDisableAllApps()) {
                    ShortcutInfo shortcutInfo = (ShortcutInfo) info;
                    return (shortcutInfo.flags & AppInfo.DOWNLOADED_FLAG) != 0;
                } else {
@@ -174,7 +174,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
    @Override
    public void onDragStart(DragSource source, Object info, int dragAction) {
        boolean isVisible = true;
        boolean useUninstallLabel = !AppsCustomizePagedView.DISABLE_ALL_APPS &&
        boolean useUninstallLabel = !LauncherAppState.isDisableAllApps() &&
                isAllAppsApplication(source, info);
        boolean useDeleteLabel = !useUninstallLabel && source.supportsDeleteDropTarget();

@@ -264,7 +264,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
    }

    private boolean isUninstallFromWorkspace(DragObject d) {
        if (AppsCustomizePagedView.DISABLE_ALL_APPS && isWorkspaceOrFolderApplication(d)) {
        if (LauncherAppState.isDisableAllApps() && isWorkspaceOrFolderApplication(d)) {
            ShortcutInfo shortcut = (ShortcutInfo) d.dragInfo;
            // Only allow manifest shortcuts to initiate an un-install.
            return !InstallShortcutReceiver.isValidShortcutLaunchIntent(shortcut.intent);
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class DeviceProfile {
    DeviceProfile(String n, float w, float h, float r, float c,
                  float is, float its, float hs, float his) {
        // Ensure that we have an odd number of hotseat items (since we need to place all apps)
        if (!AppsCustomizePagedView.DISABLE_ALL_APPS && hs % 2 == 0) {
        if (!LauncherAppState.isDisableAllApps() && hs % 2 == 0) {
            throw new RuntimeException("All Device Profiles must have an odd number of hotseat spaces");
        }

Loading