Skip to content

Commit 5c12bc5

Browse files
author
Ed Heyl
committed
Merge remote-tracking branch 'goog/jb-mr1-lockscreen-dev' into jb-mr1-dev
2 parents 20329dc + a371e53 commit 5c12bc5

26 files changed

+589
-193
lines changed

core/java/com/android/internal/policy/IFaceLockInterface.aidl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ interface IFaceLockInterface {
2323
void startUi(IBinder containingWindowToken, int x, int y, int width, int height,
2424
boolean useLiveliness);
2525
void stopUi();
26-
void makeInvisible();
2726
void registerCallback(IFaceLockCallback cb);
2827
void unregisterCallback(IFaceLockCallback cb);
2928
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.widget;
18+
19+
import android.content.Context;
20+
import android.util.AttributeSet;
21+
import android.util.Log;
22+
import android.view.View;
23+
import android.widget.RelativeLayout;
24+
25+
public class FaceUnlockView extends RelativeLayout {
26+
private static final String TAG = "FaceUnlockView";
27+
28+
public FaceUnlockView(Context context) {
29+
this(context, null);
30+
}
31+
32+
public FaceUnlockView(Context context, AttributeSet attrs) {
33+
super(context, attrs);
34+
}
35+
36+
private int resolveMeasured(int measureSpec, int desired)
37+
{
38+
int result = 0;
39+
int specSize = MeasureSpec.getSize(measureSpec);
40+
switch (MeasureSpec.getMode(measureSpec)) {
41+
case MeasureSpec.UNSPECIFIED:
42+
result = desired;
43+
break;
44+
case MeasureSpec.AT_MOST:
45+
result = Math.max(specSize, desired);
46+
break;
47+
case MeasureSpec.EXACTLY:
48+
default:
49+
result = specSize;
50+
}
51+
return result;
52+
}
53+
54+
@Override
55+
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
56+
final int minimumWidth = getSuggestedMinimumWidth();
57+
final int minimumHeight = getSuggestedMinimumHeight();
58+
int viewWidth = resolveMeasured(widthMeasureSpec, minimumWidth);
59+
int viewHeight = resolveMeasured(heightMeasureSpec, minimumHeight);
60+
61+
final int chosenSize = Math.min(viewWidth, viewHeight);
62+
final int newWidthMeasureSpec =
63+
MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);
64+
final int newHeightMeasureSpec =
65+
MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);
66+
67+
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
68+
}
69+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050

5151
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
5252
android:id="@+id/keyguard_security_container"
53-
android:layout_width="wrap_content"
54-
android:layout_height="wrap_content"
53+
android:layout_width="@dimen/keyguard_security_width"
54+
android:layout_height="@dimen/keyguard_security_height"
5555
androidprv:layout_childType="challenge"
5656
androidprv:layout_centerWithinArea="0.55">
5757
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
5858
android:id="@+id/view_flipper"
59-
android:layout_width="wrap_content"
60-
android:layout_height="wrap_content"
59+
android:layout_width="match_parent"
60+
android:layout_height="match_parent"
6161
android:clipChildren="false"
6262
android:clipToPadding="false"
6363
android:paddingLeft="@dimen/keyguard_security_view_margin"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@
5151

5252
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
5353
android:id="@+id/keyguard_security_container"
54-
android:layout_width="wrap_content"
55-
android:layout_height="wrap_content"
54+
android:layout_width="@dimen/keyguard_security_width"
55+
android:layout_height="@dimen/keyguard_security_height"
5656
androidprv:layout_childType="challenge"
5757
android:layout_marginLeft="@dimen/kg_edge_swipe_region_size"
5858
android:layout_marginRight="@dimen/kg_edge_swipe_region_size"
5959
android:background="@drawable/kg_bouncer_bg_white"
6060
android:gravity="bottom|center_horizontal">
6161
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
6262
android:id="@+id/view_flipper"
63-
android:layout_width="wrap_content"
64-
android:layout_height="wrap_content"
63+
android:layout_width="match_parent"
64+
android:layout_height="match_parent"
6565
android:clipChildren="false"
6666
android:clipToPadding="false"
6767
android:paddingLeft="@dimen/keyguard_security_view_margin"

core/res/res/layout/keyguard_face_unlock_view.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
android:layout_height="wrap_content"
3131
/>
3232

33-
<RelativeLayout
33+
<com.android.internal.widget.FaceUnlockView
3434
android:id="@+id/face_unlock_area_view"
3535
android:layout_width="match_parent"
36-
android:layout_height="@*android:dimen/face_unlock_height"
36+
android:layout_height="0dp"
3737
android:background="@*android:drawable/intro_bg"
3838
android:gravity="center"
3939
android:layout_weight="1">
@@ -55,8 +55,7 @@
5555
android:background="#00000000"
5656
android:src="@*android:drawable/ic_facial_backup"
5757
/>
58-
59-
</RelativeLayout>
58+
</com.android.internal.widget.FaceUnlockView>
6059

6160
<include layout="@layout/keyguard_emergency_carrier_area"
6261
android:id="@+id/keyguard_selector_fade_container"

core/res/res/layout/keyguard_password_view.xml

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,73 +22,61 @@
2222
android:orientation="vertical"
2323
android:layout_width="match_parent"
2424
android:layout_height="match_parent"
25-
android:layout_gravity="center">
25+
android:gravity="bottom"
26+
>
2627

27-
<FrameLayout
28+
<Space
2829
android:layout_width="match_parent"
2930
android:layout_height="0dp"
30-
android:layout_weight="1">
31+
android:layout_weight="1"
32+
/>
3133

32-
<include layout="@layout/keyguard_message_area"
33-
android:layout_width="match_parent"
34-
android:layout_height="wrap_content"
35-
/>
36-
37-
<LinearLayout
38-
android:layout_height="wrap_content"
39-
android:layout_width="match_parent"
40-
android:orientation="vertical"
41-
android:layout_gravity="center">
42-
43-
<LinearLayout
44-
android:layout_width="match_parent"
45-
android:layout_height="wrap_content"
46-
android:orientation="vertical">
34+
<include layout="@layout/keyguard_message_area"
35+
android:layout_width="match_parent"
36+
android:layout_height="wrap_content" />
4737

48-
<!-- Password entry field -->
49-
<!-- Note: the entire container is styled to look like the edit field,
50-
since the backspace/IME switcher looks better inside -->
51-
<LinearLayout
52-
android:layout_gravity="center_vertical|fill_horizontal"
53-
android:layout_height="wrap_content"
54-
android:layout_width="match_parent"
55-
android:orientation="horizontal"
56-
android:background="#70000000"
57-
android:layout_marginStart="4dip"
58-
android:layout_marginEnd="4dip">
38+
<!-- Password entry field -->
39+
<!-- Note: the entire container is styled to look like the edit field,
40+
since the backspace/IME switcher looks better inside -->
41+
<LinearLayout
42+
android:layout_height="wrap_content"
43+
android:layout_width="match_parent"
44+
android:orientation="horizontal"
45+
android:background="#70000000"
46+
android:layout_marginTop="8dp"
47+
android:layout_marginBottom="8dp"
48+
>
5949

60-
<EditText android:id="@+id/passwordEntry"
61-
android:layout_width="0dip"
62-
android:layout_height="wrap_content"
63-
android:layout_weight="1"
64-
android:gravity="center_horizontal"
65-
android:layout_gravity="center_vertical"
66-
android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
67-
android:singleLine="true"
68-
android:textStyle="normal"
69-
android:inputType="textPassword"
70-
android:textSize="36sp"
71-
android:background="@null"
72-
android:textAppearance="?android:attr/textAppearanceMedium"
73-
android:textColor="#ffffffff"
74-
android:imeOptions="flagForceAscii|actionDone"
75-
/>
50+
<EditText android:id="@+id/passwordEntry"
51+
android:layout_width="0dip"
52+
android:layout_height="wrap_content"
53+
android:layout_weight="1"
54+
android:gravity="center_horizontal"
55+
android:layout_gravity="center_vertical"
56+
android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
57+
android:singleLine="true"
58+
android:textStyle="normal"
59+
android:inputType="textPassword"
60+
android:textSize="36sp"
61+
android:background="@null"
62+
android:textAppearance="?android:attr/textAppearanceMedium"
63+
android:textColor="#ffffffff"
64+
android:imeOptions="flagForceAscii|actionDone"
65+
/>
7666

77-
<ImageView android:id="@+id/switch_ime_button"
78-
android:layout_width="wrap_content"
79-
android:layout_height="wrap_content"
80-
android:src="@*android:drawable/ic_lockscreen_ime"
81-
android:clickable="true"
82-
android:padding="8dip"
83-
android:layout_gravity="center"
84-
android:background="?android:attr/selectableItemBackground"
85-
android:visibility="gone"
86-
/>
67+
<ImageView android:id="@+id/switch_ime_button"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
70+
android:src="@*android:drawable/ic_lockscreen_ime"
71+
android:clickable="true"
72+
android:padding="8dip"
73+
android:layout_gravity="center"
74+
android:background="?android:attr/selectableItemBackground"
75+
android:visibility="gone"
76+
/>
8777

88-
</LinearLayout>
89-
</LinearLayout>
9078
</LinearLayout>
91-
</FrameLayout>
79+
9280
<include layout="@layout/keyguard_emergency_carrier_area"
9381
android:id="@+id/keyguard_selector_fade_container"
9482
android:layout_width="match_parent"

core/res/res/layout/keyguard_pin_view.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
xmlns:android="http://schemas.android.com/apk/res/android"
2222
xmlns:androidprv="http://schemas.android.com/apk/res/android"
2323
android:id="@+id/keyguard_pin_view"
24-
android:layout_width="350dp"
25-
android:layout_height="350dp"
24+
android:layout_width="match_parent"
25+
android:layout_height="match_parent"
2626
android:orientation="vertical"
2727
>
2828
<include layout="@layout/keyguard_message_area"
@@ -35,7 +35,7 @@
3535
android:orientation="horizontal"
3636
android:layout_weight="1"
3737
>
38-
<TextView android:id="@+id/passwordEntry"
38+
<TextView android:id="@+id/pinEntry"
3939
android:editable="true"
4040
android:layout_width="0dip"
4141
android:layout_height="match_parent"
@@ -78,7 +78,7 @@
7878
android:layout_width="0px"
7979
android:layout_height="match_parent"
8080
android:layout_weight="1"
81-
androidprv:textView="@+id/passwordEntry"
81+
androidprv:textView="@+id/pinEntry"
8282
androidprv:digit="1"
8383
/>
8484
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -87,7 +87,7 @@
8787
android:layout_width="0px"
8888
android:layout_height="match_parent"
8989
android:layout_weight="1"
90-
androidprv:textView="@+id/passwordEntry"
90+
androidprv:textView="@+id/pinEntry"
9191
androidprv:digit="2"
9292
/>
9393
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -96,7 +96,7 @@
9696
android:layout_width="0px"
9797
android:layout_height="match_parent"
9898
android:layout_weight="1"
99-
androidprv:textView="@+id/passwordEntry"
99+
androidprv:textView="@+id/pinEntry"
100100
androidprv:digit="3"
101101
/>
102102
</LinearLayout>
@@ -112,7 +112,7 @@
112112
android:layout_width="0px"
113113
android:layout_height="match_parent"
114114
android:layout_weight="1"
115-
androidprv:textView="@+id/passwordEntry"
115+
androidprv:textView="@+id/pinEntry"
116116
androidprv:digit="4"
117117
/>
118118
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -121,7 +121,7 @@
121121
android:layout_width="0px"
122122
android:layout_height="match_parent"
123123
android:layout_weight="1"
124-
androidprv:textView="@+id/passwordEntry"
124+
androidprv:textView="@+id/pinEntry"
125125
androidprv:digit="5"
126126
/>
127127
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -130,7 +130,7 @@
130130
android:layout_width="0px"
131131
android:layout_height="match_parent"
132132
android:layout_weight="1"
133-
androidprv:textView="@+id/passwordEntry"
133+
androidprv:textView="@+id/pinEntry"
134134
androidprv:digit="6"
135135
/>
136136
</LinearLayout>
@@ -146,7 +146,7 @@
146146
android:layout_width="0px"
147147
android:layout_height="match_parent"
148148
android:layout_weight="1"
149-
androidprv:textView="@+id/passwordEntry"
149+
androidprv:textView="@+id/pinEntry"
150150
androidprv:digit="7"
151151
/>
152152
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -155,7 +155,7 @@
155155
android:layout_width="0px"
156156
android:layout_height="match_parent"
157157
android:layout_weight="1"
158-
androidprv:textView="@+id/passwordEntry"
158+
androidprv:textView="@+id/pinEntry"
159159
androidprv:digit="8"
160160
/>
161161
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -164,7 +164,7 @@
164164
android:layout_width="0px"
165165
android:layout_height="match_parent"
166166
android:layout_weight="1"
167-
androidprv:textView="@+id/passwordEntry"
167+
androidprv:textView="@+id/pinEntry"
168168
androidprv:digit="9"
169169
/>
170170
</LinearLayout>
@@ -185,7 +185,7 @@
185185
android:layout_width="0px"
186186
android:layout_height="match_parent"
187187
android:layout_weight="1"
188-
androidprv:textView="@+id/passwordEntry"
188+
androidprv:textView="@+id/pinEntry"
189189
androidprv:digit="0"
190190
/>
191191
<ImageButton
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
**
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License")
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<resources>
21+
<!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
22+
<dimen name="keyguard_security_width">340dp</dimen>
23+
</resources>

0 commit comments

Comments
 (0)