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): fall through request permissions #11496

Merged
merged 4 commits into from Mar 23, 2020

Conversation

garymathews
Copy link
Contributor

  • Fall through request<?>Permissions(), removing the need for has<?>Permissions()
TEST CASE
<uses-permission android:name="android.permission.READ_CALENDAR"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
const win = Ti.UI.createWindow({ backgroundColor: 'red' });

// Callback hell...
Ti.Calendar.requestCalendarPermissions(e => {
    if (e.success) {
        Ti.Contacts.requestContactsPermissions(e => {
            if (e.success) {
                Ti.Filesystem.requestStoragePermissions(e => {
                    if (e.success) {
                        Ti.Media.requestCameraPermissions(e => {
                            if (e.success) {
                                Ti.Media.requestAudioRecorderPermissions(e => {
                                    if (e.success) {
                                        win.backgroundColor = 'green';
                                    }
                                });
                            }
                        });
                    }
                });
            }
        });
    }
});

win.open();
  • Open application and accept all permissions. Window should be green.
  • Close application.
  • Re-open application, permissions should not be requested and window should be green.

JIRA Ticket

@build
Copy link
Contributor

build commented Feb 25, 2020

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6626 tests are passing.
(There are 699 skipped tests not included in that total)

Generated by 🚫 dangerJS against 24b9d58

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

Copy link
Contributor

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes LGTM

@sgtcoolguy
Copy link
Contributor

needs 9_0_X backport if aiming for 9.0.1 release...

@ssaddique
Copy link
Contributor

FR: Pass.
I've left a couple of notes on JIRA regarding this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants