Network Error (-3) When Switching Networks: Play Integrity API Issue #1628
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment Details
Feature: Play Integrity API
OS Type and Version: Android
Java Version: 1.8
Library Version(s):
Steps to Reproduce
On the Google Play Console, configure the "Unable to check device integrity" test response.
Connect to WiFi1 and launch the app. Integrity check is performed.
Switch to WiFi2 and launch the app. Integrity check is not performed.
Switch back to WiFi1 and launch the app. Integrity check is performed again.
Additional Notes:
If the app is force-stopped (via the Android TV home settings) after switching to WiFi2, the integrity check is performed upon the next app launch.
Code Example
Stack Trace
Investigation
I checked whether the integrityManager instance remains the same when the integrity check is performed vs. when it is not.
When integrity check is performed:
integrityManager: com.google.android.play.core.integrity.aa@8fe6d4
When integrity check is not performed:
integrityManager: com.google.android.play.core.integrity.aa@8fe6d4
After reinstalling the app:
integrityManager: com.google.android.play.core.integrity.aa@8f5a6e6
Since the integrityManager instance appears to be a singleton, it is recreated only after reinstalling the app. However, the API does not seem to provide a method to reset the integrityManager.
Workarounds Attempted
Currently, the only workaround I found is to restart the app process using the following method:
android.os.Process.killProcess(android.os.Process.myPid())
Other methods, such as the following, did not resolve the issue:
Request
Is there a recommended approach to handle this issue during network changes? Specifically, is there a way to reset the integrityManager without restarting the app process?
The text was updated successfully, but these errors were encountered: