You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/android-binderchannel-status-codes.md
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,23 @@ Consider the table that follows as an BinderChannel-specific addendum to the “
23
23
</td>
24
24
</tr>
25
25
<tr>
26
-
<td>1
26
+
<td>0
27
27
</td>
28
-
<td>Server app not installed
28
+
<td><ahref="https://developer.android.com/training/package-visibility">Server app not visible</a>.
29
+
</td>
30
+
<tdrowspan="6" >bindService() returns false
31
+
</td>
32
+
<tdrowspan="9" ><p>UNIMPLEMENTED<p>“The operation is not implemented or is not supported / enabled in this service.”
33
+
</td>
34
+
<td>Give up - This is an error in the client manifest.
29
35
</td>
30
-
<tdrowspan="5" >bindService() returns false
36
+
</tr>
37
+
<tr>
38
+
<td>1
31
39
</td>
32
-
<tdrowspan="8" ><p>UNIMPLEMENTED<p>“The operation is not implemented or is not supported / enabled in this service.”
40
+
<td>Server app not installed
33
41
</td>
34
-
<tdrowspan="9" >Direct the user to install/reinstall the server app.
42
+
<tdrowspan="8" >Direct the user to install/reinstall the server app.
35
43
</td>
36
44
</tr>
37
45
<tr>
@@ -90,6 +98,8 @@ Consider the table that follows as an BinderChannel-specific addendum to the “
90
98
<tdrowspan="5" ><p>PERMISSION_DENIED<p>
91
99
“The caller does not have permission to execute the specified operation …”
92
100
</td>
101
+
<td>Direct the user to update the server app in the hopes that a newer version fixes this error in its manifest.
102
+
</td>
93
103
</tr>
94
104
<tr>
95
105
<td>10
@@ -315,13 +325,15 @@ According to a review of the AOSP source code, there are in fact several cases:
315
325
1. The target package is not installed
316
326
2. The target package is installed but does not declare the target Service in its manifest.
317
327
3. The target package requests dangerous permissions but targets sdk <= M and therefore requires a permissions review, but the caller is not running in the foreground and so it would be inappropriate to launch the review UI.
328
+
4. The target package is not visible to the client due to [Android 11 package visibility rules](https://developer.android.com/training/package-visibility).
318
329
319
330
Status code mapping: **UNIMPLEMENTED**
320
331
321
332
(1) and (2) are interesting new possibilities unique to on-device RPC. (1) is straightforward and the most likely cause of (2) is that the user has an old version of the server app installed that predates its gRPC integration. Many clients will want to handle these cases, likely by directing the user to the app store in order to install/upgrade the server.
322
333
323
334
Unfortunately `UNIMPLEMENTED` doesn’t capture (3) but none of the other canonical status codes do either and we expect this case to be extremely rare.
324
335
336
+
(4) is intentially indistinguishable from (1) by Android design so we can't handle it differently. However, as a client manifest error, it's not something reasonable apps would handle at runtime anyway.
325
337
326
338
### bindService() throws SecurityException
327
339
@@ -382,4 +394,4 @@ Android’s Parcel class exposes a mechanism for marshalling certain types of `R
382
394
383
395
The calling Activity or Service Context might be destroyed with a gRPC request in flight. Apps should cease operations when the Context hosting it goes away and this includes cancelling any outstanding RPCs.
0 commit comments