PropOverride

@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])  @RequiresApi(value = 21) public final class PropOverride


PropOverride provides temporary overriding of a platform setprop value, with resetting to avoid polluting device state.

It's recommended to use a try/finally to ensure that resetIfOverridden isn't missed.

Barring that, using a single static instance enables reset to happen later if one reset is missed.

Summary

Public constructors

PropOverride(@NonNull String propName, @NonNull String overrideValue)

Public methods

final void
final void

Public constructors

PropOverride

public final PropOverride(@NonNull String propName, @NonNull String overrideValue)

Public methods

forceValue

@NonNull
public final void forceValue()

resetIfOverridden

@NonNull
public final void resetIfOverridden()