AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.BulkPermissionRequest Class Referenceabstract

Public Member Functions

abstract void onGranted ()
 
void onDenied (String[] permissions)
 
final List< String > getPermissions ()
 

Protected Member Functions

 BulkPermissionRequest (Component source, String caller, String... permissions)
 

Detailed Description

Components can use BulkPermissionRequest to request multiple permissions in a single check by Form#askPermission(BulkPermissionRequest) rather than chaining multiple PermissionRequestCallbacks.

Author
ewpat.nosp@m.ton@.nosp@m.mit.e.nosp@m.du (Evan W. Patton)

Definition at line 22 of file BulkPermissionRequest.java.

Constructor & Destructor Documentation

◆ BulkPermissionRequest()

com.google.appinventor.components.runtime.util.BulkPermissionRequest.BulkPermissionRequest ( Component  source,
String  caller,
String...  permissions 
)
protected

Construct a new BulkPermissionRequest.

Parameters
sourcethe component requesting the permissions, for error reporting
callerthe method requesting the permissions, for error reporting
permissionsthe list of permissions to request

Definition at line 34 of file BulkPermissionRequest.java.

Member Function Documentation

◆ getPermissions()

final List<String> com.google.appinventor.components.runtime.util.BulkPermissionRequest.getPermissions ( )

Gets a mutable copy of the permissions requested.

Returns
the list of desired permissions

Definition at line 65 of file BulkPermissionRequest.java.

◆ onDenied()

void com.google.appinventor.components.runtime.util.BulkPermissionRequest.onDenied ( String[]  permissions)

Handles the scenario where one or more permissions in the request has been rejected. Subclasses may override this method to provide their own behavior.

Parameters
permissionsthe array of permissions that were denied

Definition at line 53 of file BulkPermissionRequest.java.

◆ onGranted()

abstract void com.google.appinventor.components.runtime.util.BulkPermissionRequest.onGranted ( )
abstract

Subclasses must implement onGranted to provide behavior for when all permissions are granted. This method is called either because all permissions were previously granted or because the user was prompted and answered affirmatively.


The documentation for this class was generated from the following file: