MM-15643 Better close app when checking for pin code (#2846)

This commit is contained in:
Harrison Healey 2019-05-30 14:46:35 -04:00 committed by Miguel Alatzar
parent daa8152691
commit 3503025e53
2 changed files with 10 additions and 3 deletions

View file

@ -68,7 +68,14 @@ public class MattermostManagedModule extends ReactContextBaseJavaModule {
@ReactMethod
// Close the current activity and open the security settings.
public void goToSecuritySettings() {
getCurrentActivity().finish();
getReactApplicationContext().startActivity(new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS));
getCurrentActivity().finish();
System.exit(0);
}
@ReactMethod
public void quitApp() {
getCurrentActivity().finish();
System.exit(0);
}
}

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {BackHandler, NativeModules, DeviceEventEmitter} from 'react-native';
import {NativeModules, DeviceEventEmitter} from 'react-native';
import LocalAuth from 'react-native-local-auth';
import JailMonkey from 'jail-monkey';
@ -63,5 +63,5 @@ export default {
return JailMonkey.trustFall();
},
quitApp: BackHandler.exitApp,
quitApp: MattermostManaged.quitApp,
};