getodk / skunkworks-crow

Skunkworks-crow is an Android app for sharing filled forms stored in ODK Collect from one device to another
Other
23 stars 73 forks source link

Add runtime permission to allow write_settings permission #238

Open shobhitagarwal1612 opened 5 years ago

shobhitagarwal1612 commented 5 years ago

Software and hardware versions

Android 6.0.1

Problem description

My guess is that this is a regression caused while adding runtime permissions.

Steps to reproduce the problem

Attempt to send a form in Android 6.0

Expected behavior

A prompt should appear to allow the write settings permissions when the below method is attempted to call

Other information

04-04 22:00:28.950 16350-16350/org.odk.share E/WifiHospotConnector: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at org.odk.share.network.WifiHospotConnector.toggleHotspot(WifiHospotConnector.java:139)
        at org.odk.share.network.WifiHospotConnector.enableHotspot(WifiHospotConnector.java:129)
        at org.odk.share.activities.SendActivity.initiateHotspot(SendActivity.java:196)
        at org.odk.share.activities.SendActivity.startHotspot(SendActivity.java:165)
        at org.odk.share.activities.SendActivity.toggleHotspot(SendActivity.java:493)
        at org.odk.share.activities.SendActivity.checkLocationPermission(SendActivity.java:466)
        at org.odk.share.activities.SendActivity.onResume(SendActivity.java:305)
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1259)
        at android.app.Activity.performResume(Activity.java:6361)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
        at android.app.ActivityThread.access$900(ActivityThread.java:150)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: java.lang.SecurityException: org.odk.share was not granted  this permission: android.permission.WRITE_SETTINGS.
        at android.os.Parcel.readException(Parcel.java:1620)
        at android.os.Parcel.readException(Parcel.java:1573)
        at android.net.wifi.IWifiManager$Stub$Proxy.setWifiApEnabled(IWifiManager.java:1456)
        at android.net.wifi.WifiManager.setWifiApEnabled(WifiManager.java:1543)
        at java.lang.reflect.Method.invoke(Native Method) 
        at org.odk.share.network.WifiHospotConnector.toggleHotspot(WifiHospotConnector.java:139) 
        at org.odk.share.network.WifiHospotConnector.enableHotspot(WifiHospotConnector.java:129) 
        at org.odk.share.activities.SendActivity.initiateHotspot(SendActivity.java:196) 
        at org.odk.share.activities.SendActivity.startHotspot(SendActivity.java:165) 
        at org.odk.share.activities.SendActivity.toggleHotspot(SendActivity.java:493) 
        at org.odk.share.activities.SendActivity.checkLocationPermission(SendActivity.java:466) 
        at org.odk.share.activities.SendActivity.onResume(SendActivity.java:305) 
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1259) 
        at android.app.Activity.performResume(Activity.java:6361) 
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092) 
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481) 
        at android.app.ActivityThread.access$900(ActivityThread.java:150) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
SaumiaSinghal commented 4 years ago

Hie @shobhitagarwal1612! I would like to work on this issue.

SaumiaSinghal commented 4 years ago

@opendatakit-bot claim

getodk-bot commented 4 years ago

Welcome to Open Data Kit, @SaumiaSinghal! We just sent you an invite to collaborate on this repository at https://github.com/opendatakit/skunkworks-crow/invitations. Please accept this invite in order to claim this issue and begin a fun and rewarding experience contributing to Open Data Kit!

Here are some tips to get you off to a good start:

See you on the other side (that is, the pull request side)!

getodk-bot commented 4 years ago

Hello @SaumiaSinghal, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days.

You can reclaim this issue or claim any other issue by commenting @opendatakit-bot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

virajpatel2411 commented 4 years ago

@opendatakit-bot claim

getodk-bot commented 4 years ago

Welcome to Open Data Kit, @virajpatel2411! We just sent you an invite to collaborate on this repository at https://github.com/opendatakit/skunkworks-crow/invitations. Please accept this invite in order to claim this issue and begin a fun and rewarding experience contributing to Open Data Kit!

Here are some tips to get you off to a good start:

See you on the other side (that is, the pull request side)!

SaumiaSinghal commented 4 years ago

Hie @virajpatel2411! I have worked on this issue and submitted a PR for the same. I am waiting a review from the maintainers. Would you mind working on other issue? Thanks!

virajpatel2411 commented 4 years ago

Okayy. I thought you were unassigned.

getodk-bot commented 4 years ago

Hello @virajpatel2411, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days.

You can reclaim this issue or claim any other issue by commenting @opendatakit-bot claim on that issue.

Thanks for your contributions, and hope to see you again soon!