Created
November 7, 2019 12:28
-
-
Save iKlotho/eb69d48e9f446c58826ae13ab6511775 to your computer and use it in GitHub Desktop.
CordovaCall Fix Huawei Permission Request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(permissionCounter == 2) { | |
Intent intent = new Intent(); | |
// context.startActivity(intent); | |
// Intent phoneIntent = new Intent(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); | |
// phoneIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); | |
intent.setComponent(new ComponentName("com.android.server.telecom","com.android.server.telecom.settings.EnableAccountPreferenceActivity")); | |
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
this.cordova.getActivity().getApplicationContext().startActivity(intent); | |
} else { | |
this.callbackContext.error("You need to accept phone account permissions in order to send and receive calls"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment