androidx.test.internal.runner.InstrumentationConnection.init error in androidU
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start at InstrumentationConnection line 173, where targetContext.registerReceiver is called, and review the Android U receiver-registration requirement described in the issue. Done means an app targeting API 34 no longer crashes on Android U devices while registration continues to work on older Android versions.
Written by the indexing model from the issue text.
Description
Description
In androidU,if the app target is 34 , when we registerReceiver,we must use the RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flag , but the class InstrumentationConnection did not do this when it int.
so my app is crash on androidU devices
the error code in InstrumentationConnection is on line 173
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER));
Expected Results
I want the class InstrumentationConnection on line 173 like this:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER),Context.RECEIVER_EXPORTED);
} else {
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER));
}
Link to a public git repo demonstrating the problem:
https://developer.android.google.cn/guide/components/broadcasts#context-registered-receivers
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/android-test
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
android/android-test#681 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
android/android-test#2507 · 1 comment ·
-
ξεκσνδξδ Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2499 ·
-
ησξξσ Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2498 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
android/android-test#2473 ·
All issues in android/android-test
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·