(@Nullable Intent intent)
| 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); |
nothing calls this directly
no test coverage detected