[android] improve the error logging when run from Android app sandbox without network permissions
- Dominant language
- C++
- Stars
- 20
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
In order to debug an Android app, ds2 has to be run in the context of the app's sandbox. Since ds2 opens a TCP Socket, the app must have internet permissions declared in its manifest or ds2 cannot work.
```
```
When the app does not have these permissions, ds2 fails to launch with a misleading error message:
```
emu64xa:/ $ run-as com.example.app ./ds2 platform --server --listen localhost:6543
[6898][std::unique_ptr CreateTCPSocket(const std::string &, const std::string &, bool)] FATAL : cannot listen on [localhost:6543]: Success
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x00005e71c7a40dd7 +0x5e71c7a40dd7 (/data/user/0/com.example.jniplayground/ds2+0xa9dd7)
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x00005e71c7a41b78 +0x5e71c7a41b78 (/data/user/0/com.example.jniplayground/ds2+0xaab78)
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x00005e71c79f8158 +0x5e71c79f8158 (/data/user/0/com.example.jniplayground/ds2+0x61158)
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x00005e71c79f8801 +0x5e71c79f8801 (/data/user/0/com.example.jniplayground/ds2+0x61801)
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x00005e71c79f6dc9 +0x5e71c79f6dc9 (/data/user/0/com.example.jniplayground/ds2+0x5fdc9)
[6898][void ds2::Utils::PrintBacktrace()] ERROR : 0x0000786c986e8c63 __libc_init+0x73 (/apex/com.android.runtime/lib64/bionic/libc.so+0x57c63)
Aborted
```
We should improve this error message to clearly indicate the problem may be due to missing network permissions if being run on Android.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.