src/permissions.android.js
function handlePermissionResults(args) {

	// get current promise set
	//noinspection JSUnresolvedVariable
	const promises = pendingPromises[args.requestCode];

	// We have either gotten a promise from somewhere else or a bug has occurred and android has called us twice
	// In either case we will ignore it...
	if (!promises || typeof promises.granted !== 'function') {
		return;
	}

	// Delete it, since we no longer need to track it
	//noinspection JSUnresolvedVariable
	delete pendingPromises[args.requestCode];

	let trackingResults = promises.results;

	//noinspection JSUnresolvedVariable
	const length = args.permissions.length;
	for (let i = 0; i < length; i++) {
		// Convert back to JS String
		//noinspection JSUnresolvedVariable
		const name = args.permissions[i].toString();

		//noinspection RedundantIfStatementJS,JSUnresolvedVariable,JSUnresolvedFunction
		if (args.grantResults[i] === android.content.pm.PackageManager.PERMISSION_GRANTED) {
			trackingResults[name] = true;
		} else {
			trackingResults[name] = false;
		}
	}

	// Any Failures
	let failureCount = 0;
	for (let key in trackingResults) {
		if (!trackingResults.hasOwnProperty(key)) continue;
		if (trackingResults[key] === false) failureCount++;
	}

	if (Object.keys(pendingPromises).length === 0) {
		removeEventListeners();
	}

	if (failureCount === 0) {
		promises.granted(trackingResults);
	} else {
		promises.failed(trackingResults);
	}

}
function handlePermissionResults(args) {

	// get current promise set
	//noinspection JSUnresolvedVariable
	const promises = pendingPromises[args.requestCode];

	// We have either gotten a promise from somewhere else or a bug has occurred and android has called us twice
	// In either case we will ignore it...
	if (!promises || typeof promises.granted !== 'function') {
		return;
	}

	// Delete it, since we no longer need to track it
	//noinspection JSUnresolvedVariable
	delete pendingPromises[args.requestCode];

	let trackingResults = promises.results;

	//noinspection JSUnresolvedVariable
	const length = args.permissions.length;
	for (let i = 0; i < length; i++) {
		// Convert back to JS String
		//noinspection JSUnresolvedVariable
		const name = args.permissions[i].toString();

		//noinspection RedundantIfStatementJS,JSUnresolvedVariable,JSUnresolvedFunction
		if (args.grantResults[i] === android.content.pm.PackageManager.PERMISSION_GRANTED) {
			trackingResults[name] = true;
		} else {
			trackingResults[name] = false;
		}
	}

	// Any Failures
	let failureCount = 0;
	for (let key in trackingResults) {
		if (!trackingResults.hasOwnProperty(key)) continue;
		if (trackingResults[key] === false) failureCount++;
	}

	if (Object.keys(pendingPromises).length === 0) {
		removeEventListeners();
	}

	if (failureCount === 0) {
		promises.granted(trackingResults);
	} else {
		promises.failed(trackingResults);
	}

}
function handlePermissionResults ( args ) { // get current promise set //noinspection JSUnresolvedVariable const promises = pendingPromises [ args . requestCode ] ; // We have either gotten a promise from somewhere else or a bug has occurred and android has called us twice // In either case we will ignore it... if ( ! promises || typeof promises . granted !== 'function' ) { return ; } // Delete it, since we no longer need to track it //noinspection JSUnresolvedVariable delete pendingPromises [ args . requestCode ] ; let trackingResults = promises . results ; //noinspection JSUnresolvedVariable const length = args . permissions . length ; for ( let i = 0 ; i < length ; i ++ ) { // Convert back to JS String //noinspection JSUnresolvedVariable const name = args . permissions [ i ] . toString ( ) ; //noinspection RedundantIfStatementJS,JSUnresolvedVariable,JSUnresolvedFunction if ( args . grantResults [ i ] === android . content . pm . PackageManager . PERMISSION_GRANTED ) { trackingResults [ name ] = true ; } else { trackingResults [ name ] = false ; } } // Any Failures let failureCount = 0 ; for ( let key in trackingResults ) { if ( ! trackingResults . hasOwnProperty ( key ) ) continue ; if ( trackingResults [ key ] === false ) failureCount ++ ; } if ( Object . keys ( pendingPromises ) . length === 0 ) { removeEventListeners ( ) ; } if ( failureCount === 0 ) { promises . granted ( trackingResults ) ; } else { promises . failed ( trackingResults ) ; } }
noinspection JSUnresolvedVariable,JSUnresolvedFunction 
This handles the results of getting the permissions!
noinspection JSUnresolvedVariable JSUnresolvedFunction This handles the results of getting the permissions!