android-components / mozilla.components.support.utils / SafeBundle

SafeBundle

class SafeBundle (source)

See SafeIntent for more background: applications can put garbage values into Bundles. This is primarily experienced when there’s garbage in the Intent’s Bundle. However that Bundle can contain further bundles, and we need to handle those defensively too.

See bug 1090385 for more.

Constructors

Name Summary
<init> SafeBundle(unsafe: <ERROR CLASS>)
See SafeIntent for more background: applications can put garbage values into Bundles. This is primarily experienced when there’s garbage in the Intent’s Bundle. However that Bundle can contain further bundles, and we need to handle those defensively too.

Properties

Name Summary
unsafe val unsafe: <ERROR CLASS>

Functions

Name Summary
getInt fun getInt(name: String, defaultValue: Int = 0): Int
getParcelable fun <T> getParcelable(name: String): T?
getString fun getString(name: String): String?

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.