Loading packages/SystemUI/res/layout/status_bar_expanded.xml +0 −15 Original line number Diff line number Diff line Loading @@ -132,21 +132,6 @@ android:id="@+id/lock_icon_view" android:layout_width="wrap_content" android:layout_height="wrap_content"> <!-- Background protection --> <ImageView android:id="@+id/lock_icon_bg" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fingerprint_bg" android:visibility="invisible"/> <ImageView android:id="@+id/lock_icon" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:scaleType="centerCrop"/> </com.android.keyguard.LockIconView> <include Loading packages/SystemUI/res/values/ids.xml +2 −0 Original line number Diff line number Diff line Loading @@ -211,4 +211,6 @@ <item type="id" name="keyguard_indication_area" /> <item type="id" name="keyguard_indication_text" /> <item type="id" name="keyguard_indication_text_bottom" /> <item type="id" name="lock_icon" /> <item type="id" name="lock_icon_bg" /> </resources> packages/SystemUI/src/com/android/keyguard/LockIconView.java +29 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.keyguard; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; Loading @@ -23,6 +25,7 @@ import android.graphics.Point; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; Loading Loading @@ -68,13 +71,9 @@ public class LockIconView extends FrameLayout implements Dumpable { public LockIconView(Context context, AttributeSet attrs) { super(context, attrs); mSensorRect = new RectF(); } @Override public void onFinishInflate() { super.onFinishInflate(); mLockIcon = findViewById(R.id.lock_icon); mBgView = findViewById(R.id.lock_icon_bg); addBgImageView(context, attrs); addLockIconImageView(context, attrs); } void setDozeAmount(float dozeAmount) { Loading Loading @@ -184,6 +183,30 @@ public class LockIconView extends FrameLayout implements Dumpable { mLockIcon.setImageState(getLockIconState(mIconType, mAod), true); } private void addLockIconImageView(Context context, AttributeSet attrs) { mLockIcon = new ImageView(context, attrs); mLockIcon.setId(R.id.lock_icon); mLockIcon.setScaleType(ImageView.ScaleType.CENTER_CROP); addView(mLockIcon); LayoutParams lp = (LayoutParams) mLockIcon.getLayoutParams(); lp.height = MATCH_PARENT; lp.width = MATCH_PARENT; lp.gravity = Gravity.CENTER; mLockIcon.setLayoutParams(lp); } private void addBgImageView(Context context, AttributeSet attrs) { mBgView = new ImageView(context, attrs); mBgView.setId(R.id.lock_icon_bg); mBgView.setImageDrawable(context.getDrawable(R.drawable.fingerprint_bg)); mBgView.setVisibility(View.INVISIBLE); addView(mBgView); LayoutParams lp = (LayoutParams) mBgView.getLayoutParams(); lp.height = MATCH_PARENT; lp.width = MATCH_PARENT; mBgView.setLayoutParams(lp); } private static int[] getLockIconState(@IconType int icon, boolean aod) { if (icon == ICON_NONE) { return new int[0]; Loading packages/SystemUI/src/com/android/systemui/flags/Flags.kt +8 −0 Original line number Diff line number Diff line Loading @@ -249,11 +249,19 @@ object Flags { @JvmField val DELAY_BOUNCER = unreleasedFlag(235, "delay_bouncer", teamfood = true) /** Keyguard Migration */ /** Migrate the indication area to the new keyguard root view. */ // TODO(b/280067944): Tracking bug. @JvmField val MIGRATE_INDICATION_AREA = unreleasedFlag(236, "migrate_indication_area", teamfood = true) /** Migrate the lock icon view to the new keyguard root view. */ // TODO(b/286552209): Tracking bug. @JvmField val MIGRATE_LOCK_ICON = unreleasedFlag(238, "migrate_lock_icon") /** Whether to listen for fingerprint authentication over keyguard occluding activities. */ // TODO(b/283260512): Tracking bug. @JvmField Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt +15 −2 Original line number Diff line number Diff line Loading @@ -47,9 +47,10 @@ constructor( private var indicationAreaHandle: DisposableHandle? = null override fun start() { bindIndicationArea( val notificationPanel = notificationShadeWindowView.requireViewById(R.id.notification_panel) as ViewGroup ) bindIndicationArea(notificationPanel) bindLockIconView(notificationPanel) } fun bindIndicationArea(legacyParent: ViewGroup) { Loading @@ -74,4 +75,16 @@ constructor( indicationController ) } private fun bindLockIconView(legacyParent: ViewGroup) { if (featureFlags.isEnabled(Flags.MIGRATE_LOCK_ICON)) { legacyParent.requireViewById<View>(R.id.lock_icon_view).let { legacyParent.removeView(it) } } else { keyguardRootView.findViewById<View?>(R.id.lock_icon_view)?.let { keyguardRootView.removeView(it) } } } } Loading
packages/SystemUI/res/layout/status_bar_expanded.xml +0 −15 Original line number Diff line number Diff line Loading @@ -132,21 +132,6 @@ android:id="@+id/lock_icon_view" android:layout_width="wrap_content" android:layout_height="wrap_content"> <!-- Background protection --> <ImageView android:id="@+id/lock_icon_bg" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fingerprint_bg" android:visibility="invisible"/> <ImageView android:id="@+id/lock_icon" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:scaleType="centerCrop"/> </com.android.keyguard.LockIconView> <include Loading
packages/SystemUI/res/values/ids.xml +2 −0 Original line number Diff line number Diff line Loading @@ -211,4 +211,6 @@ <item type="id" name="keyguard_indication_area" /> <item type="id" name="keyguard_indication_text" /> <item type="id" name="keyguard_indication_text_bottom" /> <item type="id" name="lock_icon" /> <item type="id" name="lock_icon_bg" /> </resources>
packages/SystemUI/src/com/android/keyguard/LockIconView.java +29 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.keyguard; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; Loading @@ -23,6 +25,7 @@ import android.graphics.Point; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; Loading Loading @@ -68,13 +71,9 @@ public class LockIconView extends FrameLayout implements Dumpable { public LockIconView(Context context, AttributeSet attrs) { super(context, attrs); mSensorRect = new RectF(); } @Override public void onFinishInflate() { super.onFinishInflate(); mLockIcon = findViewById(R.id.lock_icon); mBgView = findViewById(R.id.lock_icon_bg); addBgImageView(context, attrs); addLockIconImageView(context, attrs); } void setDozeAmount(float dozeAmount) { Loading Loading @@ -184,6 +183,30 @@ public class LockIconView extends FrameLayout implements Dumpable { mLockIcon.setImageState(getLockIconState(mIconType, mAod), true); } private void addLockIconImageView(Context context, AttributeSet attrs) { mLockIcon = new ImageView(context, attrs); mLockIcon.setId(R.id.lock_icon); mLockIcon.setScaleType(ImageView.ScaleType.CENTER_CROP); addView(mLockIcon); LayoutParams lp = (LayoutParams) mLockIcon.getLayoutParams(); lp.height = MATCH_PARENT; lp.width = MATCH_PARENT; lp.gravity = Gravity.CENTER; mLockIcon.setLayoutParams(lp); } private void addBgImageView(Context context, AttributeSet attrs) { mBgView = new ImageView(context, attrs); mBgView.setId(R.id.lock_icon_bg); mBgView.setImageDrawable(context.getDrawable(R.drawable.fingerprint_bg)); mBgView.setVisibility(View.INVISIBLE); addView(mBgView); LayoutParams lp = (LayoutParams) mBgView.getLayoutParams(); lp.height = MATCH_PARENT; lp.width = MATCH_PARENT; mBgView.setLayoutParams(lp); } private static int[] getLockIconState(@IconType int icon, boolean aod) { if (icon == ICON_NONE) { return new int[0]; Loading
packages/SystemUI/src/com/android/systemui/flags/Flags.kt +8 −0 Original line number Diff line number Diff line Loading @@ -249,11 +249,19 @@ object Flags { @JvmField val DELAY_BOUNCER = unreleasedFlag(235, "delay_bouncer", teamfood = true) /** Keyguard Migration */ /** Migrate the indication area to the new keyguard root view. */ // TODO(b/280067944): Tracking bug. @JvmField val MIGRATE_INDICATION_AREA = unreleasedFlag(236, "migrate_indication_area", teamfood = true) /** Migrate the lock icon view to the new keyguard root view. */ // TODO(b/286552209): Tracking bug. @JvmField val MIGRATE_LOCK_ICON = unreleasedFlag(238, "migrate_lock_icon") /** Whether to listen for fingerprint authentication over keyguard occluding activities. */ // TODO(b/283260512): Tracking bug. @JvmField Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt +15 −2 Original line number Diff line number Diff line Loading @@ -47,9 +47,10 @@ constructor( private var indicationAreaHandle: DisposableHandle? = null override fun start() { bindIndicationArea( val notificationPanel = notificationShadeWindowView.requireViewById(R.id.notification_panel) as ViewGroup ) bindIndicationArea(notificationPanel) bindLockIconView(notificationPanel) } fun bindIndicationArea(legacyParent: ViewGroup) { Loading @@ -74,4 +75,16 @@ constructor( indicationController ) } private fun bindLockIconView(legacyParent: ViewGroup) { if (featureFlags.isEnabled(Flags.MIGRATE_LOCK_ICON)) { legacyParent.requireViewById<View>(R.id.lock_icon_view).let { legacyParent.removeView(it) } } else { keyguardRootView.findViewById<View?>(R.id.lock_icon_view)?.let { keyguardRootView.removeView(it) } } } }