
org.robolectric.shadows.ShadowPolicyManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
package org.robolectric.shadows;
import static android.os.Build.VERSION_CODES.LOLLIPOP_MR1;
import android.content.Context;
import android.view.LayoutInflater;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.util.ReflectionHelpers;
import org.robolectric.util.ReflectionHelpers.ClassParameter;
@Implements(
className = "com.android.internal.policy.PolicyManager",
isInAndroidSdk = false,
maxSdk = LOLLIPOP_MR1
)
public class ShadowPolicyManager {
@Implementation
protected static LayoutInflater makeNewLayoutInflater(Context context) {
Class phoneLayoutInflaterClass =
(Class)
ReflectionHelpers.loadClass(
ShadowPolicyManager.class.getClassLoader(),
"com.android.internal.policy.impl.PhoneLayoutInflater");
return ReflectionHelpers.callConstructor(
phoneLayoutInflaterClass, ClassParameter.from(Context.class, context));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy