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

Commit 53ac542d authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android Git Automerger
Browse files

am 7294a594: Merge "Improve scrim handling" into lmp-preview-dev

* commit '7294a594ec993352dc6e743ae313308636afb16d':
  Improve scrim handling
parents 7826baa2 7c1d454d
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -18,12 +18,6 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <View android:id="@+id/bouncer_background"
        android:background="#cc000000"
        android:clickable="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <include
        style="@style/BouncerSecurityContainer"
        layout="@layout/keyguard_simple_host_view"
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@
    android:fitsSystemWindows="true"
    android:descendantFocusability="afterDescendants">

    <View android:id="@+id/scrim_behind"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <include layout="@layout/status_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/status_bar_height" />
@@ -40,4 +44,8 @@
            android:visibility="gone" />
    </com.android.systemui.statusbar.phone.PanelHolder>

    <View android:id="@+id/scrim_in_front"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.phone.StatusBarWindowView>
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@
    <drawable name="recents_callout_line">#99ffffff</drawable>
    <drawable name="notification_item_background_legacy_color">#ffaaaaaa</drawable>
    <drawable name="heads_up_notification_bg_pressed">#ff33B5E5</drawable>
    <color name="notification_panel_scrim_color">#A0000000</color>
    <color name="notification_panel_scrim_color_keyguard">#80000000</color>
    <color name="batterymeter_frame_color">#66FFFFFF</color><!-- 40% white -->
    <color name="batterymeter_charge_color">#FFFFFFFF</color>
    <color name="batterymeter_bolt_color">#FFFFFFFF</color>
+4 −2
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.keyguard.analytics.KeyguardAnalytics;
import com.android.keyguard.analytics.Session;
import com.android.systemui.SystemUI;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarWindowManager;

@@ -1316,9 +1317,10 @@ public class KeyguardViewMediator extends SystemUI {
    }

    public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar,
            ViewGroup container, StatusBarWindowManager statusBarWindowManager) {
            ViewGroup container, StatusBarWindowManager statusBarWindowManager,
            ScrimController scrimController) {
        mStatusBarKeyguardViewManager.registerStatusBar(phoneStatusBar, container,
                statusBarWindowManager);
                statusBarWindowManager, scrimController);
        return mStatusBarKeyguardViewManager;
    }

+12 −35
Original line number Diff line number Diff line
@@ -29,18 +29,11 @@ import android.os.UserHandle;
import android.provider.MediaStore;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.R;

/**
@@ -48,7 +41,8 @@ import com.android.systemui.R;
 * text.
 */
public class KeyguardBottomAreaView extends FrameLayout
        implements SwipeAffordanceView.AffordanceListener {
        implements SwipeAffordanceView.AffordanceListener,
        UnlockMethodCache.OnUnlockMethodChangedListener {

    final static String TAG = "PhoneStatusBar/KeyguardBottomAreaView";

@@ -60,9 +54,7 @@ public class KeyguardBottomAreaView extends FrameLayout

    private PowerManager mPowerManager;
    private ActivityStarter mActivityStarter;

    private LockPatternUtils mLockPatternUtils;
    private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private UnlockMethodCache mUnlockMethodCache;

    public KeyguardBottomAreaView(Context context) {
        super(context);
@@ -89,13 +81,12 @@ public class KeyguardBottomAreaView extends FrameLayout
        mLockIcon = (ImageView) findViewById(R.id.lock_icon);
        mCameraButton.setAffordanceListener(this);
        mPhoneButton.setAffordanceListener(this);
        mLockPatternUtils = new LockPatternUtils(getContext());
        mKeyguardUpdateMonitor = KeyguardUpdateMonitor.getInstance(getContext());
        KeyguardUpdateMonitor.getInstance(getContext()).registerCallback(mCallback);
        watchForDevicePolicyChanges();
        watchForAccessibilityChanges();
        updateCameraVisibility();
        updatePhoneVisibility();
        mUnlockMethodCache = UnlockMethodCache.getInstance(getContext());
        mUnlockMethodCache.addListener(this);
        updateTrust();
        mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
    }
@@ -211,28 +202,14 @@ public class KeyguardBottomAreaView extends FrameLayout
        if (getVisibility() != VISIBLE) {
            return;
        }
        int user = mLockPatternUtils.getCurrentUser();
        boolean trust = !mLockPatternUtils.isSecure() ||
                mKeyguardUpdateMonitor.getUserHasTrust(user);

        int iconRes = trust ? R.drawable.ic_lock_open_24dp : R.drawable.ic_lock_24dp;
        int iconRes = mUnlockMethodCache.isMethodInsecure()
                ? R.drawable.ic_lock_open_24dp
                : R.drawable.ic_lock_24dp;
        mLockIcon.setImageResource(iconRes);
    }

    final KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() {
        @Override
        public void onScreenTurnedOn() {
            updateTrust();
        }

        @Override
        public void onUserSwitchComplete(int userId) {
            updateTrust();
        }

    @Override
        public void onTrustChanged(int userId) {
    public void onMethodSecureChanged(boolean methodSecure) {
        updateTrust();
    }
    };
}
Loading