1package org.robolectric.shadows; 2 3import static android.os.Build.VERSION_CODES.LOLLIPOP_MR1; 4import static org.robolectric.shadow.api.Shadow.directlyOn; 5 6import android.graphics.drawable.Drawable; 7import org.robolectric.annotation.Implementation; 8import org.robolectric.annotation.Implements; 9import org.robolectric.util.ReflectionHelpers; 10 11@Implements(className = "com.android.internal.policy.impl.PhoneWindow", maxSdk = LOLLIPOP_MR1) 12public class ShadowPhoneWindowFor22 extends ShadowPhoneWindow { 13 14 @Override @Implementation(maxSdk = LOLLIPOP_MR1) 15 public void setTitle(CharSequence title) { 16 this.title = title; 17 directlyOn(realWindow, realWindow.getClass().getName(), "setTitle", ReflectionHelpers.ClassParameter.from(CharSequence.class, title)); 18 } 19 20 @Override @Implementation(maxSdk = LOLLIPOP_MR1) 21 public void setBackgroundDrawable(Drawable drawable) { 22 this.backgroundDrawable = drawable; 23 directlyOn(realWindow, realWindow.getClass().getName(), "setBackgroundDrawable", ReflectionHelpers.ClassParameter.from(Drawable.class, drawable)); 24 } 25} 26