Commit c645a52
authored
test(SubscriptionsComponentTest): fix failing instrumentation tests before Android 14-QPR2 (#67)
The instrumentation tests fail on Android 13, because we migrated to the
newer API to create the listener too early. Only after the Android
14-QPR2 update the behavior was changed.
As of docs for SubscriptionManager.OnSubscriptionsChangedListener
constructor, we should continue to use the deprecated hidden API to
create the listener on versions prior to Android 15:
> On OS versions prior to {@link Build.VERSION_CODES#VANILLA_ICE_CREAM} callers should
> assume that this call will fail if invoked on a thread that does not already have a
> prepared looper.
---
> Task :connectedDebugAndroidTest
com.github.iusmac.sevensim.telephony.SubscriptionsComponentTest > test_shouldReturnTheSameVisibleSubscriptionInfoListWhenQueriedBySubId[SM-A105FN - 13] FAILED
java.lang.RuntimeException: Can't create handler inside thread Thread[Instr: com.github.iusmac.sevensim.HiltTestRunner,5,main] that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:227)
com.github.iusmac.sevensim.telephony.SubscriptionsComponentTest > test_shouldReturnTheSameVisibleSubscriptionInfoListWhenQueriedBySimSlotIndex_SinceR[SM-A105FN - 13] FAILED
java.lang.RuntimeException: Can't create handler inside thread Thread[Instr: com.github.iusmac.sevensim.HiltTestRunner,5,main] that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:227)
Signed-off-by: iusmac <iusico.maxim@libero.it>1 parent 7a3b018 commit c645a52
1 file changed
Lines changed: 3 additions & 3 deletions
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
0 commit comments