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

Commit ec6bf35b authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Enabling background protection for back arrow on secondary displays

Bug: 170672585
Test: Verified on device
Change-Id: If43efd3d5ce772df72dd83a371a7f6eb071d8ff4
parent 343b8725
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;