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

Commit dd176e65 authored by Winson Chung's avatar Winson Chung
Browse files

Revert "Remove back button when on home screen"

This reverts commit 663759e4.

Reason for revert: Temporary revert for NL build

Change-Id: I8614ee348e6e9290c0de0dfdf3e24663f220e356
parent 663759e4
Loading
Loading
Loading
Loading
−772 B (111 KiB)

File changed.

No diff preview for this file type.

+3 −8
Original line number Diff line number Diff line
@@ -16,11 +16,12 @@

package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherState.NORMAL;

import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PointF;
import android.os.Bundle;
import android.view.View;
import android.view.View.AccessibilityDelegate;

import com.android.launcher3.Launcher;
@@ -28,7 +29,6 @@ import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.BitmapRenderer;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.RecentsView;
import com.android.systemui.shared.recents.view.RecentsTransition;

@@ -68,11 +68,6 @@ public class UiFactory {
        OptionsPopupView.show(launcher, touchPoint.x, touchPoint.y);
    }

    public static void onLauncherStateOrFocusChanged(Launcher launcher) {
        OverviewInteractionState.setBackButtonVisible(launcher, !launcher.isInState(NORMAL)
                || !launcher.hasWindowFocus());
    }

    public static Bitmap createFromRenderer(int width, int height, boolean forceSoftwareRenderer,
            BitmapRenderer renderer) {
        if (USE_HARDWARE_BITMAP && !forceSoftwareRenderer) {
+0 −64
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.quickstep;

import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON;

import android.content.Context;
import android.os.RemoteException;
import android.util.Log;

import com.android.systemui.shared.recents.ISystemUiProxy;

/**
 * Sets overview interaction flags, such as:
 *
 *   - FLAG_DISABLE_QUICK_SCRUB
 *   - FLAG_DISABLE_SWIPE_UP
 *   - FLAG_HIDE_BACK_BUTTON
 *   - FLAG_SHOW_OVERVIEW_BUTTON
 *
 * @see com.android.systemui.shared.system.NavigationBarCompat.InteractionType and associated flags.
 */
public class OverviewInteractionState {

    private static final String TAG = "OverviewFlags";

    private static int sFlags;

    public static void setBackButtonVisible(Context context, boolean visible) {
        updateOverviewInteractionFlag(context, FLAG_HIDE_BACK_BUTTON, !visible);
    }

    private static void updateOverviewInteractionFlag(Context context, int flag, boolean enabled) {
        if (enabled) {
            sFlags |= flag;
        } else {
            sFlags &= ~flag;
        }

        ISystemUiProxy systemUiProxy = RecentsModel.getInstance(context).getSystemUiProxy();
        if (systemUiProxy == null) {
            Log.w(TAG, "Unable to update overview interaction flags; not bound to service");
            return;
        }
        try {
            systemUiProxy.setInteractionState(sFlags);
        } catch (RemoteException e) {
            Log.w(TAG, "Unable to update overview interaction flags", e);
        }
    }
}
+0 −6
Original line number Diff line number Diff line
@@ -855,12 +855,6 @@ public class Launcher extends BaseActivity
        }
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        mStateManager.onWindowFocusChanged();
    }

    public interface LauncherOverlay {

        /**
+0 −6
Original line number Diff line number Diff line
@@ -303,12 +303,6 @@ public class LauncherStateManager {
        if (state == NORMAL) {
            setRestState(null);
        }

        UiFactory.onLauncherStateOrFocusChanged(mLauncher);
    }

    public void onWindowFocusChanged() {
        UiFactory.onLauncherStateOrFocusChanged(mLauncher);
    }

    public LauncherState getLastState() {
Loading