RecoverableSecurityException, RIP

The O Developer Preview 1 added RecoverableSecurityException. This was an interesting class, where the exception could contain information about how to lead the user to an activity to recover from whatever the problem was. Your code catching the exception could then:

  • Display a dialog, with a button leading to the recovery activity
  • Raise a Notification, with an action leading to the recovery activity
  • Do whatever you want yourself (e.g., display a Snackbar)

However, comments on this issue and this issue indicate that RecoverableSecurityException is being removed from the Android SDK.

The specific phrasing of the comments is interesting:

The engineering team will no longer include support for this Exception in the upcoming Android O releases.

This might mean that the class will exist but be marked as @hide (“no longer include support”). Or, it could be discontinued outright. We’ll find out when the source code is released.

Regardless, I would not spend much time on RecoverableSecurityException until its final status is determined.

Learn second-generation Android app development — with Kotlin and the Android Jetpack — through CommonsWare’s Android app development training!