Skip to content

Commit 9b1db68

Browse files
author
Jim Miller
committed
Fix issue where security view sometimes doesn't show.
Since the code is now very careful about loading layouts, we sometimes get into a situation where the security view isn't shown. This CL ensures the security method is shown at least once when the view is inflated. Change-Id: If80a46adb868d92194610eccaf9d8d6c2a2c5b3d
1 parent a71984f commit 9b1db68

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

core/res/res/layout-land/keyguard_host_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<View android:layout_width="match_parent"
4747
android:layout_height="match_parent"
48-
android:layout_childType="scrim"
48+
androidprv:layout_childType="scrim"
4949
android:background="#99000000" />
5050

5151
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer

core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
android:layout_width="wrap_content"
2222
android:layout_height="wrap_content"
2323
android:layout_gravity="center" />
24-
</merge>
24+
</merge>

core/res/res/values/dimens.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,6 @@
245245
<!-- TEMP -->
246246
<dimen name="kg_security_panel_height">600dp</dimen>
247247

248-
<!-- Width of security view in keyguard. -->
249-
<dimen name="kg_glow_pad_size">500dp</dimen>
250-
251248
<!-- Height of security view in keyguard. -->
252249
<dimen name="kg_security_view_height">0dp</dimen>
253250

core/res/res/values/styles.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,7 +2479,8 @@ please see styles_device_defaults.xml.
24792479
</style>
24802480

24812481
<!-- Keyguard PIN pad styles -->
2482-
<style name="Widget.Button.NumPadKey">
2482+
<style name="Widget.Button.NumPadKey"
2483+
parent="@android:style/Widget.Button">
24832484
<item name="android:singleLine">true</item>
24842485
<item name="android:padding">6dip</item>
24852486
<item name="android:gravity">left|center_vertical</item>
@@ -2489,7 +2490,8 @@ please see styles_device_defaults.xml.
24892490
<item name="android:textStyle">normal</item>
24902491
<item name="android:textColor">#ffffff</item>
24912492
</style>
2492-
<style name="TextAppearance.NumPadKey">
2493+
<style name="TextAppearance.NumPadKey"
2494+
parent="@android:style/TextAppearance">
24932495
<item name="android:textSize">34dp</item>
24942496
<item name="android:fontFamily">sans-serif</item>
24952497
<item name="android:textStyle">normal</item>

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,13 @@ protected void onFinishInflate() {
181181

182182
mViewStateManager.showUsabilityHints();
183183

184-
updateSecurityViews();
185184
if (!(mContext instanceof Activity)) {
186185
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
187186
}
188187

189-
if (KeyguardUpdateMonitor.getInstance(mContext).getIsFirstBoot()) {
190-
showPrimarySecurityScreen(false);
191-
}
188+
showPrimarySecurityScreen(false);
189+
190+
updateSecurityViews();
192191
}
193192

194193
private void updateSecurityViews() {
@@ -426,7 +425,8 @@ private void reportFailedUnlockAttempt() {
426425
void showPrimarySecurityScreen(boolean turningOff) {
427426
SecurityMode securityMode = mSecurityModel.getSecurityMode();
428427
if (DEBUG) Log.v(TAG, "showPrimarySecurityScreen(turningOff=" + turningOff + ")");
429-
if (!turningOff && KeyguardUpdateMonitor.getInstance(mContext).isAlternateUnlockEnabled()) {
428+
if (!turningOff && KeyguardUpdateMonitor.getInstance(mContext).isAlternateUnlockEnabled()
429+
&& !KeyguardUpdateMonitor.getInstance(mContext).getIsFirstBoot()) {
430430
// If we're not turning off, then allow biometric alternate.
431431
// We'll reload it when the device comes back on.
432432
securityMode = mSecurityModel.getAlternateFor(securityMode);

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
*/
9696
public class KeyguardViewMediator {
9797
private static final int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000;
98-
final static boolean DEBUG = true;
98+
final static boolean DEBUG = false;
9999
private final static boolean DBG_WAKE = false;
100100

101101
private final static String TAG = "KeyguardViewMediator";

0 commit comments

Comments
 (0)