android-components /



Name Summary
Browsers class Browsers
Helpful tools for dealing with other browsers on this device.
ColorUtils object ColorUtils
DomainMatch data class DomainMatch
DownloadUtils object DownloadUtils
DrawableUtils object DrawableUtils
SafeBundle class SafeBundle
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.
SafeIntent class SafeIntent
External applications can pass values into Intents that can cause us to crash: in defense, we wrap Intent and catch the exceptions they may force us to throw. See bug 1090385 for more.
StatusBarUtils object StatusBarUtils
StorageUtils object StorageUtils
ThreadUtils object ThreadUtils
URLStringUtils object URLStringUtils
WebURLFinder class WebURLFinder
Regular expressions used in this class are taken from Android’s We brought them in to standardize URL matching across Android versions, instead of relying on Android version-dependent built-ins that can vary across Android versions. The original code can be found here:


Name Summary
asForegroundServicePendingIntent fun <ERROR CLASS>.asForegroundServicePendingIntent(context: <ERROR CLASS>, requestCode: Int, flags: Int = PendingIntent.FLAG_UPDATE_CURRENT): <ERROR CLASS>
Create a PendingIntent instance to run a certain service described with the Intent.
logElapsedTime fun <T> logElapsedTime(logger: Logger, op: String, block: () -> T): T
Executes the given block and logs the elapsed time in milliseconds. Uses System.nanoTime for measurements, since it isn’t tied to a wall-clock.
segmentAwareDomainMatch fun segmentAwareDomainMatch(query: String, urls: Iterable<String>): DomainMatch?
toSafeBundle fun <ERROR CLASS>.toSafeBundle(): <ERROR CLASS>
Returns a SafeBundle for the given Bundle.
toSafeIntent fun <ERROR CLASS>.toSafeIntent(): SafeIntent
Returns a SafeIntent for the given Intent.