MCPcopy Create free account
hub / github.com/M66B/FairEmail / onHandleIntent

Method onHandleIntent

app/src/main/java/eu/faircode/email/ServiceUI.java:86–200  ·  view source on GitHub ↗
(@Nullable Intent intent)

Source from the content-addressed store, hash-verified

84 }
85
86 @Override
87 protected void onHandleIntent(@Nullable Intent intent) {
88 // Under certain circumstances, a background app is placed on a temporary whitelist for several minutes
89 // - Executing a PendingIntent from a notification.
90 // https://developer.android.com/about/versions/oreo/background#services
91 Log.i("Service UI intent=" + intent);
92 Log.logExtras(intent);
93
94 if (intent == null)
95 return;
96
97 String action = intent.getAction();
98 if (action == null)
99 return;
100
101 try {
102 String[] parts = action.split(":");
103 long id = (parts.length > 1 ? Long.parseLong(parts[1]) : -1);
104 long group = intent.getLongExtra("group", 0);
105
106 switch (parts[0]) {
107 case "clear":
108 onClear(id);
109 break;
110
111 case "trash":
112 cancel(group, id);
113 onMove(id, EntityFolder.TRASH);
114 break;
115
116 case "delete":
117 cancel(group, id);
118 onDelete(id);
119 break;
120
121 case "junk":
122 cancel(group, id);
123 onJunk(id);
124 break;
125
126 case "archive":
127 cancel(group, id);
128 onMove(id, EntityFolder.ARCHIVE);
129 break;
130
131 case "move":
132 cancel(group, id);
133 onMove(id);
134 break;
135
136 case "reply":
137 cancel(group, id);
138 onSeen(id);
139 onReplyDirect(id, intent);
140 break;
141
142 case "flag":
143 cancel(group, id);

Callers

nothing calls this directly

Calls 15

iMethod · 0.95
logExtrasMethod · 0.95
onClearMethod · 0.95
cancelMethod · 0.95
onMoveMethod · 0.95
onDeleteMethod · 0.95
onJunkMethod · 0.95
onSeenMethod · 0.95
onReplyDirectMethod · 0.95
onFlagMethod · 0.95
onHideMethod · 0.95
onSnoozeMethod · 0.95

Tested by

no test coverage detected