RoleManagerCompat
public
final
class
RoleManagerCompat
extends Object
java.lang.Object | |
↳ | androidx.core.role.RoleManagerCompat |
This class contains the name and documentation for roles that might be available in the system.
The list of available roles might change with a system app update, so apps should not make
assumption about the availability of roles. Instead, they should always check if the role is
available using RoleManager.isRoleAvailable(String)
before trying to do
anything with it.
See also:
Summary
Constants | |
---|---|
String |
ROLE_ASSISTANT
The name of the assistant role. |
String |
ROLE_BROWSER
The name of the browser role. |
String |
ROLE_CALL_REDIRECTION
The name of the call redirection role. |
String |
ROLE_CALL_SCREENING
The name of the call screening and caller id role. |
String |
ROLE_DIALER
The name of the dialer role. |
String |
ROLE_EMERGENCY
The name of the emergency role. |
String |
ROLE_HOME
The name of the home role. |
String |
ROLE_SMS
The name of the SMS role. |
String |
ROLE_SYSTEM_GALLERY
The name of the system gallery role. |
Inherited methods | |
---|---|
Constants
ROLE_ASSISTANT
public static final String ROLE_ASSISTANT
The name of the assistant role.
To qualify for this role, an application needs to either implement
VoiceInteractionService
or handle
Intent.ACTION_ASSIST
. The application will be able to access call log
and SMS for its functionality.
Constant Value: "android.app.role.ASSISTANT"
ROLE_BROWSER
public static final String ROLE_BROWSER
The name of the browser role.
To qualify for this role, an application needs to handle the intent to browse the Internet:
<activity>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
</intent-filter>
</activity>
The application will be able to handle that intent by default.
See also:
Constant Value: "android.app.role.BROWSER"
ROLE_CALL_REDIRECTION
public static final String ROLE_CALL_REDIRECTION
The name of the call redirection role.
To qualify for this role, an application needs to implement
CallRedirectionService
. The application will be able to re-write the
phone number for an outgoing call to place the call through a call redirection service.
See also:
Constant Value: "android.app.role.CALL_REDIRECTION"
ROLE_CALL_SCREENING
public static final String ROLE_CALL_SCREENING
The name of the call screening and caller id role.
To qualify for this role, an application needs to implement
CallScreeningService
. The application will be able to screen calls
and provide call identification. The application will also be able to display over other apps
on Android 11 or above.
See also:
Constant Value: "android.app.role.CALL_SCREENING"
ROLE_DIALER
public static final String ROLE_DIALER
The name of the dialer role.
To qualify for this role, an application needs to handle the intent to dial:
<activity>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="tel" />
</intent-filter>
</activity>
The application will be able to handle those intents by default, and gain access to phone,
contacts, SMS, microphone and camera.
See also:
Constant Value: "android.app.role.DIALER"
ROLE_EMERGENCY
public static final String ROLE_EMERGENCY
The name of the emergency role.
You may not be able to request for this role on most devices as it's hidden by default and only for system apps.
To qualify for this role, an application needs to handle the intent for emergency assitance:
<activity>
<intent-filter>
<action android:name="android.telephony.action.EMERGENCY_ASSISTANCE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The application will be used for emergency assistance.
Constant Value: "android.app.role.EMERGENCY"
ROLE_HOME
public static final String ROLE_HOME
The name of the home role.
To qualify for this role, an application needs to handle the intent for home:
<activity>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
The application will be able to handle that intent by default, and used as the default home
app.
See also:
Constant Value: "android.app.role.HOME"
ROLE_SMS
public static final String ROLE_SMS
The name of the SMS role.
To qualify for this role, an application needs to declare the following components:
<activity>
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="smsto" />
</intent-filter>
</activity>
<service android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE">
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="smsto" />
</intent-filter>
</service>
<receiver android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER" />
</intent-filter>
</receiver>
<receiver android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
The application will be able to handle the intent to send SMS by default, and gain access to
phone, contacts, SMS, storage, microphone and camera.
See also:
Constant Value: "android.app.role.SMS"
ROLE_SYSTEM_GALLERY
public static final String ROLE_SYSTEM_GALLERY
The name of the system gallery role.
You can not request for this role because it's hidden and only for system apps. It's meant to be granted out-of-the-box to a gallery app that shipped with the device.
The application will gain full read and write access to all image and video files on external storage, including access to location metadata.
Constant Value: "android.app.role.SYSTEM_GALLERY"