guardianproject / haven

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors
https://guardianproject.github.io/haven/
GNU General Public License v3.0
6.62k stars 728 forks source link

Android 8+ background service permissions #265

Closed lukeswitz closed 6 years ago

lukeswitz commented 6 years ago

Updated 4/6

Description & steps to reproduce:

Permissions crashes:

    • Doesn't get permission for SMS/phone during onboarding
    • Both phone & sms permissions requested simultaneously: must enter a different number after setting a first to get the calls permission to fire.
    • If any slide is skipped during onboarding the app will crash on mic/photo event, or if expecting that SMS from onboarding slide permission wasn't granted so crash there also.
    • Updated device without uninstalling the app & alert blew the cover with a request to send SMS, lighting up the screen instead of the intended behavior. 8.+ puts the app icon at the status bar when it's active in the BG.

Referenced from Google :

Starting with Android P, there is a new MIN_SUPPORTED_TARGET_SDK_INT class, which states the > minimum supported API level that can be used on the device. For Android P, the minimum API level > is v17, which corresponds to Android 4.2.

Android 8.0 (API level 26) also includes the following changes to specific methods:

The startService() method now throws an IllegalStateException if an app targeting Android 8.0 tries to use that method in a situation when it isn't permitted to create background services. The new Context.startForegroundService() method starts a foreground service. The system allows apps to call Context.startForegroundService() even while the app is in the background. However, the app must call that service's startForeground() method within five seconds after the service is created. For more information, see Background Execution Limits.

lukeswitz commented 6 years ago

Tested on 3 new devices all with separate issues, reopening.

lukeswitz commented 6 years ago

Current issue is localized to sms and phone permissions when using android P only. Closing until targeting that sdk