Skip to content

Allow the system to error when missing required permissions #286

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

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

grantland
Copy link
Contributor

Our GCM permission checks would NPE if there were no permissions
defined. Adding a proper null check allows the system to properly
throw when missing required ACCESS_NETWORK_STATE or INTERNET
permissions

Example error with no permissions:

12-10 11:26:08.830 2457-2472/com.parse.starter E/AndroidRuntime: FATAL EXCEPTION: Parse.initialize Disk Check & Starting Command Cache
                                                                 Process: com.parse.starter, PID: 2457
                                                                 java.lang.SecurityException: ConnectivityService: Neither user 10064 nor current process has android.permission.ACCESS_NETWORK_STATE.
                                                                     at android.os.Parcel.readException(Parcel.java:1599)
                                                                     at android.os.Parcel.readException(Parcel.java:1552)
                                                                     at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:974)
                                                                     at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:646)
                                                                     at com.parse.ConnectivityNotifier.isConnected(ConnectivityNotifier.java:43)
                                                                     at com.parse.ParsePinningEventuallyQueue.<init>(ParsePinningEventuallyQueue.java:89)
                                                                     at com.parse.Parse.getEventuallyQueue(Parse.java:417)
                                                                     at com.parse.Parse$1.run(Parse.java:216)

@facebook-github-bot
Copy link

By analyzing the blame information on this pull request, we identified @grantland to be a potential reviewer.

@wangmengyan95
Copy link
Contributor

LGTM!

Our GCM permission checks would NPE if there were no permissions
defined. Adding a proper null check allows the system to properly
throw when missing required ACCESS_NETWORK_STATE or INTERNET
permissions
@grantland grantland force-pushed the grantland.permissions branch from e7f196d to 6ba2ba4 Compare December 10, 2015 19:55
grantland added a commit that referenced this pull request Dec 10, 2015
Allow the system to error when missing required permissions
@grantland grantland merged commit c686f25 into master Dec 10, 2015
@facebook-github-bot
Copy link

@grantland updated the pull request.

@grantland grantland modified the milestone: 1.11.1 Dec 17, 2015
@facebook-github-bot
Copy link

@grantland updated the pull request.

@rogerhu rogerhu deleted the grantland.permissions branch April 12, 2017 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants