MCPcopy Create free account
hub / github.com/Justson/AgentWeb / Action

Class Action

agentweb-core/src/main/java/com/just/agentweb/Action.java:31–126  ·  view source on GitHub ↗

@author cenxiaozhong @since 2.0.0

Source from the content-addressed store, hash-verified

29 * @since 2.0.0
30 */
31public final class Action {
32
33 public transient static final int ACTION_PERMISSION = 1;
34 public transient static final int ACTION_FILE = 2;
35 public transient static final int ACTION_CAMERA = 3;
36 public transient static final int ACTION_VIDEO = 4;
37 private ArrayList<String> mPermissions = new ArrayList<>();
38 private int mAction;
39 private int mFromIntention;
40 private Intent mIntent;
41 private Uri mUri;
42 private AgentActionFragment.RationaleListener mRationaleListener;
43 private AgentActionFragment.PermissionListener mPermissionListener;
44 private AgentActionFragment.ChooserListener mChooserListener;
45
46 public Action() {
47 }
48
49 public ArrayList<String> getPermissions() {
50 return mPermissions;
51 }
52
53 public void setPermissions(ArrayList<String> permissions) {
54 this.mPermissions = permissions;
55 }
56
57 public void setPermissions(String[] permissions) {
58 this.mPermissions = new ArrayList<>(Arrays.asList(permissions));
59 }
60
61 public int getAction() {
62 return mAction;
63 }
64
65 public void setAction(int action) {
66 this.mAction = action;
67 }
68
69
70 public int getFromIntention() {
71 return mFromIntention;
72 }
73
74 public static Action createPermissionsAction(String[] permissions) {
75 Action mAction = new Action();
76 mAction.setAction(Action.ACTION_PERMISSION);
77 List<String> mList = Arrays.asList(permissions);
78 mAction.setPermissions(new ArrayList<String>(mList));
79 return mAction;
80 }
81
82 public Action setFromIntention(int fromIntention) {
83 this.mFromIntention = fromIntention;
84 return this;
85 }
86
87 public AgentActionFragment.RationaleListener getRationaleListener() {
88 return mRationaleListener;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected