Skip to content

Instantly share code, notes, and snippets.

@iKlotho
Created November 7, 2019 12:28
Show Gist options
  • Save iKlotho/eb69d48e9f446c58826ae13ab6511775 to your computer and use it in GitHub Desktop.
Save iKlotho/eb69d48e9f446c58826ae13ab6511775 to your computer and use it in GitHub Desktop.
CordovaCall Fix Huawei Permission Request
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