Skip to content
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

Fix Android 13 biometric enrollment crash #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/android/NativeSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public class NativeSettings extends CordovaPlugin {

@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
Context context=this.cordova.getActivity().getApplicationContext();
Context context = this.cordova.getActivity().getApplicationContext();
PluginResult.Status status = PluginResult.Status.OK;
Uri packageUri = Uri.parse("package:" + this.cordova.getActivity().getPackageName());
String result = "";

//Information on settings can be found here:
//http://developer.android.com/reference/android/provider/Settings.html

action = args.getString(0);
Intent intent = null;
action = args.getString(0);
Intent intent = null;

if (action.equals("accessibility")) {
intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
Expand All @@ -59,12 +59,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
else if (action.equals("battery_optimization")) {
intent = new Intent(android.provider.Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS);
} else if (action.equals("biometric")) {

intent = new Intent();
// Uncomment the below code when Cordova supports Android 30 / R
/*if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
intent = new Intent(android.provider.Settings.ACTION_BIOMETRIC_ENROLL);
} else */ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
} else if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
intent = new Intent(android.provider.Settings.ACTION_FINGERPRINT_ENROLL);
} else {
// Atleast open the settings landing page
Expand Down