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

Commit d403f539 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enabling background protection for back arrow on secondary displays"

parents a03ac61f ec6bf35b
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.navigationbar.gestural;

import static android.view.Display.DEFAULT_DISPLAY;

import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Configuration;
@@ -334,6 +336,7 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
                .getDimension(R.dimen.navigation_edge_action_drag_threshold);
        setVisibility(GONE);

        boolean isPrimaryDisplay = mContext.getDisplayId() == DEFAULT_DISPLAY;
        mRegionSamplingHelper = new RegionSamplingHelper(this,
                new RegionSamplingHelper.SamplingCallback() {
                    @Override
@@ -345,8 +348,14 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
                    public Rect getSampledRegion(View sampledView) {
                        return mSamplingRect;
                    }

                    @Override
                    public boolean isSamplingEnabled() {
                        return isPrimaryDisplay;
                    }
                });
        mRegionSamplingHelper.setWindowVisible(true);
        mShowProtection = !isPrimaryDisplay;
    }

    @Override
@@ -366,11 +375,6 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
        updateIsDark(animate);
    }

    private void setShowProtection(boolean showProtection) {
        mShowProtection = showProtection;
        invalidate();
    }

    @Override
    public void setIsLeftPanel(boolean isLeftPanel) {
        mIsLeftPanel = isLeftPanel;