Browse Source

- use device credential if fingerprint was used on old version
- draft for what's new

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>

tobiaskaminsky 7 years ago
parent
commit
5f89a1f626

+ 6 - 5
src/main/java/com/owncloud/android/authentication/PassCodeManager.java

@@ -116,10 +116,8 @@ public class PassCodeManager {
     }
 
     private boolean passCodeIsEnabled() {
-        SharedPreferences appPrefs = PreferenceManager
-                .getDefaultSharedPreferences(MainApp.getAppContext());
-        return (appPrefs.getString(Preferences.PREFERENCE_LOCK, "")
-                .equals(Preferences.LOCK_PASSCODE));
+        SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(MainApp.getAppContext());
+        return appPrefs.getString(Preferences.PREFERENCE_LOCK, "").equals(Preferences.LOCK_PASSCODE);
     }
 
     private boolean deviceCredentialsShouldBeRequested(Activity activity) {
@@ -141,6 +139,9 @@ public class PassCodeManager {
 
     private boolean deviceCredentialsAreEnabled(Activity activity) {
         SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(activity);
-        return appPrefs.getString(Preferences.PREFERENCE_LOCK, "").equals(Preferences.LOCK_DEVICE_CREDENTIALS);
+        return appPrefs.getString(Preferences.PREFERENCE_LOCK, "").equals(Preferences.LOCK_DEVICE_CREDENTIALS) ||
+                Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
+                        (appPrefs.getBoolean(Preferences.PREFERENCE_USE_FINGERPRINT, false)
+                                && DeviceCredentialUtils.areCredentialsAvailable(activity));
     }
 }

+ 6 - 0
src/main/java/com/owncloud/android/features/FeatureList.java

@@ -41,6 +41,7 @@ public class FeatureList {
 
     private static final int VERSION_1_0_0 = 10000099;
     private static final int VERSION_3_0_0 = 30000099;
+    private static final int VERSION_3_1_0 = 30010000;
     private static final int BETA_VERSION_0 = 0;
 
     static public ArrayList<FeatureItem> get(boolean isMultiAccount) {
@@ -69,6 +70,11 @@ public class FeatureList {
                 R.string.whats_new_ipv6_content, VERSION_3_0_0,
                 BETA_VERSION_0, SHOW_ON_UPGRADE, false, false));
 
+        // 3.1.0
+        featuresList.add(new FeatureItem(R.drawable.whats_new_end_to_end_encryption,
+                R.string.whats_new_device_credentials_title, R.string.whats_new_device_credentials_content,
+                VERSION_3_1_0, BETA_VERSION_0, SHOW_ON_UPGRADE, false, false));
+
         return featuresList;
     }
 

+ 1 - 0
src/main/java/com/owncloud/android/ui/activity/Preferences.java

@@ -94,6 +94,7 @@ public class Preferences extends PreferenceActivity
     public static final String LOCK_PASSCODE = "passcode";
     public static final String LOCK_DEVICE_CREDENTIALS = "device_credentials";
 
+    public final static String PREFERENCE_USE_FINGERPRINT = "use_fingerprint";
     public static final String PREFERENCE_EXPERT_MODE = "expert_mode";
 
     private static final int ACTION_REQUEST_PASSCODE = 5;

+ 2 - 0
src/main/res/values/strings.xml

@@ -794,4 +794,6 @@
     <string name="sharee_add_failed">Adding sharee failed</string>
     <string name="unsharing_failed">Unsharing failed</string>
     <string name="updating_share_failed">Updating share failed</string>
+    <string name="whats_new_device_credentials_title">Use Android device protection</string>
+    <string name="whats_new_device_credentials_content">Use android internal device protection, e.g. pattern, password, fingerprint</string>
 </resources>