Permissions

  1. The Hover SDK requires the following permissions which you do not need to add as they are automatically merged by including the SDK in the gradle.build dependencies:
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-feature android:name="android.hardware.telephony"/>

Some of these permissions are considered "dangerous" by Google and must be granted by the user at app runtime. As of Android Oreo the runtime permissions that must be granted by the user are READ_PHONE_STATE/CALL_PHONE and RECEIVE_SMS/READ_SMS. BIND_ACCESSIBILITY_SERVICE is a special permission which users must enable through a permission management screen in Android settings. Users can be can be sent to the screen from your app, but must toggle the setting themselves. SYSTEM_ALERT_WINDOW is also a special permission, but so long as your app is downloaded from the Play Store it will be granted without the user having to do anything. During development and if your app is sideloaded then the user will also have to grant this in the settings.

Hover includes an optional helper activity to get the permissions from the user. This helper is automatically used if you start a ussd session without first getting the required permissions:

import com.hover.sdk.permissions.PermissionActivity;
...
startActivityForResult(new Intent(this, PermissionActivity.class), 0);

The result is RESULT_OK if ALL the permissions were granted.

Below is the full permission flow provided by PermissionActivity. If any permissions have already been granted then they will be missing from the summary list and their corresponding dialog with not show. Most strings can be translated, see customization

Permissions summary

Will only list permissions not yet granted

Phone permission

Allows reading the SIM card and dialing USSD codes. This dialog is provided by Android and cannot be changed.

SMS permission

Allows reading SMS as they are received. This dialog is provided by Android and cannot be changed.

Overlay request

Pressing "allow" will take the user directly to the following overlay toggle settings page.

Overlay toggle

The user must press the toggle in the top right and then press back to return to the app. The text on this screen is provided by Android and cannot be changed.

Accessibility request

Pressing "open settings" will take the user directly to the following accessibilty settings list page.

Accessibility list

The user must find your app in the list and choose it.

Accessibility toggle

The user must press the toggle in the top right which will show the following confirmation dialog. The text on this screen is customizable.

Accessibility confirm

Once the user presses "OK" they will automatically be taken back to your app and the Permission Activity will complete with RESULT_OK

Note

In all versions of android except 6.0.1-6.0.4, the SYSTEM_ALERT_WINDOW permission is automatically granted to apps that request it, as long as the app is downloaded from the Play Store. The "Allow display over other apps" screen is only shown to users when the permission is not granted automatically.