summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/res/res/layout-land/keyguard_host_view.xml3
-rw-r--r--core/res/res/layout-land/keyguard_status_area.xml87
-rw-r--r--core/res/res/layout-port/keyguard_host_view.xml13
-rw-r--r--core/res/res/layout-port/keyguard_status_area.xml90
-rw-r--r--core/res/res/layout-sw600dp-port/keyguard_host_view.xml3
-rw-r--r--core/res/res/layout-sw600dp-port/keyguard_status_area.xml75
-rw-r--r--core/res/res/layout-sw600dp/keyguard_navigation.xml21
-rw-r--r--core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml21
-rw-r--r--core/res/res/layout/default_navigation.xml35
-rw-r--r--core/res/res/layout/empty_navigation.xml19
-rw-r--r--core/res/res/layout/keyguard_emergency_carrier_area.xml3
-rw-r--r--core/res/res/layout/keyguard_face_unlock_view.xml19
-rw-r--r--core/res/res/layout/keyguard_navigation.xml20
-rw-r--r--core/res/res/layout/keyguard_password_view.xml162
-rw-r--r--core/res/res/layout/keyguard_pattern_view.xml73
-rw-r--r--core/res/res/layout/keyguard_selector_view.xml11
-rw-r--r--core/res/res/layout/keyguard_sim_pin_view.xml129
-rw-r--r--core/res/res/layout/keyguard_sim_puk_pin_navigation.xml21
-rw-r--r--core/res/res/layout/keyguard_sim_puk_view.xml129
-rw-r--r--core/res/res/layout/keyguard_status_view.xml60
-rw-r--r--core/res/res/layout/keyguard_widget_region.xml3
-rw-r--r--core/res/res/values-land/bools.xml20
-rw-r--r--core/res/res/values-port/bools.xml2
-rw-r--r--core/res/res/values-sw380dp-land/dimens.xml2
-rw-r--r--core/res/res/values-sw600dp/bools.xml2
-rw-r--r--core/res/res/values/dimens.xml12
-rw-r--r--core/res/res/values/symbols.xml4
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java11
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java7
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java83
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardNavigationManager.java16
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java15
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java15
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java2
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java1
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java8
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java17
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java17
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java3
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusViewManager.java126
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java21
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java15
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java8
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/PagedView.java16
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java25
45 files changed, 1015 insertions, 430 deletions
diff --git a/core/res/res/layout-land/keyguard_host_view.xml b/core/res/res/layout-land/keyguard_host_view.xml
index 6003b42..521853f 100644
--- a/core/res/res/layout-land/keyguard_host_view.xml
+++ b/core/res/res/layout-land/keyguard_host_view.xml
@@ -45,9 +45,6 @@
android:paddingBottom="@dimen/keyguard_security_view_margin"
android:gravity="center">
- <!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
- <include layout="@layout/keyguard_selector_view"/>
-
</com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
</com.android.internal.policy.impl.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-land/keyguard_status_area.xml b/core/res/res/layout-land/keyguard_status_area.xml
new file mode 100644
index 0000000..78bf931
--- /dev/null
+++ b/core/res/res/layout-land/keyguard_status_area.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- This is a view that shows general status information in Keyguard. -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_status_area"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginTop="-16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="@dimen/kg_status_date_font_size"
+ />
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_gravity="end"
+ android:layout_marginTop="28dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ android:drawablePadding="4dip"
+ />
+
+ <TextView
+ android:id="@+id/owner_info"
+ android:layout_gravity="end"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+ <TextView
+ android:id="@+id/status1"
+ android:layout_gravity="end"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+ <TextView
+ android:id="@+id/status_security_message"
+ android:layout_gravity="center"
+ android:gravity="right"
+ android:layout_marginTop="12dp"
+ android:singleLine="false"
+ android:maxLines="3"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="16dp"
+ />
+</LinearLayout> \ No newline at end of file
diff --git a/core/res/res/layout-port/keyguard_host_view.xml b/core/res/res/layout-port/keyguard_host_view.xml
index 58e108c..3ce9365 100644
--- a/core/res/res/layout-port/keyguard_host_view.xml
+++ b/core/res/res/layout-port/keyguard_host_view.xml
@@ -27,21 +27,22 @@
android:gravity="center_horizontal"
android:orientation="vertical">
+ <include layout="@layout/keyguard_widget_region"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="27" />
+
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
- android:layout_height="match_parent"
+ android:layout_height="0dp"
android:clipChildren="false"
android:clipToPadding="false"
+ android:layout_weight="73"
android:paddingLeft="@dimen/keyguard_security_view_margin"
android:paddingTop="@dimen/keyguard_security_view_margin"
android:paddingRight="@dimen/keyguard_security_view_margin"
android:paddingBottom="@dimen/keyguard_security_view_margin"
android:gravity="center">
-
- <!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
- <include layout="@layout/keyguard_selector_view"/>
-
</com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
-
</com.android.internal.policy.impl.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-port/keyguard_status_area.xml b/core/res/res/layout-port/keyguard_status_area.xml
new file mode 100644
index 0000000..00aac7b
--- /dev/null
+++ b/core/res/res/layout-port/keyguard_status_area.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- This is a view that shows general status information in Keyguard. -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_status_area"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="0dp"
+ android:layout_gravity="right">
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="@dimen/kg_status_date_font_size"
+ />
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ android:drawablePadding="4dip"
+ />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/owner_info"
+ android:layout_gravity="right"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+ <TextView
+ android:id="@+id/status1"
+ android:layout_gravity="right"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+ <TextView
+ android:id="@+id/status_security_message"
+ android:layout_gravity="right"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+</LinearLayout> \ No newline at end of file
diff --git a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
index a3e9b59..23c1e9c 100644
--- a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
+++ b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
@@ -45,8 +45,7 @@
android:paddingBottom="@dimen/keyguard_security_view_margin"
android:layout_gravity="center">
- <!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
- <include layout="@layout/keyguard_selector_view"/>
+
</com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
diff --git a/core/res/res/layout-sw600dp-port/keyguard_status_area.xml b/core/res/res/layout-sw600dp-port/keyguard_status_area.xml
new file mode 100644
index 0000000..679aebd
--- /dev/null
+++ b/core/res/res/layout-sw600dp-port/keyguard_status_area.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- This is a view that shows general status information in Keyguard. -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_status_area"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginTop="-16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="@dimen/kg_status_date_font_size"
+ />
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_gravity="end"
+ android:layout_marginTop="28dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ android:drawablePadding="4dip"
+ />
+
+ <TextView
+ android:id="@+id/owner_info"
+ android:layout_gravity="end"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+
+ <TextView
+ android:id="@+id/status1"
+ android:layout_gravity="end"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearance"
+ android:textSize="@dimen/kg_status_line_font_size"
+ />
+</LinearLayout> \ No newline at end of file
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/core/res/res/layout-sw600dp/keyguard_navigation.xml
new file mode 100644
index 0000000..2e6fa37
--- /dev/null
+++ b/core/res/res/layout-sw600dp/keyguard_navigation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include layout="@layout/default_navigation" />
+</merge>
diff --git a/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml b/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml
new file mode 100644
index 0000000..2e6fa37
--- /dev/null
+++ b/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include layout="@layout/default_navigation" />
+</merge>
diff --git a/core/res/res/layout/default_navigation.xml b/core/res/res/layout/default_navigation.xml
new file mode 100644
index 0000000..b13103c
--- /dev/null
+++ b/core/res/res/layout/default_navigation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_click_area"
+ android:gravity="center">
+
+ <!-- message area for security screen -->
+ <TextView
+ android:id="@+id/keyguard_message_area"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="start"
+ android:ellipsize="marquee"
+ android:layout_marginEnd="4dip"
+ android:layout_marginStart="4dip"
+ android:textSize="22dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/core/res/res/layout/empty_navigation.xml b/core/res/res/layout/empty_navigation.xml
new file mode 100644
index 0000000..6422070
--- /dev/null
+++ b/core/res/res/layout/empty_navigation.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android" /> \ No newline at end of file
diff --git a/core/res/res/layout/keyguard_emergency_carrier_area.xml b/core/res/res/layout/keyguard_emergency_carrier_area.xml
index 62cbac4..c16955c 100644
--- a/core/res/res/layout/keyguard_emergency_carrier_area.xml
+++ b/core/res/res/layout/keyguard_emergency_carrier_area.xml
@@ -24,6 +24,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
+ android:layout_gravity="center_horizontal"
android:layout_alignParentBottom="true">
<com.android.internal.policy.impl.keyguard.CarrierText
@@ -33,7 +34,6 @@
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
- android:layout_marginLeft="@dimen/kg_emergency_button_shift"
android:textColor="?android:attr/textColorSecondary"/>
<com.android.internal.policy.impl.keyguard.EmergencyButton
@@ -46,7 +46,6 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
- android:layout_marginLeft="@dimen/kg_emergency_button_shift"
android:drawablePadding="8dip" />
</LinearLayout>
diff --git a/core/res/res/layout/keyguard_face_unlock_view.xml b/core/res/res/layout/keyguard_face_unlock_view.xml
index e25d035..845c265 100644
--- a/core/res/res/layout/keyguard_face_unlock_view.xml
+++ b/core/res/res/layout/keyguard_face_unlock_view.xml
@@ -27,17 +27,13 @@
<include layout="@layout/keyguard_navigation"/>
- <Space
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
-
<RelativeLayout
android:id="@+id/face_unlock_area_view"
android:layout_width="match_parent"
- android:layout_height="@dimen/face_unlock_height"
- android:background="@drawable/intro_bg"
- android:gravity="center">
+ android:layout_height="@*android:dimen/face_unlock_height"
+ android:background="@*android:drawable/intro_bg"
+ android:gravity="center"
+ android:layout_weight="1">
<View
android:id="@+id/spotlightMask"
@@ -59,4 +55,11 @@
</RelativeLayout>
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
</com.android.internal.policy.impl.keyguard.KeyguardFaceUnlockView>
diff --git a/core/res/res/layout/keyguard_navigation.xml b/core/res/res/layout/keyguard_navigation.xml
index c29dc70..8230c52 100644
--- a/core/res/res/layout/keyguard_navigation.xml
+++ b/core/res/res/layout/keyguard_navigation.xml
@@ -16,20 +16,6 @@
** limitations under the License.
*/
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/keyguard_click_area"
- android:gravity="center">
-
- <!-- message area for security screen -->
- <TextView
- android:id="@+id/keyguard_message_area"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="start"
- android:ellipsize="marquee"
- android:layout_marginEnd="4dip"
- android:layout_marginStart="4dip"
- android:textSize="22dip"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
-</LinearLayout>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include layout="@layout/empty_navigation" />
+</merge>
diff --git a/core/res/res/layout/keyguard_password_view.xml b/core/res/res/layout/keyguard_password_view.xml
index f7071d2..92a7551 100644
--- a/core/res/res/layout/keyguard_password_view.xml
+++ b/core/res/res/layout/keyguard_password_view.xml
@@ -22,88 +22,106 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center_horizontal">
+ android:layout_gravity="center">
- <LinearLayout
- android:layout_height="0dip"
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center">
+ android:layout_height="match_parent">
- <include layout="@layout/keyguard_navigation"/>
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="center">
- </LinearLayout>
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:gravity="center">
+ <include layout="@layout/keyguard_navigation"/>
+ </LinearLayout>
- <!-- Password entry field -->
- <!-- Note: the entire container is styled to look like the edit field,
- since the backspace/IME switcher looks better inside -->
- <LinearLayout
- android:layout_gravity="center_vertical|fill_horizontal"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- android:background="#70000000"
- android:layout_marginStart="4dip"
- android:layout_marginEnd="4dip">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
- <EditText android:id="@+id/passwordEntry"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:gravity="center_horizontal"
- android:layout_gravity="center_vertical"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:singleLine="true"
- android:textStyle="normal"
- android:inputType="textPassword"
- android:textSize="36sp"
- android:background="@null"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="#ffffffff"
- android:imeOptions="flagForceAscii|actionDone"
- />
+ <!-- Password entry field -->
+ <!-- Note: the entire container is styled to look like the edit field,
+ since the backspace/IME switcher looks better inside -->
+ <LinearLayout
+ android:layout_gravity="center_vertical|fill_horizontal"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:background="#70000000"
+ android:layout_marginStart="4dip"
+ android:layout_marginEnd="4dip">
- <!-- This delete button is only visible for numeric PIN entry -->
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
- android:clickable="true"
- android:padding="8dip"
- android:background="?android:attr/selectableItemBackground"
- android:visibility="gone"
- />
+ <EditText android:id="@+id/passwordEntry"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:singleLine="true"
+ android:textStyle="normal"
+ android:inputType="textPassword"
+ android:textSize="36sp"
+ android:background="@null"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="#ffffffff"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
- <ImageView android:id="@+id/switch_ime_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@*android:drawable/ic_lockscreen_ime"
- android:clickable="true"
- android:padding="8dip"
- android:layout_gravity="center"
- android:background="?android:attr/selectableItemBackground"
- android:visibility="gone"
- />
+ <!-- This delete button is only visible for numeric PIN entry -->
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:src="@*android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:padding="8dip"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"
+ />
- </LinearLayout>
+ <ImageView android:id="@+id/switch_ime_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@*android:drawable/ic_lockscreen_ime"
+ android:clickable="true"
+ android:padding="8dip"
+ android:layout_gravity="center"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"
+ />
- <!-- Numeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_width="match_parent"
- android:layout_marginStart="4dip"
- android:layout_marginEnd="4dip"
- android:paddingTop="4dip"
- android:paddingBottom="4dip"
- android:background="#40000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
- android:visibility="gone"
- android:clickable="true"
- />
+ </LinearLayout>
- <Space
- android:layout_width="match_parent"
- android:layout_height="@dimen/kg_secure_padding_height"
- android:background="@drawable/lockscreen_protection_pattern" />
+ <!-- Numeric keyboard -->
+ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dip"
+ android:layout_marginEnd="4dip"
+ android:paddingTop="4dip"
+ android:paddingBottom="4dip"
+ android:background="#40000000"
+ android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
+ android:visibility="gone"
+ android:clickable="true"
+ />
+ </LinearLayout>
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
+ </LinearLayout>
+ </FrameLayout>
</com.android.internal.policy.impl.keyguard.KeyguardPasswordView>
diff --git a/core/res/res/layout/keyguard_pattern_view.xml b/core/res/res/layout/keyguard_pattern_view.xml
index 311f77f..47dea9f 100644
--- a/core/res/res/layout/keyguard_pattern_view.xml
+++ b/core/res/res/layout/keyguard_pattern_view.xml
@@ -28,39 +28,56 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
- <LinearLayout
- android:layout_height="0dip"
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center">
+ android:layout_height="match_parent">
- <include layout="@layout/keyguard_navigation"/>
-
- <Button android:id="@+id/forgot_password_button"
- android:layout_width="wrap_content"
+ <LinearLayout
android:layout_height="wrap_content"
- android:textSize="@dimen/kg_status_line_font_size"
- android:visibility="gone"/>
+ android:layout_width="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="center">
- </LinearLayout>
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:gravity="center">
- <!-- We need MATCH_PARENT here only to force the size of the parent to be passed to
- the pattern view for it to compute its size. This is an unusual case, caused by
- LockPatternView's requirement to maintain a square aspect ratio based on the width
- of the screen. -->
- <com.android.internal.widget.LockPatternView
- android:id="@+id/lockPatternView"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginEnd="8dip"
- android:layout_marginBottom="4dip"
- android:layout_marginStart="8dip"
- android:layout_gravity="center_horizontal" />
+ <include layout="@layout/keyguard_navigation"/>
- <Space
- android:layout_width="match_parent"
- android:layout_height="@dimen/kg_secure_padding_height"
- android:background="@drawable/lockscreen_protection_pattern" />
+ <Button android:id="@+id/forgot_password_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="@dimen/kg_status_line_font_size"
+ android:visibility="gone"/>
+
+ </LinearLayout>
+
+ <!-- We need MATCH_PARENT here only to force the size of the parent to be passed to
+ the pattern view for it to compute its size. This is an unusual case, caused by
+ LockPatternView's requirement to maintain a square aspect ratio based on the width
+ of the screen. -->
+ <com.android.internal.widget.LockPatternView
+ android:id="@+id/lockPatternView"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:layout_marginEnd="8dip"
+ android:layout_marginBottom="4dip"
+ android:layout_marginStart="8dip"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center" />
+
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
+
+ </LinearLayout>
+ </FrameLayout>
</com.android.internal.policy.impl.keyguard.KeyguardPatternView>
diff --git a/core/res/res/layout/keyguard_selector_view.xml b/core/res/res/layout/keyguard_selector_view.xml
index 3d3c504..4838c2a 100644
--- a/core/res/res/layout/keyguard_selector_view.xml
+++ b/core/res/res/layout/keyguard_selector_view.xml
@@ -28,15 +28,9 @@
android:clipToPadding="false"
android:orientation="vertical">
- <include layout="@layout/keyguard_widget_region"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="0.45" />
-
<FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="0dip"
- android:layout_weight="0.55"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="center"
android:clipChildren="false"
android:clipToPadding="false"
@@ -51,7 +45,6 @@
android:orientation="vertical"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-
</FrameLayout>
</com.android.internal.policy.impl.keyguard.KeyguardSelectorView>
diff --git a/core/res/res/layout/keyguard_sim_pin_view.xml b/core/res/res/layout/keyguard_sim_pin_view.xml
index 91dd6d0..82268ad 100644
--- a/core/res/res/layout/keyguard_sim_pin_view.xml
+++ b/core/res/res/layout/keyguard_sim_pin_view.xml
@@ -26,78 +26,87 @@
android:gravity="center_horizontal">
<LinearLayout
- android:layout_height="0dip"
android:layout_width="match_parent"
+ android:layout_height="0dp"
android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center">
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_lockscreen_sim"/>
+ android:orientation="vertical">
- <include layout="@layout/keyguard_navigation"/>
+ <LinearLayout
+ android:layout_height="0dip"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:gravity="center">
- </LinearLayout>
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_lockscreen_sim"/>
- <!-- Password entry field -->
- <!-- Note: the entire container is styled to look like the edit field,
- since the backspace/IME switcher looks better inside -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginEnd="4dip"
- android:layout_marginStart="4dip"
- android:gravity="center_vertical"
- android:background="#70000000">
+ <include layout="@layout/keyguard_sim_puk_pin_navigation"/>
+ </LinearLayout>
- <!-- displays dots as user enters pin -->
- <EditText android:id="@+id/sim_pin_entry"
- android:layout_width="0dip"
+ <!-- Password entry field -->
+ <!-- Note: the entire container is styled to look like the edit field,
+ since the backspace/IME switcher looks better inside -->
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:singleLine="true"
- android:gravity="center_horizontal"
- android:layout_gravity="center_vertical"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:textStyle="normal"
- android:inputType="textPassword"
- android:textSize="36sp"
- android:background="@null"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="#ffffffff"
- android:imeOptions="flagForceAscii|actionDone"
- />
+ android:orientation="horizontal"
+ android:layout_marginEnd="4dip"
+ android:layout_marginStart="4dip"
+ android:gravity="center_vertical"
+ android:background="#70000000">
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@android:drawable/ic_input_delete"
+ <!-- displays dots as user enters pin -->
+ <EditText android:id="@+id/sim_pin_entry"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:maxLines="1"
+ android:singleLine="true"
+ android:gravity="center_horizontal"
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:textStyle="normal"
+ android:inputType="textPassword"
+ android:textSize="36sp"
+ android:background="@null"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="#ffffffff"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
+
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:src="@android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:padding="8dip"
+ android:background="?android:attr/selectableItemBackground"
+ />
+ </LinearLayout>
+
+ <!-- Numeric keyboard -->
+ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ android:layout_width="match_parent"
+ android:layout_marginStart="4dip"
+ android:layout_marginEnd="4dip"
+ android:paddingTop="4dip"
+ android:paddingBottom="4dip"
+ android:background="#40000000"
+ android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
android:clickable="true"
- android:padding="8dip"
- android:background="?android:attr/selectableItemBackground"
/>
</LinearLayout>
- <!-- Numeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
- android:layout_marginStart="4dip"
- android:layout_marginEnd="4dip"
- android:paddingTop="4dip"
- android:paddingBottom="4dip"
- android:background="#40000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
- android:clickable="true"
- />
-
- <Space
- android:layout_width="match_parent"
- android:layout_height="@dimen/kg_secure_padding_height"
- android:background="@drawable/lockscreen_protection_pattern" />
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
</com.android.internal.policy.impl.keyguard.KeyguardSimPinView>
diff --git a/core/res/res/layout/keyguard_sim_puk_pin_navigation.xml b/core/res/res/layout/keyguard_sim_puk_pin_navigation.xml
new file mode 100644
index 0000000..2e6fa37
--- /dev/null
+++ b/core/res/res/layout/keyguard_sim_puk_pin_navigation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include layout="@layout/default_navigation" />
+</merge>
diff --git a/core/res/res/layout/keyguard_sim_puk_view.xml b/core/res/res/layout/keyguard_sim_puk_view.xml
index 0c41a34..6404efc 100644
--- a/core/res/res/layout/keyguard_sim_puk_view.xml
+++ b/core/res/res/layout/keyguard_sim_puk_view.xml
@@ -27,78 +27,87 @@
android:gravity="center_horizontal">
<LinearLayout
- android:layout_height="0dip"
android:layout_width="match_parent"
+ android:layout_height="0dp"
android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center">
+ android:orientation="vertical">
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_lockscreen_sim"/>
+ <LinearLayout
+ android:layout_height="0dip"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:gravity="center">
- <include layout="@layout/keyguard_navigation"/>
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_lockscreen_sim"/>
- </LinearLayout>
+ <include layout="@layout/keyguard_sim_puk_pin_navigation"/>
- <!-- Password entry field -->
- <!-- Note: the entire container is styled to look like the edit field,
- since the backspace/IME switcher looks better inside -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginEnd="4dip"
- android:layout_marginStart="4dip"
- android:gravity="center_vertical"
- android:background="#70000000">
+ </LinearLayout>
- <!-- displays dots as user enters pin -->
- <EditText android:id="@+id/sim_pin_entry"
- android:layout_width="0dip"
+ <!-- Password entry field -->
+ <!-- Note: the entire container is styled to look like the edit field,
+ since the backspace/IME switcher looks better inside -->
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:singleLine="true"
- android:gravity="center_horizontal"
- android:layout_gravity="center_vertical"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
- android:textStyle="normal"
- android:inputType="textPassword"
- android:textSize="36sp"
- android:background="@null"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="#ffffffff"
- android:imeOptions="flagForceAscii|actionDone"
- />
+ android:orientation="horizontal"
+ android:layout_marginEnd="4dip"
+ android:layout_marginStart="4dip"
+ android:gravity="center_vertical"
+ android:background="#70000000">
- <ImageButton android:id="@+id/delete_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:src="@android:drawable/ic_input_delete"
+ <!-- displays dots as user enters pin -->
+ <EditText android:id="@+id/sim_pin_entry"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:maxLines="1"
+ android:singleLine="true"
+ android:gravity="center_horizontal"
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:textStyle="normal"
+ android:inputType="textPassword"
+ android:textSize="36sp"
+ android:background="@null"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="#ffffffff"
+ android:imeOptions="flagForceAscii|actionDone"
+ />
+
+ <ImageButton android:id="@+id/delete_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:src="@android:drawable/ic_input_delete"
+ android:clickable="true"
+ android:padding="8dip"
+ android:background="?android:attr/selectableItemBackground"
+ />
+ </LinearLayout>
+
+ <!-- Numeric keyboard -->
+ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ android:layout_width="match_parent"
+ android:layout_marginStart="4dip"
+ android:layout_marginEnd="4dip"
+ android:paddingTop="4dip"
+ android:paddingBottom="4dip"
+ android:background="#40000000"
+ android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
android:clickable="true"
- android:padding="8dip"
- android:background="?android:attr/selectableItemBackground"
/>
</LinearLayout>
- <!-- Numeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_width="match_parent"
- android:layout_marginStart="4dip"
- android:layout_marginEnd="4dip"
- android:paddingTop="4dip"
- android:paddingBottom="4dip"
- android:background="#40000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
- android:clickable="true"
- />
-
- <Space
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
- android:layout_height="@dimen/kg_secure_padding_height"
- android:background="@drawable/lockscreen_protection_pattern" />
-
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
</com.android.internal.policy.impl.keyguard.KeyguardSimPukView>
diff --git a/core/res/res/layout/keyguard_status_view.xml b/core/res/res/layout/keyguard_status_view.xml
index 0d3d574..a462c54 100644
--- a/core/res/res/layout/keyguard_status_view.xml
+++ b/core/res/res/layout/keyguard_status_view.xml
@@ -21,16 +21,17 @@
<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyguard_status_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:gravity="center_horizontal">
<com.android.internal.policy.impl.keyguard.KeyguardStatusView
+ android:id="@+id/keyguard_status_view_face_palm"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal|top"
- android:contentDescription="@string/keyguard_accessibility_status">
+ android:contentDescription="@*android:string/keyguard_accessibility_status">
<com.android.internal.policy.impl.keyguard.ClockView
android:id="@+id/clock_view"
@@ -38,7 +39,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/kg_clock_top_margin"
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:layout_gravity="end">
+ android:layout_gravity="right">
<TextView android:id="@+id/clock_text"
android:layout_width="wrap_content"
@@ -53,54 +54,7 @@
</com.android.internal.policy.impl.keyguard.ClockView>
- <TextView
- android:id="@+id/date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:layout_marginTop="-16dp"
- android:layout_marginBottom="24dp"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/kg_status_date_font_size"
- />
-
- <TextView
- android:id="@+id/alarm_status"
- android:layout_gravity="end"
- android:layout_marginTop="4dp"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/kg_status_line_font_size"
- android:drawablePadding="4dip"
- />
-
- <TextView
- android:id="@+id/owner_info"
- android:layout_gravity="end"
- android:layout_marginTop="4dp"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/kg_status_line_font_size"
- />
-
- <TextView
- android:id="@+id/status1"
- android:layout_gravity="end"
- android:layout_marginTop="4dp"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/kg_status_line_font_size"
- />
+ <include layout="@layout/keyguard_status_area" />
</com.android.internal.policy.impl.keyguard.KeyguardStatusView>
-
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame> \ No newline at end of file
+</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
diff --git a/core/res/res/layout/keyguard_widget_region.xml b/core/res/res/layout/keyguard_widget_region.xml
index 01b5551..ed10c2b 100644
--- a/core/res/res/layout/keyguard_widget_region.xml
+++ b/core/res/res/layout/keyguard_widget_region.xml
@@ -39,7 +39,8 @@
android:orientation="horizontal"
android:paddingLeft="@dimen/kg_widget_pager_horizontal_padding"
android:paddingRight="@dimen/kg_widget_pager_horizontal_padding"
- android:layout_marginTop="@dimen/kg_runway_lights_top_margin">
+ android:layout_marginTop="@dimen/kg_runway_lights_top_margin"
+ android:visibility="gone">
<com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
android:id="@+id/left_strip"
android:paddingTop="@dimen/kg_runway_lights_vertical_padding"
diff --git a/core/res/res/values-land/bools.xml b/core/res/res/values-land/bools.xml
new file mode 100644
index 0000000..4dd9369
--- /dev/null
+++ b/core/res/res/values-land/bools.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <bool name="kg_share_status_area">false</bool>
+ <bool name="kg_sim_puk_full_screen">false</bool>
+</resources>
diff --git a/core/res/res/values-port/bools.xml b/core/res/res/values-port/bools.xml
index fc62b69..1597af3 100644
--- a/core/res/res/values-port/bools.xml
+++ b/core/res/res/values-port/bools.xml
@@ -16,4 +16,6 @@
<resources>
<bool name="action_bar_embed_tabs">false</bool>
+ <bool name="kg_share_status_area">true</bool>
+ <bool name="kg_sim_puk_full_screen">true</bool>
</resources>
diff --git a/core/res/res/values-sw380dp-land/dimens.xml b/core/res/res/values-sw380dp-land/dimens.xml
index d1a1bed..20eb1be 100644
--- a/core/res/res/values-sw380dp-land/dimens.xml
+++ b/core/res/res/values-sw380dp-land/dimens.xml
@@ -19,5 +19,5 @@
-->
<resources>
<!-- Top margin for the clock view -->
- <dimen name="kg_clock_top_margin">67dp</dimen>
+ <dimen name="kg_clock_top_margin">48dp</dimen>
</resources>
diff --git a/core/res/res/values-sw600dp/bools.xml b/core/res/res/values-sw600dp/bools.xml
index 2f65eab..355c52c 100644
--- a/core/res/res/values-sw600dp/bools.xml
+++ b/core/res/res/values-sw600dp/bools.xml
@@ -17,4 +17,6 @@
<resources>
<bool name="target_honeycomb_needs_options_menu">false</bool>
<bool name="show_ongoing_ime_switcher">true</bool>
+ <bool name="kg_share_status_area">false</bool>
+ <bool name="kg_sim_puk_full_screen">false</bool>
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 345175e..31d4ad7 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -255,13 +255,13 @@
<dimen name="kg_widget_view_height">0dp</dimen>
<!-- Size of the clock font in keyguard's status view -->
- <dimen name="kg_status_clock_font_size">94dp</dimen>
+ <dimen name="kg_status_clock_font_size">75dp</dimen>
<!-- Size of the date font in keyguard's status view -->
- <dimen name="kg_status_date_font_size">17dp</dimen>
+ <dimen name="kg_status_date_font_size">15dp</dimen>
<!-- Size of the generic status lines keyguard's status view -->
- <dimen name="kg_status_line_font_size">14sp</dimen>
+ <dimen name="kg_status_line_font_size">13dp</dimen>
<!-- Size of margin on the right of keyguard's status view -->
<dimen name="kg_status_line_font_right_margin">16dp</dimen>
@@ -278,10 +278,6 @@
<!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
<dimen name="kg_pin_key_height">60dp</dimen>
- <!-- Shift emergency button from the left edge by this amount. Used by landscape layout on
- phones -->
- <dimen name="kg_emergency_button_shift">0dp</dimen>
-
<!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
<dimen name="kg_secure_padding_height">46dp</dimen>
@@ -308,5 +304,5 @@
<dimen name="accessibility_touch_slop">80dip</dimen>
<!-- Margin around the various security views -->
- <dimen name="keyguard_security_view_margin">0dp</dimen>
+ <dimen name="keyguard_security_view_margin">8dp</dimen>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index b79348a..61838cc 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1191,6 +1191,8 @@
<java-symbol type="bool" name="config_lidControlsSleep" />
<java-symbol type="bool" name="config_reverseDefaultRotation" />
<java-symbol type="bool" name="config_showNavigationBar" />
+ <java-symbol type="bool" name="kg_share_status_area" />
+ <java-symbol type="bool" name="kg_sim_puk_full_screen" />
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
<java-symbol type="color" name="kg_multi_user_text_active" />
<java-symbol type="color" name="kg_multi_user_text_inactive" />
@@ -1298,6 +1300,7 @@
<java-symbol type="id" name="keyguard_user_name" />
<java-symbol type="id" name="keyguard_transport_control" />
<java-symbol type="id" name="keyguard_status_view" />
+ <java-symbol type="id" name="keyguard_status_view_face_palm" />
<java-symbol type="id" name="keyguard_users_grid" />
<java-symbol type="id" name="clock_text" />
<java-symbol type="id" name="clock_view" />
@@ -1305,6 +1308,7 @@
<java-symbol type="id" name="left_strip" />
<java-symbol type="id" name="right_strip" />
<java-symbol type="id" name="keyguard_multi_user_selector" />
+ <java-symbol type="id" name="status_security_message" />
<java-symbol type="integer" name="config_carDockRotation" />
<java-symbol type="integer" name="config_defaultUiModeType" />
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java
index 1e73c5b..57239c3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java
@@ -60,7 +60,7 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
private EditText mPassword;
private Button mOk;
public boolean mEnableFallback;
- private KeyguardNavigationManager mNavigationManager;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
/**
* Shown while making asynchronous check of password.
@@ -83,7 +83,6 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mNavigationManager = new KeyguardNavigationManager(this);
mLogin = (EditText) findViewById(R.id.login);
mLogin.setFilters(new InputFilter[] { new LoginFilter.UsernameFilterGeneric() } );
@@ -138,7 +137,7 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
mLogin.setText("");
mPassword.setText("");
mLogin.requestFocus();
- mNavigationManager.setMessage(mLockPatternUtils.isPermanentlyLocked() ?
+ mSecurityMessageDisplay.setMessage(mLockPatternUtils.isPermanentlyLocked() ?
R.string.kg_login_too_many_attempts : R.string.kg_login_instructions);
}
@@ -179,7 +178,7 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
// dismiss keyguard
mCallback.dismiss(true);
} else {
- mNavigationManager.setMessage(R.string.kg_login_invalid_input);
+ mSecurityMessageDisplay.setMessage(R.string.kg_login_invalid_input);
mPassword.setText("");
mCallback.reportFailedUnlockAttempt();
}
@@ -313,5 +312,9 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
reset();
}
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java
index d059e36..4967138 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java
@@ -34,7 +34,7 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu
private KeyguardSecurityCallback mKeyguardSecurityCallback;
private LockPatternUtils mLockPatternUtils;
private BiometricSensorUnlock mBiometricUnlock;
- private KeyguardNavigationManager mNavigationManager;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
private View mFaceUnlockAreaView;
private ImageButton mCancelButton;
@@ -49,7 +49,6 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mNavigationManager = new KeyguardNavigationManager(this);
initializeBiometricUnlockView();
}
@@ -173,4 +172,8 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu
}
};
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
index 460f3c6..4987020 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -43,11 +43,10 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewGroup;
import android.view.WindowManager;
-import android.view.View.BaseSavedState;
import android.view.animation.AnimationUtils;
import android.widget.RemoteViews.OnClickHandler;
+import android.widget.TextView;
import android.widget.ViewFlipper;
import com.android.internal.R;
@@ -65,8 +64,8 @@ public class KeyguardHostView extends KeyguardViewBase {
// also referenced in SecuritySettings.java
static final int APPWIDGET_HOST_ID = 0x4B455947;
- private static final String KEYGUARD_WIDGET_PREFS = "keyguard_widget_prefs";
+ // transport control states
private static final int TRANSPORT_GONE = 0;
private static final int TRANSPORT_INVISIBLE = 1;
private static final int TRANSPORT_VISIBLE = 2;
@@ -163,6 +162,10 @@ public class KeyguardHostView extends KeyguardViewBase {
addDefaultWidgets();
updateSecurityViews();
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
+
+ if (KeyguardUpdateMonitor.getInstance(mContext).getIsFirstBoot()) {
+ showPrimarySecurityScreen(false);
+ }
}
private void updateSecurityViews() {
@@ -257,9 +260,6 @@ public class KeyguardHostView extends KeyguardViewBase {
}
public void dismiss(boolean authenticated) {
- // If the biometric unlock was suppressed due to a user switch, it can now be safely
- // unsuppressed because the user has left the unlock screen.
- KeyguardUpdateMonitor.getInstance(mContext).clearBiometricUnlockUserSwitched();
showNextSecurityScreenOrFinish(authenticated);
}
@@ -286,7 +286,7 @@ public class KeyguardHostView extends KeyguardViewBase {
@Override
public void showBackupSecurity() {
- KeyguardHostView.this.showBackupSecurity();
+ KeyguardHostView.this.showBackupSecurityScreen();
}
@Override
@@ -410,11 +410,27 @@ public class KeyguardHostView extends KeyguardViewBase {
}
/**
+ * Shows the primary security screen for the user. This will be either the multi-selector
+ * or the user's security method.
+ * @param turningOff true if the device is being turned off
+ */
+ void showPrimarySecurityScreen(boolean turningOff) {
+ SecurityMode securityMode = mSecurityModel.getSecurityMode();
+ if (DEBUG) Log.v(TAG, "showPrimarySecurityScreen(turningOff=" + turningOff + ")");
+ if (!turningOff && KeyguardUpdateMonitor.getInstance(mContext).isAlternateUnlockEnabled()) {
+ // If we're not turning off, then allow biometric alternate.
+ // We'll reload it when the device comes back on.
+ securityMode = mSecurityModel.getAlternateFor(securityMode);
+ }
+ showSecurityScreen(securityMode);
+ }
+
+ /**
* Shows the backup security screen for the current security mode. This could be used for
* password recovery screens but is currently only used for pattern unlock to show the
* account unlock screen and biometric unlock to show the user's normal unlock.
*/
- private void showBackupSecurity() {
+ private void showBackupSecurityScreen() {
if (DEBUG) Log.d(TAG, "showBackupSecurity()");
showSecurityScreen(mSecurityModel.getBackupSecurityMode());
}
@@ -464,14 +480,19 @@ public class KeyguardHostView extends KeyguardViewBase {
break;
default:
- showSecurityScreen(SecurityMode.None);
+ Log.v(TAG, "Bad security screen " + mCurrentSecuritySelection + ", fail safe");
+ showPrimarySecurityScreen(false);
break;
}
} else {
- // Not authenticated but we were asked to dismiss so go back to selector screen.
- showSecurityScreen(SecurityMode.None);
+ showPrimarySecurityScreen(false);
}
if (finish) {
+ // If the alternate unlock was suppressed, it can now be safely
+ // enabled because the user has left keyguard.
+ KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
+ KeyguardUpdateMonitor.getInstance(mContext).setIsFirstBoot(false);
+
// If there's a pending runnable because the user interacted with a widget
// and we're leaving keyguard, then run it.
if (mLaunchRunnable != null) {
@@ -519,11 +540,12 @@ public class KeyguardHostView extends KeyguardViewBase {
};
};
+ private KeyguardStatusViewManager mKeyguardStatusViewManager;
+
@Override
public void reset() {
mIsVerifyUnlockOnly = false;
mAppWidgetContainer.setCurrentPage(getWidgetPosition(R.id.keyguard_status_view));
- requestFocus();
}
/**
@@ -544,13 +566,37 @@ public class KeyguardHostView extends KeyguardViewBase {
break;
}
}
+ boolean simPukFullScreen = getResources().getBoolean(R.bool.kg_sim_puk_full_screen);
if (view == null) {
final LayoutInflater inflater = LayoutInflater.from(mContext);
View v = inflater.inflate(getLayoutIdFor(securityMode), this, false);
mSecurityViewContainer.addView(v);
updateSecurityView(v);
+
view = (KeyguardSecurityView) v;
+ TextView navigationText = ((TextView) findViewById(R.id.keyguard_message_area));
+
+ // Some devices can fit a navigation area, others cannot. On devices that cannot,
+ // we display the security message in status area.
+ if (navigationText != null) {
+ view.setSecurityMessageDisplay(new KeyguardNavigationManager(navigationText));
+ } else {
+ view.setSecurityMessageDisplay(mKeyguardStatusViewManager);
+ }
+ }
+
+ if (securityMode == SecurityMode.SimPin || securityMode == SecurityMode.SimPuk) {
+ if (simPukFullScreen) {
+ mAppWidgetRegion.setVisibility(View.GONE);
+ }
}
+
+ if (view instanceof KeyguardSelectorView) {
+ KeyguardSelectorView selectorView = (KeyguardSelectorView) view;
+ View carrierText = selectorView.findViewById(R.id.keyguard_selector_fade_container);
+ selectorView.setCarrierArea(carrierText);
+ }
+
return view;
}
@@ -562,6 +608,7 @@ public class KeyguardHostView extends KeyguardViewBase {
*/
private void showSecurityScreen(SecurityMode securityMode) {
if (DEBUG) Log.d(TAG, "showSecurityScreen");
+
if (securityMode == mCurrentSecuritySelection) return;
KeyguardSecurityView oldView = getSecurityView(mCurrentSecuritySelection);
@@ -607,7 +654,7 @@ public class KeyguardHostView extends KeyguardViewBase {
@Override
public void onScreenTurnedOn() {
if (DEBUG) Log.d(TAG, "screen on");
- showSecurityScreen(mCurrentSecuritySelection);
+ showPrimarySecurityScreen(false);
getSecurityView(mCurrentSecuritySelection).onResume();
// This is a an attempt to fix bug 7137389 where the device comes back on but the entire
@@ -619,7 +666,7 @@ public class KeyguardHostView extends KeyguardViewBase {
@Override
public void onScreenTurnedOff() {
if (DEBUG) Log.d(TAG, "screen off");
- showSecurityScreen(SecurityMode.None);
+ showPrimarySecurityScreen(true);
getSecurityView(mCurrentSecuritySelection).onPause();
}
@@ -769,6 +816,10 @@ public class KeyguardHostView extends KeyguardViewBase {
}
});
}
+
+ mKeyguardStatusViewManager = ((KeyguardStatusView)
+ findViewById(R.id.keyguard_status_view_face_palm)).getManager();
+
}
private void maybePopulateWidgets() {
@@ -920,7 +971,9 @@ public class KeyguardHostView extends KeyguardViewBase {
@Override
public void showUnlockHint() {
- mKeyguardSelectorView.ping();
+ if (mKeyguardSelectorView != null) {
+ mKeyguardSelectorView.ping();
+ }
}
};
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardNavigationManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardNavigationManager.java
index 646ab92..74b244d 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardNavigationManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardNavigationManager.java
@@ -21,23 +21,13 @@ import android.widget.TextView;
import com.android.internal.R;
-public class KeyguardNavigationManager {
+public class KeyguardNavigationManager implements SecurityMessageDisplay {
private TextView mMessageArea;
- private KeyguardSecurityView mKeyguardSecurityView;
- private View mClickArea;
- public KeyguardNavigationManager(KeyguardSecurityView view) {
- mKeyguardSecurityView = view;
- mMessageArea = (TextView) ((View) view).findViewById(R.id.keyguard_message_area);
+ public KeyguardNavigationManager(TextView messageArea) {
+ mMessageArea = messageArea;
mMessageArea.setSelected(true); // Make marquee work
-
- mClickArea = ((View) view).findViewById(R.id.keyguard_click_area);
- mClickArea.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- mKeyguardSecurityView.getCallback().dismiss(false);
- }
- });
}
public void setMessage(CharSequence msg) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
index a4e8ea4..5a1c30f 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
@@ -61,7 +61,7 @@ public class KeyguardPasswordView extends LinearLayout
private PasswordEntryKeyboardView mKeyboardView;
private PasswordEntryKeyboardHelper mKeyboardHelper;
private boolean mIsAlpha;
- private KeyguardNavigationManager mNavigationManager;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
// To avoid accidental lockout due to events while the device in in the pocket, ignore
// any passwords with length less than or equal to this length.
@@ -101,7 +101,7 @@ public class KeyguardPasswordView extends LinearLayout
}
private void resetState() {
- mNavigationManager.setMessage(
+ mSecurityMessageDisplay.setMessage(
mIsAlpha ? R.string.kg_password_instructions : R.string.kg_pin_instructions);
mPasswordEntry.setEnabled(true);
mKeyboardView.setEnabled(true);
@@ -111,8 +111,6 @@ public class KeyguardPasswordView extends LinearLayout
protected void onFinishInflate() {
mLockPatternUtils = new LockPatternUtils(mContext); // TODO: use common one
- mNavigationManager = new KeyguardNavigationManager(this);
-
final int quality = mLockPatternUtils.getKeyguardStoredPasswordQuality();
mIsAlpha = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC == quality
|| DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == quality
@@ -288,7 +286,7 @@ public class KeyguardPasswordView extends LinearLayout
long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
handleAttemptLockout(deadline);
}
- mNavigationManager.setMessage(
+ mSecurityMessageDisplay.setMessage(
mIsAlpha ? R.string.kg_wrong_password : R.string.kg_wrong_pin);
}
mPasswordEntry.setText("");
@@ -304,7 +302,7 @@ public class KeyguardPasswordView extends LinearLayout
@Override
public void onTick(long millisUntilFinished) {
int secondsRemaining = (int) (millisUntilFinished / 1000);
- mNavigationManager.setMessage(
+ mSecurityMessageDisplay.setMessage(
R.string.kg_too_many_failed_attempts_countdown, secondsRemaining);
}
@@ -367,5 +365,10 @@ public class KeyguardPasswordView extends LinearLayout
public void afterTextChanged(Editable s) {
}
+
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
index e4b7798..d8d7990 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
@@ -65,7 +65,6 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
private Button mForgotPatternButton;
private KeyguardSecurityCallback mCallback;
private boolean mEnableFallback;
- private KeyguardNavigationManager mNavigationManager;
/**
* Keeps track of the last time we poked the wake lock during dispatching of the touch event.
@@ -84,6 +83,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
};
private Rect mTempRect = new Rect();
+ private SecurityMessageDisplay mSecurityMessageDisplay;
enum FooterMode {
Normal,
@@ -111,7 +111,6 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
protected void onFinishInflate() {
super.onFinishInflate();
- mNavigationManager = new KeyguardNavigationManager(this);
mLockPatternUtils = mLockPatternUtils == null
? new LockPatternUtils(mContext) : mLockPatternUtils;
@@ -183,7 +182,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
if (deadline != 0) {
handleAttemptLockout(deadline);
} else {
- mNavigationManager.setMessage(R.string.kg_pattern_instructions);
+ mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions);
}
// the footer depends on how many total attempts the user has failed
@@ -255,7 +254,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
handleAttemptLockout(deadline);
} else {
- mNavigationManager.setMessage(R.string.kg_wrong_pattern);
+ mSecurityMessageDisplay.setMessage(R.string.kg_wrong_pattern);
mLockPatternView.postDelayed(mCancelPatternRunnable, PATTERN_CLEAR_TIMEOUT_MS);
}
}
@@ -327,14 +326,14 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
@Override
public void onTick(long millisUntilFinished) {
final int secondsRemaining = (int) (millisUntilFinished / 1000);
- mNavigationManager.setMessage(
+ mSecurityMessageDisplay.setMessage(
R.string.kg_too_many_failed_attempts_countdown, secondsRemaining);
}
@Override
public void onFinish() {
mLockPatternView.setEnabled(true);
- mNavigationManager.setMessage(R.string.kg_pattern_instructions);
+ mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions);
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
mFailedPatternAttemptsSinceLastTimeout = 0;
if (mEnableFallback) {
@@ -370,6 +369,10 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
return mCallback;
}
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
index e573072..8f82b0f 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
@@ -66,7 +66,7 @@ public class KeyguardSecurityModel {
final boolean backupIsTimedOut = monitor.getFailedUnlockAttempts() >=
LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT;
return monitor.getMaxBiometricUnlockAttemptsReached() || backupIsTimedOut
- || monitor.didBiometricUnlockUserSwitch();
+ || !monitor.isAlternateUnlockEnabled();
}
SecurityMode getSecurityMode() {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java
index d80c1db..19bcae9 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java
@@ -61,4 +61,5 @@ public interface KeyguardSecurityView {
*/
KeyguardSecurityCallback getCallback();
+ void setSecurityMessageDisplay(SecurityMessageDisplay display);
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
index b6b731e..1d26def 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
@@ -172,10 +172,13 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
super.onFinishInflate();
mGlowPadView = (GlowPadView) findViewById(R.id.glow_pad_view);
mGlowPadView.setOnTriggerListener(mOnTriggerListener);
- mFadeView = (View) findViewById(R.id.keyguard_selector_fade_container);
updateTargets();
}
+ public void setCarrierArea(View carrierArea) {
+ mFadeView = carrierArea;
+ }
+
public boolean isTargetPresent(int resId) {
return mGlowPadView.getTargetPosition(resId) != -1;
}
@@ -324,4 +327,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
return mCallback;
}
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java
index 5a9ffcf..3516af9 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java
@@ -55,7 +55,7 @@ public class KeyguardSimPinView extends LinearLayout
private PasswordEntryKeyboardView mKeyboardView;
private PasswordEntryKeyboardHelper mKeyboardHelper;
private LockPatternUtils mLockPatternUtils;
- private KeyguardNavigationManager mNavigationManager;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
private volatile boolean mSimCheckInProgress;
@@ -76,8 +76,6 @@ public class KeyguardSimPinView extends LinearLayout
protected void onFinishInflate() {
super.onFinishInflate();
- mNavigationManager = new KeyguardNavigationManager(this);
-
mPinEntry = (EditText) findViewById(R.id.sim_pin_entry);
mPinEntry.setOnEditorActionListener(this);
mPinEntry.addTextChangedListener(this);
@@ -112,7 +110,9 @@ public class KeyguardSimPinView extends LinearLayout
public void reset() {
// start fresh
- mNavigationManager.setMessage(R.string.kg_sim_pin_instructions);
+ if (mSecurityMessageDisplay != null) {
+ mSecurityMessageDisplay.setMessage(R.string.kg_sim_pin_instructions);
+ }
// make sure that the number of entered digits is consistent when we
// erase the SIM unlock code, including orientation changes.
@@ -193,7 +193,7 @@ public class KeyguardSimPinView extends LinearLayout
private void checkPin() {
if (mPinEntry.getText().length() < 4) {
// otherwise, display a message to the user, and don't submit.
- mNavigationManager.setMessage(R.string.kg_invalid_sim_pin_hint);
+ mSecurityMessageDisplay.setMessage(R.string.kg_invalid_sim_pin_hint);
mPinEntry.setText("");
mCallback.userActivity(0);
return;
@@ -216,7 +216,7 @@ public class KeyguardSimPinView extends LinearLayout
KeyguardUpdateMonitor.getInstance(getContext()).reportSimUnlocked();
mCallback.dismiss(true);
} else {
- mNavigationManager.setMessage(R.string.kg_password_wrong_pin_code);
+ mSecurityMessageDisplay.setMessage(R.string.kg_password_wrong_pin_code);
mPinEntry.setText("");
}
mCallback.userActivity(0);
@@ -263,4 +263,9 @@ public class KeyguardSimPinView extends LinearLayout
public void afterTextChanged(Editable s) {
}
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ reset();
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java
index 2cdb52d..2194c80 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java
@@ -48,7 +48,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
private ProgressDialog mSimUnlockProgressDialog = null;
private KeyguardSecurityCallback mCallback;
- private KeyguardNavigationManager mNavigationManager;
+ private SecurityMessageDisplay mSecurityMessageDisplay;
private PasswordEntryKeyboardView mKeyboardView;
@@ -99,7 +99,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
}
mSimPinEntry.setText(null);
if (msg != 0) {
- mNavigationManager.setMessage(msg);
+ mSecurityMessageDisplay.setMessage(msg);
}
}
@@ -107,7 +107,9 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
mPinText="";
mPukText="";
state = ENTER_PUK;
- mNavigationManager.setMessage(R.string.kg_puk_enter_puk_hint);
+ if (mSecurityMessageDisplay != null) {
+ mSecurityMessageDisplay.setMessage(R.string.kg_puk_enter_puk_hint);
+ }
mSimPinEntry.requestFocus();
}
}
@@ -130,8 +132,6 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
protected void onFinishInflate() {
super.onFinishInflate();
- mNavigationManager = new KeyguardNavigationManager(this);
-
mSimPinEntry = (TextView) findViewById(R.id.sim_pin_entry);
mSimPinEntry.setOnEditorActionListener(this);
mSimPinEntry.addTextChangedListener(this);
@@ -279,7 +279,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
mCallback.dismiss(true);
} else {
mStateMachine.reset();
- mNavigationManager.setMessage(R.string.kg_invalid_puk);
+ mSecurityMessageDisplay.setMessage(R.string.kg_invalid_puk);
}
mCheckInProgress = false;
}
@@ -333,4 +333,9 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
public void afterTextChanged(Editable s) {
}
+ @Override
+ public void setSecurityMessageDisplay(SecurityMessageDisplay display) {
+ mSecurityMessageDisplay = display;
+ reset();
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java
index 5704425..00cd5b9 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java
@@ -44,4 +44,7 @@ public class KeyguardStatusView extends GridLayout {
mStatusViewManager = new KeyguardStatusViewManager(this);
}
+ KeyguardStatusViewManager getManager() {
+ return mStatusViewManager;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusViewManager.java
index f97d67d..ab2e170 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusViewManager.java
@@ -27,7 +27,10 @@ import libcore.util.MutableInt;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Typeface;
+import android.os.Handler;
+import android.os.Looper;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
@@ -36,10 +39,14 @@ import android.util.Log;
import android.view.View;
import android.widget.TextView;
+import java.util.Date;
+
+import libcore.util.MutableInt;
+
/***
* Manages a number of views inside of the given layout. See below for a list of widgets.
*/
-class KeyguardStatusViewManager {
+class KeyguardStatusViewManager implements SecurityMessageDisplay {
private static final boolean DEBUG = false;
private static final String TAG = "KeyguardStatusView";
@@ -55,6 +62,9 @@ class KeyguardStatusViewManager {
private TextView mStatus1View;
private TextView mOwnerInfoView;
private TextView mAlarmStatusView;
+ private TextView mSecurityMessage;
+ private static final int SECURITY_MESSAGE_DURATION = 5000;
+ private static final boolean SECURITY_MESSAGE_TIMES_OUT = false;
// Top-level container view for above views
private View mContainer;
@@ -65,6 +75,10 @@ class KeyguardStatusViewManager {
// last known plugged in state
private boolean mPluggedIn = false;
+ // Whether to use the last line as a combined line to either display owner info / charging.
+ // If false, each item will be given a dedicated space.
+ private boolean mShareStatusRegion = false;
+
// last known battery level
private int mBatteryLevel = 100;
@@ -79,6 +93,10 @@ class KeyguardStatusViewManager {
protected boolean mBatteryCharged;
protected boolean mBatteryIsLow;
+ private Handler mHandler;
+ private Runnable mClearSecurityMessageRunnable;
+ private CharSequence mSecurityMessageContents = "";
+
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
@Override
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
@@ -102,8 +120,10 @@ class KeyguardStatusViewManager {
public KeyguardStatusViewManager(View view) {
if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
mContainer = view;
- mDateFormatString = getContext().getResources().getText(
- com.android.internal.R.string.abbrev_wday_month_day_no_year);
+ Resources res = getContext().getResources();
+ mDateFormatString =
+ res.getText(com.android.internal.R.string.abbrev_wday_month_day_no_year);
+ mShareStatusRegion = res.getBoolean(R.bool.kg_share_status_area);
mLockPatternUtils = new LockPatternUtils(view.getContext());
mUpdateMonitor = KeyguardUpdateMonitor.getInstance(view.getContext());
@@ -112,6 +132,12 @@ class KeyguardStatusViewManager {
mAlarmStatusView = (TextView) view.findViewById(R.id.alarm_status);
mOwnerInfoView = (TextView) view.findViewById(R.id.owner_info);
mClockView = (ClockView) view.findViewById(R.id.clock_view);
+ mSecurityMessage = (TextView) view.findViewById(R.id.status_security_message);
+
+ // This is required to ensure marquee works
+ if (mSecurityMessage != null) {
+ mSecurityMessage.setSelected(true);
+ }
// Use custom font in mDateView
mDateView.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
@@ -129,9 +155,17 @@ class KeyguardStatusViewManager {
// Registering this callback immediately updates the battery state, among other things.
mUpdateMonitor.registerCallback(mInfoCallback);
- resetStatusInfo();
refreshDate();
- updateOwnerInfo();
+ resetStatusInfo();
+
+ mHandler = new Handler(Looper.myLooper());
+ mClearSecurityMessageRunnable = new Runnable() {
+ @Override
+ public void run() {
+ mSecurityMessageContents = "";
+ updateStatusLines();
+ }
+ };
}
public void onPause() {
@@ -154,6 +188,37 @@ class KeyguardStatusViewManager {
updateStatusLines();
}
+ public void setMessage(CharSequence msg) {
+ mSecurityMessageContents = msg;
+ securityMessageChanged();
+ }
+
+ public void setMessage(int resId) {
+ if (resId != 0) {
+ mSecurityMessageContents = getContext().getResources().getText(resId);
+ } else {
+ mSecurityMessageContents = "";
+ }
+ securityMessageChanged();
+ }
+
+ public void setMessage(int resId, Object... formatArgs) {
+ if (resId != 0) {
+ mSecurityMessageContents = getContext().getString(resId, formatArgs);
+ } else {
+ mSecurityMessageContents = "";
+ }
+ securityMessageChanged();
+ }
+
+ public void securityMessageChanged() {
+ updateStatusLines();
+ if (SECURITY_MESSAGE_TIMES_OUT) {
+ mHandler.removeCallbacks(mClearSecurityMessageRunnable);
+ mHandler.postDelayed(mClearSecurityMessageRunnable, SECURITY_MESSAGE_DURATION);
+ }
+ }
+
/**
* Update the status lines based on these rules:
* AlarmStatus: Alarm state always gets it's own line.
@@ -163,8 +228,21 @@ class KeyguardStatusViewManager {
*/
void updateStatusLines() {
updateAlarmInfo();
- updateOwnerInfo();
- updateStatus1();
+ boolean statusAreaUsed = updateSecurityMessage();
+ statusAreaUsed = updateStatus1(statusAreaUsed) || statusAreaUsed;
+ updateOwnerInfo(statusAreaUsed);
+ }
+
+ private boolean updateSecurityMessage() {
+ if (mSecurityMessage == null) return false;
+ if (!TextUtils.isEmpty(mSecurityMessageContents)) {
+ mSecurityMessage.setText(mSecurityMessageContents);
+ mSecurityMessage.setVisibility(View.VISIBLE);
+ return true;
+ } else {
+ mSecurityMessage.setVisibility(View.GONE);
+ return false;
+ }
}
private void updateAlarmInfo() {
@@ -178,13 +256,31 @@ class KeyguardStatusViewManager {
}
}
- private void updateOwnerInfo() {
+ private boolean updateStatus1(boolean statusAreaUsed) {
+ MutableInt icon = new MutableInt(0);
+ CharSequence string = getPriorityTextMessage(icon);
+
+ boolean dontShow = statusAreaUsed && mShareStatusRegion;
+ if (!dontShow && !TextUtils.isEmpty(string)) {
+ maybeSetUpperCaseText(mStatus1View, string);
+ mStatus1View.setCompoundDrawablesWithIntrinsicBounds(icon.value, 0, 0, 0);
+ mStatus1View.setVisibility(View.VISIBLE);
+ return true;
+ } else {
+ mStatus1View.setVisibility(View.GONE);
+ return false;
+ }
+ }
+
+ private void updateOwnerInfo(boolean statusAreaUsed) {
final ContentResolver res = getContext().getContentResolver();
final boolean ownerInfoEnabled = Settings.Secure.getIntForUser(res,
Settings.Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
String text = Settings.Secure.getStringForUser(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO,
UserHandle.USER_CURRENT);
- if (ownerInfoEnabled && !TextUtils.isEmpty(text)) {
+
+ boolean dontShow = statusAreaUsed && mShareStatusRegion;
+ if (!dontShow && ownerInfoEnabled && !TextUtils.isEmpty(text)) {
text = text.trim(); // Remove trailing newlines
maybeSetUpperCaseText(mOwnerInfoView, text);
mOwnerInfoView.setVisibility(View.VISIBLE);
@@ -193,18 +289,6 @@ class KeyguardStatusViewManager {
}
}
- private void updateStatus1() {
- MutableInt icon = new MutableInt(0);
- CharSequence string = getPriorityTextMessage(icon);
- if (!TextUtils.isEmpty(string)) {
- maybeSetUpperCaseText(mStatus1View, string);
- mStatus1View.setCompoundDrawablesWithIntrinsicBounds(icon.value, 0, 0, 0);
- mStatus1View.setVisibility(View.VISIBLE);
- } else {
- mStatus1View.setVisibility(View.GONE);
- }
- }
-
private CharSequence getPriorityTextMessage(MutableInt icon) {
CharSequence string = null;
if (mShowingBatteryInfo) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java
index 63a074a..d8e1c1a 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java
@@ -102,7 +102,7 @@ public class KeyguardUpdateMonitor {
private int mFailedAttempts = 0;
private int mFailedBiometricUnlockAttempts = 0;
- private boolean mBiometricUnlockUserSwitched;
+ private boolean mAlternateUnlockEnabled;
private boolean mClockVisible;
@@ -195,6 +195,7 @@ public class KeyguardUpdateMonitor {
}
}
};
+ private boolean mIsFirstBoot;
/**
* When we receive a
@@ -406,7 +407,7 @@ public class KeyguardUpdateMonitor {
cb.onUserSwitched(userId);
}
}
- mBiometricUnlockUserSwitched = true;
+ setAlternateUnlockEnabled(false);
try {
reply.sendResult(null);
} catch (RemoteException e) {
@@ -724,12 +725,12 @@ public class KeyguardUpdateMonitor {
return mFailedBiometricUnlockAttempts >= FAILED_BIOMETRIC_UNLOCK_ATTEMPTS_BEFORE_BACKUP;
}
- public boolean didBiometricUnlockUserSwitch() {
- return mBiometricUnlockUserSwitched;
+ public boolean isAlternateUnlockEnabled() {
+ return mAlternateUnlockEnabled;
}
- public void clearBiometricUnlockUserSwitched() {
- mBiometricUnlockUserSwitched = false;
+ public void setAlternateUnlockEnabled(boolean enabled) {
+ mAlternateUnlockEnabled = enabled;
}
public boolean isSimLocked() {
@@ -752,4 +753,12 @@ public class KeyguardUpdateMonitor {
|| simState == IccCardConstants.State.PUK_REQUIRED
|| simState == IccCardConstants.State.PERM_DISABLED);
}
+
+ public void setIsFirstBoot(boolean b) {
+ mIsFirstBoot = b;
+ }
+
+ public boolean getIsFirstBoot() {
+ return mIsFirstBoot;
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
index 1754f7f..1ec4176 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
@@ -210,14 +210,13 @@ public class KeyguardViewManager {
mKeyguardView.setLockPatternUtils(mLockPatternUtils);
mKeyguardView.setViewMediatorCallback(mViewMediatorCallback);
- if (options != null && options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_USER_SWITCHER)) {
- mKeyguardView.goToUserSwitcher();
- mKeyguardView.showNextSecurityScreenIfPresent();
- }
-
- if (options != null &&
- options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_SECURITY_CHALLENGE)) {
- mKeyguardView.showNextSecurityScreenIfPresent();
+ if (options != null) {
+ if (options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_USER_SWITCHER)) {
+ mKeyguardView.goToUserSwitcher();
+ }
+ if (options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_SECURITY_CHALLENGE)) {
+ mKeyguardView.showNextSecurityScreenIfPresent();
+ }
}
if (mScreenOn) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
index 3ed952c..92f9dfd 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
@@ -309,8 +309,9 @@ public class KeyguardViewMediator {
options.putBoolean(LockPatternUtils.KEYGUARD_SHOW_USER_SWITCHER, true);
options.putBoolean(LockPatternUtils.KEYGUARD_SHOW_SECURITY_CHALLENGE, true);
resetStateLocked(options);
-
adjustStatusBarLocked();
+ // Disable face unlock when the user switches.
+ KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(false);
}
}
@@ -519,6 +520,11 @@ public class KeyguardViewMediator {
if (DEBUG) Log.d(TAG, "onSystemReady");
mSystemReady = true;
mUpdateMonitor.registerCallback(mUpdateCallback);
+
+ // Disable alternate unlock right after boot until things have settled.
+ mUpdateMonitor.setAlternateUnlockEnabled(false);
+ mUpdateMonitor.setIsFirstBoot(true);
+
doKeyguardLocked();
}
// Most services aren't available until the system reaches the ready state, so we
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
index fc7c90f..d834741 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
@@ -90,6 +90,8 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
protected boolean mFirstLayout = true;
protected int mCurrentPage;
+ protected int mChildCountOnLastMeasure;
+
protected int mNextPage = INVALID_PAGE;
protected int mMaxScrollX;
protected Scroller mScroller;
@@ -498,6 +500,11 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
// ensure that the cache is filled with good values.
invalidateCachedOffsets();
+ if (mChildCountOnLastMeasure != getChildCount()) {
+ setCurrentPage(mCurrentPage);
+ }
+ mChildCountOnLastMeasure = getChildCount();
+
if (childCount > 0) {
if (DEBUG) Log.d(TAG, "getRelativeChildOffset(): " + getMeasuredWidth() + ", "
+ getChildWidth(0));
@@ -595,10 +602,7 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
@Override
public void onChildViewRemoved(View parent, View child) {
- invalidate();
- invalidateCachedOffsets();
- // This prevents a crash when a child is removed that was the current page.
- mCurrentPage = Math.min(mCurrentPage, getChildCount() - 1);
+ // TODO Auto-generated method stub
}
protected void invalidateCachedOffsets() {
@@ -621,6 +625,8 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
}
protected int getChildOffset(int index) {
+ if (index < 0 || index > getChildCount() - 1) return 0;
+
int[] childOffsets = Float.compare(mLayoutScale, 1f) == 0 ?
mChildOffsets : mChildOffsetsWithLayoutScale;
@@ -642,6 +648,8 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
}
protected int getRelativeChildOffset(int index) {
+ if (index < 0 || index > getChildCount() - 1) return 0;
+
if (mChildRelativeOffsets != null && mChildRelativeOffsets[index] != -1) {
return mChildRelativeOffsets[index];
} else {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java b/policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java
new file mode 100644
index 0000000..98fd11e
--- /dev/null
+++ b/policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.policy.impl.keyguard;
+
+public interface SecurityMessageDisplay {
+ public void setMessage(CharSequence msg);
+
+ public void setMessage(int resId);
+
+ public void setMessage(int resId, Object... formatArgs);
+}