Skip to content

Commit

Permalink
Settings: Forward port lock pattern grid size (2/2)
Browse files Browse the repository at this point in the history
Fingerprint: Forward challenge extras

The forward port of custom pattern sizes introduced a bug that would
cause an NPE when trying to add a fingerprint for security. This patch
forwards the extras associated with the challenge that would have
normally been passed directly in to the ChooseLockPattern fragment.

TICKET: CYNGNOS-1490

Settings: forward decrypt required on boot flag

This wasn't being pass forward and all of the defaults had it set to
true.

Ticket: CYNGNOS-2270
Signed-off-by: Roman Birg <[email protected]>

Settings: allow rotation while setting new pattern

Signed-off-by: Roman Birg <[email protected]>

Settings: use the actual user id to set pattern size

Ticket: CYNGNOS-2462

Settings: handle decrypting larger pattern sizes

Signed-off-by: Roman Birg <[email protected]>

CryptKeeper: pattern unlock displays incorrect pw when correct

fakeUnlockAttempt() gets called when the user inputs any pattern length
< 4 which queues up the 'incorrect error' message. The message needs to
be cleared before trying to actually check the password so it never goes
through in case the password was correct.

Signed-off-by: Roman Birg <[email protected]>

Settings: fix non lock pattern CryptKeeper crash

Signed-off-by: Roman Birg <[email protected]>

CryptKeeper: layout whole screen in bounds

Add flags to make the screen layout properly on devices with the
navigation bar visible

Signed-off-by: Roman Birg <[email protected]>

CryptKeeper improvements

- Status text was used enough to warrant it being a field variable
  instead of looking for the view every time

- Display proper text after changing pattern sizes (to input a pattern,
  not a password)

- Disable changing pattern sizes while validaing pattern

REFS: LETTUCE-557, LETTUCE-352
Signed-off-by: Roman Birg <[email protected]>

Settings: Use GLIF Theme for missing Settings > Screen lock Activities

Icons by Asher

Change-Id: Icf1627b41ef604302a5819ad3b1bdfd6d8479202

Change-Id: I7078d703c218cd096d9b77c003a94b52fbce6322
  • Loading branch information
mikeNG committed Dec 8, 2020
1 parent 1f11b8d commit c384940
Show file tree
Hide file tree
Showing 16 changed files with 571 additions and 33 deletions.
4 changes: 4 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,10 @@
android:label="@string/lockpassword_choose_lock_generic_header"
android:excludeFromRecents="true" />

<activity android:name=".password.ChooseLockPatternSize"
android:exported="false"
android:theme="@style/GlifTheme.Light" />

<activity android:name=".password.SetupChooseLockPattern"
android:exported="false"
android:theme="@style/GlifTheme.Light" />
Expand Down
26 changes: 26 additions & 0 deletions res/drawable/ic_security_pattern_3x3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Copyright (C) 2016 The CyanogenMod 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M4,17.268C3.402,17.613 3,18.26 3,19C3,20.105 3.895,21 5,21C5.74,21 6.387,20.598 6.732,20L9.268,20C9.613,20.598 10.26,21 11,21C12.105,21 13,20.105 13,19C13,17.895 12.105,17 11,17C10.26,17 9.613,17.402 9.268,18L6.732,18C6.557,17.696 6.304,17.443 6,17.268L6,14.732C6.598,14.387 7,13.74 7,13C7,11.895 6.105,11 5,11C3.895,11 3,11.895 3,13C3,13.74 3.402,14.387 4,14.732L4,17.268ZM21,11L21,9.5C21,8.67 20.33,8 19.5,8C20.33,8 21,7.33 21,6.5L21,5C21,3.89 20.1,3 19,3L15,3L15,5L19,5L19,7L17,7L17,9L19,9L19,11L15,11L15,13L19,13C20.1,13 21,12.11 21,11ZM5,9C6.105,9 7,8.105 7,7C7,5.895 6.105,5 5,5C3.895,5 3,5.895 3,7C3,8.105 3.895,9 5,9ZM11,9C12.105,9 13,8.105 13,7C13,5.895 12.105,5 11,5C9.895,5 9,5.895 9,7C9,8.105 9.895,9 11,9ZM11,15C12.105,15 13,14.105 13,13C13,11.895 12.105,11 11,11C9.895,11 9,11.895 9,13C9,14.105 9.895,15 11,15ZM17,21C18.105,21 19,20.105 19,19C19,17.895 18.105,17 17,17C15.895,17 15,17.895 15,19C15,20.105 15.895,21 17,21Z"
android:strokeColor="#00000000"
android:fillColor="#777777"
android:strokeWidth="1"/>
</vector>
26 changes: 26 additions & 0 deletions res/drawable/ic_security_pattern_4x4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Copyright (C) 2016 The CyanogenMod 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M4,17.268C3.402,17.613 3,18.26 3,19C3,20.105 3.895,21 5,21C5.74,21 6.387,20.598 6.732,20L9.268,20C9.613,20.598 10.26,21 11,21C12.105,21 13,20.105 13,19C13,17.895 12.105,17 11,17C10.26,17 9.613,17.402 9.268,18L6.732,18C6.557,17.696 6.304,17.443 6,17.268L6,14.732C6.598,14.387 7,13.74 7,13C7,11.895 6.105,11 5,11C3.895,11 3,11.895 3,13C3,13.74 3.402,14.387 4,14.732L4,17.268ZM21,13L21,3L19,3L19,7L17,7L17,3L15,3L15,9L19,9L19,13L21,13ZM5,9C6.105,9 7,8.105 7,7C7,5.895 6.105,5 5,5C3.895,5 3,5.895 3,7C3,8.105 3.895,9 5,9ZM11,9C12.105,9 13,8.105 13,7C13,5.895 12.105,5 11,5C9.895,5 9,5.895 9,7C9,8.105 9.895,9 11,9ZM11,15C12.105,15 13,14.105 13,13C13,11.895 12.105,11 11,11C9.895,11 9,11.895 9,13C9,14.105 9.895,15 11,15ZM17,21C18.105,21 19,20.105 19,19C19,17.895 18.105,17 17,17C15.895,17 15,17.895 15,19C15,20.105 15.895,21 17,21Z"
android:strokeColor="#00000000"
android:fillColor="#777777"
android:strokeWidth="1"/>
</vector>
26 changes: 26 additions & 0 deletions res/drawable/ic_security_pattern_5x5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Copyright (C) 2016 The CyanogenMod 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M4,17.268C3.402,17.613 3,18.26 3,19C3,20.105 3.895,21 5,21C5.74,21 6.387,20.598 6.732,20L9.268,20C9.613,20.598 10.26,21 11,21C12.105,21 13,20.105 13,19C13,17.895 12.105,17 11,17C10.26,17 9.613,17.402 9.268,18L6.732,18C6.557,17.696 6.304,17.443 6,17.268L6,14.732C6.598,14.387 7,13.74 7,13C7,11.895 6.105,11 5,11C3.895,11 3,11.895 3,13C3,13.74 3.402,14.387 4,14.732L4,17.268ZM21,11L21,9C21,7.89 20.1,7 19,7L17,7L17,5L21,5L21,3L15,3L15,9L19,9L19,11L15,11L15,13L19,13C20.1,13 21,12.11 21,11ZM5,9C6.105,9 7,8.105 7,7C7,5.895 6.105,5 5,5C3.895,5 3,5.895 3,7C3,8.105 3.895,9 5,9ZM11,9C12.105,9 13,8.105 13,7C13,5.895 12.105,5 11,5C9.895,5 9,5.895 9,7C9,8.105 9.895,9 11,9ZM11,15C12.105,15 13,14.105 13,13C13,11.895 12.105,11 11,11C9.895,11 9,11.895 9,13C9,14.105 9.895,15 11,15ZM17,21C18.105,21 19,20.105 19,19C19,17.895 18.105,17 17,17C15.895,17 15,17.895 15,19C15,20.105 15.895,21 17,21Z"
android:strokeColor="#00000000"
android:fillColor="#777777"
android:strokeWidth="1"/>
</vector>
26 changes: 26 additions & 0 deletions res/drawable/ic_security_pattern_6x6.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Copyright (C) 2016 The CyanogenMod 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M17,13L19,13C20.1,13 21,12.11 21,11L21,9C21,7.89 20.1,7 19,7L17,7L17,5L21,5L21,3L17,3C15.9,3 15,3.89 15,5L15,11C15,12.11 15.9,13 17,13L17,13ZM4,17.268C3.402,17.613 3,18.26 3,19C3,20.105 3.895,21 5,21C5.74,21 6.387,20.598 6.732,20L9.268,20C9.613,20.598 10.26,21 11,21C12.105,21 13,20.105 13,19C13,17.895 12.105,17 11,17C10.26,17 9.613,17.402 9.268,18L6.732,18C6.557,17.696 6.304,17.443 6,17.268L6,14.732C6.598,14.387 7,13.74 7,13C7,11.895 6.105,11 5,11C3.895,11 3,11.895 3,13C3,13.74 3.402,14.387 4,14.732L4,17.268ZM17,9L19,9L19,11L17,11L17,9ZM5,9C6.105,9 7,8.105 7,7C7,5.895 6.105,5 5,5C3.895,5 3,5.895 3,7C3,8.105 3.895,9 5,9ZM11,9C12.105,9 13,8.105 13,7C13,5.895 12.105,5 11,5C9.895,5 9,5.895 9,7C9,8.105 9.895,9 11,9ZM11,15C12.105,15 13,14.105 13,13C13,11.895 12.105,11 11,11C9.895,11 9,11.895 9,13C9,14.105 9.895,15 11,15ZM17,21C18.105,21 19,20.105 19,19C19,17.895 18.105,17 17,17C15.895,17 15,17.895 15,19C15,20.105 15.895,21 17,21Z"
android:strokeColor="#00000000"
android:fillColor="#777777"
android:strokeWidth="1"/>
</vector>
11 changes: 11 additions & 0 deletions res/layout-sw600dp/crypt_keeper_pattern_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@

</LinearLayout>

<LinearLayout
android:id="@+id/pattern_sizes"
android:layout_width="@dimen/crypt_keeper_pattern_size"
android:layout_height="@dimen/crypt_keeper_pattern_size"
android:orientation="horizontal"
android:layout_gravity="center_horizontal">

<include layout="@layout/crypt_keeper_pattern_sizes" />

</LinearLayout>

<include layout="@layout/crypt_keeper_emergency_button" />

</LinearLayout>
25 changes: 25 additions & 0 deletions res/layout/choose_lock_pattern_size_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The CyanogenMod 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.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="56dp"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:text="@string/lock_settings_picker_pattern_size_message"
style="@style/LockPatternSizeHeaderStyle" />
12 changes: 12 additions & 0 deletions res/layout/crypt_keeper_pattern_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@

</LinearLayout>

<LinearLayout
android:id="@+id/pattern_sizes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/crypt_keeper_pattern_margin"
android:layout_marginEnd="@dimen/crypt_keeper_pattern_margin"
android:orientation="horizontal">

<include layout="@layout/crypt_keeper_pattern_sizes" />

</LinearLayout>

<include layout="@layout/crypt_keeper_emergency_button" />

</LinearLayout>
69 changes: 69 additions & 0 deletions res/layout/crypt_keeper_pattern_sizes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod 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">

<Button
android:id="@+id/lock_pattern_size_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:text="@string/lock_pattern_size_3"
android:textColor="@android:color/white"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"/>

<Button
android:id="@+id/lock_pattern_size_4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:text="@string/lock_pattern_size_4"
android:textColor="@android:color/white"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"/>

<Button
android:id="@+id/lock_pattern_size_5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:text="@string/lock_pattern_size_5"
android:textColor="@android:color/white"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"/>

<Button
android:id="@+id/lock_pattern_size_6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:text="@string/lock_pattern_size_6"
android:textColor="@android:color/white"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"/>


</merge >

11 changes: 11 additions & 0 deletions res/values/cm_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@
<string name="increasing_ring_min_volume_title">Start volume</string>
<string name="increasing_ring_ramp_up_time_title">Ramp-up time</string>

<!-- Lock screen pattern size -->
<string name="lock_pattern_size_3" translatable="false">3 \u00d7 3</string>
<string name="lock_pattern_size_4" translatable="false">4 \u00d7 4</string>
<string name="lock_pattern_size_5" translatable="false">5 \u00d7 5</string>
<string name="lock_pattern_size_6" translatable="false">6 \u00d7 6</string>
<string name="lock_settings_picker_pattern_size_message">Choose a pattern size</string>
<!-- Whether a visible red line will be drawn after the user has drawn the unlock pattern incorrectly -->
<string name="lockpattern_settings_enable_error_path_title">Show pattern error</string>
<!-- Whether the dots will be drawn when using the lockscreen pattern -->
<string name="lockpattern_settings_enable_dots_title">Show pattern dots</string>

<!-- Lock screen cover art -->
<string name="lockscreen_media_art_title">Display media cover art</string>

Expand Down
23 changes: 23 additions & 0 deletions res/values/lineage_styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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>
<style name="LockPatternSizeHeaderStyle" parent="android:style/TextAppearance.Material.Subhead">
<item name="android:paddingTop">16dp</item>
<item name="android:textColor">@color/primary_dark_material_light</item>
<item name="android:lineSpacingMultiplier">1.2</item>
</style>
</resources>
44 changes: 44 additions & 0 deletions res/xml/security_settings_pattern_size.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012-2013 The CyanogenMod 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">

<Preference
android:icon="@drawable/ic_security_pattern_3x3"
android:key="lock_pattern_size_3"
android:title="@string/lock_pattern_size_3"
android:persistent="false"/>

<Preference
android:icon="@drawable/ic_security_pattern_4x4"
android:key="lock_pattern_size_4"
android:title="@string/lock_pattern_size_4"
android:persistent="false"/>

<Preference
android:icon="@drawable/ic_security_pattern_5x5"
android:key="lock_pattern_size_5"
android:title="@string/lock_pattern_size_5"
android:persistent="false"/>

<Preference
android:icon="@drawable/ic_security_pattern_6x6"
android:key="lock_pattern_size_6"
android:title="@string/lock_pattern_size_6"
android:persistent="false"/>

</PreferenceScreen>
Loading

0 comments on commit c384940

Please sign in to comment.