-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Force security if not protected #4087
[Feature request] Force security if not protected #4087
Conversation
29be800
to
b889f1b
Compare
d24fb0c
to
73d6f63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes suggested here @manuelplazaspalacio!
owncloudApp/src/main/java/com/owncloud/android/extensions/ActivityExt.kt
Outdated
Show resolved
Hide resolved
owncloudApp/src/main/java/com/owncloud/android/extensions/ActivityExt.kt
Outdated
Show resolved
Hide resolved
owncloudApp/src/main/java/com/owncloud/android/utils/MdmConfigurations.kt
Show resolved
Hide resolved
.../java/com/owncloud/android/presentation/viewmodels/settings/SettingsSecurityViewModelTest.kt
Outdated
Show resolved
Hide resolved
.../java/com/owncloud/android/presentation/viewmodels/settings/SettingsSecurityViewModelTest.kt
Outdated
Show resolved
Hide resolved
.../java/com/owncloud/android/presentation/viewmodels/settings/SettingsSecurityViewModelTest.kt
Outdated
Show resolved
Hide resolved
5cfb2c7
to
420a37b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last changes here 😁 good job @manuelplazaspalacio!
@@ -285,39 +286,46 @@ fun Activity.hideSoftKeyboard() { | |||
fun Activity.checkPasscodeEnforced(securityEnforced: SecurityEnforced) { | |||
val sharedPreferencesProvider = OCSharedPreferencesProvider(this) | |||
|
|||
// If device protection is false, launch the previous behaviour (check the lockEnforced). | |||
// If device protection is true, check the lockEnforced only if device is not secure. | |||
val deviceProtection: Boolean = !this.resources.getBoolean(R.bool.device_protection) || !isDeviceSecure() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device_protection
should be retrieved from the MDM provider since we have the option there 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, regarding the new methods, we are testing the method isSecurityEnforcedEnabled
, so tests should always start by is security enforced enabled
and not by is security enforced disabled
, we are mixing here the name of the method to test with the locked enforced value.
I would propose a new naming for all these tests:
is security enforced enabled {true|false} - ok - device {not} secure {no} device protection {no} lock enforced
So that we know which method we are testing (is security enforced enabled
), the expected result of this test case ({true|false}
), and the value of each of the 3 parameters involved (device {not} secure {no} device protection {no} lock enforced
).
tested with
Summarizing:
|
(1) [FIXED]I was not able to reproduce the base case
Current: Security method is not asked after first open, user can enter URL and work with the app without security in app and device Expected: Pixel2 Android11 |
c826184
to
7805174
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(2) [FIXED]Set
then, install the app from scratch Current: app is asking users to choose pattern or passcode Pixel 2 Android 11 |
Adding device to security checks. Modifying and adding tests for new security checks.
Adding comments to devices protection checks. Changing device protection messages.
Obtaining the device protection from the MdmProvider.
0a936e8
to
bad94b8
Compare
Approved. Ready to go |
Related Issues
App: #4061
Library PR (if needed):
QA
#4087 (comment)