Skip to content

Commit e46efc0

Browse files
author
Jim Miller
committed
Enable lazy-loading of security views in keyguard
This change removes all but the default KeyguardSelectorView from KeyguardViewHost to (1) reduce the overall memory footprint (2) reduce initial layout inflation time and (3) avoid initializing the camera until needed by face unlock. Fixes bug 7127666 Change-Id: Ibac1838dd7a490dcadbfab5bdfdd82734b69055a
1 parent 824b959 commit e46efc0

File tree

6 files changed

+102
-117
lines changed

6 files changed

+102
-117
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@
4545
android:layout_weight="1"
4646
android:gravity="center">
4747

48+
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
4849
<include layout="@layout/keyguard_selector_view"/>
49-
<include layout="@layout/keyguard_account_view"/>
50-
<include layout="@layout/keyguard_pattern_view"/>
51-
<include layout="@layout/keyguard_password_view"/>
52-
<include layout="@layout/keyguard_sim_pin_view"/>
53-
<include layout="@layout/keyguard_sim_puk_view"/>
54-
<include layout="@layout/keyguard_face_unlock_view"/>
5550

5651
</ViewFlipper>
5752

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,8 @@
3333
android:layout_height="match_parent"
3434
android:gravity="center">
3535

36+
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
3637
<include layout="@layout/keyguard_selector_view"/>
37-
<include layout="@layout/keyguard_account_view"/>
38-
<include layout="@layout/keyguard_pattern_view"/>
39-
<include layout="@layout/keyguard_password_view"/>
40-
<include layout="@layout/keyguard_sim_pin_view"/>
41-
<include layout="@layout/keyguard_sim_puk_view"/>
42-
<include layout="@layout/keyguard_face_unlock_view"/>
4338

4439
</ViewFlipper>
4540

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,8 @@
5252
android:layout_weight="1"
5353
android:gravity="center">
5454

55+
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
5556
<include layout="@layout/keyguard_selector_view"/>
56-
<include layout="@layout/keyguard_account_view"/>
57-
<include layout="@layout/keyguard_pattern_view"/>
58-
<include layout="@layout/keyguard_password_view"/>
59-
<include layout="@layout/keyguard_sim_pin_view"/>
60-
<include layout="@layout/keyguard_sim_puk_view"/>
61-
<include layout="@layout/keyguard_face_unlock_view"/>
6257

6358
</ViewFlipper>
6459

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@
4747
android:layout_weight="0.6"
4848
android:layout_gravity="center">
4949

50+
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
5051
<include layout="@layout/keyguard_selector_view"/>
51-
<include layout="@layout/keyguard_account_view"/>
52-
<include layout="@layout/keyguard_pattern_view"/>
53-
<include layout="@layout/keyguard_password_view"/>
54-
<include layout="@layout/keyguard_sim_pin_view"/>
55-
<include layout="@layout/keyguard_sim_puk_view"/>
56-
<include layout="@layout/keyguard_face_unlock_view"/>
5752

5853
</ViewFlipper>
5954

core/res/res/values/public.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,13 @@
13671367
<java-symbol type="layout" name="keyguard_screen_tab_unlock_land" />
13681368
<java-symbol type="layout" name="keyguard_screen_unlock_landscape" />
13691369
<java-symbol type="layout" name="keyguard_screen_unlock_portrait" />
1370+
<java-symbol type="layout" name="keyguard_selector_view" />
1371+
<java-symbol type="layout" name="keyguard_pattern_view" />
1372+
<java-symbol type="layout" name="keyguard_password_view" />
1373+
<java-symbol type="layout" name="keyguard_face_unlock_view" />
1374+
<java-symbol type="layout" name="keyguard_sim_pin_view" />
1375+
<java-symbol type="layout" name="keyguard_sim_puk_view" />
1376+
<java-symbol type="layout" name="keyguard_account_view" />
13701377
<java-symbol type="layout" name="recent_apps_dialog" />
13711378
<java-symbol type="layout" name="screen_action_bar" />
13721379
<java-symbol type="layout" name="screen_action_bar_overlay" />

0 commit comments

Comments
 (0)