Configuration is pure Java so there is no need for a
shadow to exist. The methods have been preserved but marked deprecated to prevent build breakages but in this
version implementation has been modified to simply call through to the Framework code which may in some cases cause
test failures due to the way the shadow diverged in behaviour from the Framework code. Some notes have been added
to help you migrate in these cases.
Some notes to help you migrate:-
setLocale(java.util.Locale) only exists in API 17+ so calling this on earlier APIs will fail with NoSuchMethodException
setToDefaults() overrides the frameworks natural defaults to set the flags for
Configuration.screenLayout to include Configuration.SCREENLAYOUT_LONG_NO and
Configuration.SCREENLAYOUT_SIZE_NORMAL
overrideQualifiers(java.lang.String) and getQualifiers() have no effect and can be removed.
@Deprecated
@Implements(value=android.content.res.Configuration.class)
public class ShadowConfiguration
extends java.lang.Object
Configuration.| Constructor and Description |
|---|
ShadowConfiguration()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getQualifiers()
Deprecated.
Use
RuntimeEnvironment.getQualifiers() although there should be no reason to obtain this
since it is typically set in tests through Config.qualifiers() so you should use a constant in these cases. |
void |
overrideQualifiers(java.lang.String qualifiers)
Deprecated.
|
void |
setLocale(java.util.Locale l)
Deprecated.
|
void |
setTo(android.content.res.Configuration o)
Deprecated.
|
void |
setToDefaults()
Deprecated.
|
@Deprecated @Implementation public void setTo(android.content.res.Configuration o)
@Deprecated @Implementation public void setToDefaults()
@Deprecated @Implementation public void setLocale(java.util.Locale l)
@Deprecated public void overrideQualifiers(java.lang.String qualifiers)
@Deprecated public java.lang.String getQualifiers()
RuntimeEnvironment.getQualifiers() although there should be no reason to obtain this
since it is typically set in tests through Config.qualifiers() so you should use a constant in these cases.