@Test public void testGetSystemService() { final MockContextThemeWrapper contextThemeWrapper = new MockContextThemeWrapper(mContext, R.style.TextAppearance); contextThemeWrapper.getTheme(); assertTrue(contextThemeWrapper.mIsOnApplyThemeResourceCalled); assertEquals(mContext.getSystemService(Context.ACTIVITY_SERVICE), contextThemeWrapper.getSystemService(Context.ACTIVITY_SERVICE)); assertNotSame(mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), contextThemeWrapper.getSystemService(Context.LAYOUT_INFLATER_SERVICE)); }
@Override public Object getSystemService(String name) { if (LAYOUT_INFLATER_SERVICE.equals(name)) { if (mInflater == null) { mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return mInflater; } return getBaseContext().getSystemService(name); }
ContextThemeWrapper extends ContextWrapper { @Override public Object getSystemService(String name) { if (LAYOUT_INFLATER_SERVICE.equals(name)) { if (mInflater == null) { mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return mInflater; } return getBaseContext().getSystemService(name); } }
ContextThemeWrapper extends ContextWrapper { @Override public Object getSystemService(String name) { if (LAYOUT_INFLATER_SERVICE.equals(name)) { if (mInflater == null) { mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return mInflater; } return getBaseContext().getSystemService(name); } ContextThemeWrapper();  ContextThemeWrapper(Context base, @StyleRes int themeResId);  ContextThemeWrapper(Context base, Resources.Theme theme); }
ContextThemeWrapper extends ContextWrapper { @Override public Object getSystemService(String name) { if (LAYOUT_INFLATER_SERVICE.equals(name)) { if (mInflater == null) { mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return mInflater; } return getBaseContext().getSystemService(name); } ContextThemeWrapper();  ContextThemeWrapper(Context base, @StyleRes int themeResId);  ContextThemeWrapper(Context base, Resources.Theme theme); void applyOverrideConfiguration(Configuration overrideConfiguration); @Override Resources getResources(); @Override void setTheme(int resid); int getThemeResId(); @Override Resources.Theme getTheme(); @Override Object getSystemService(String name); @Override AssetManager getAssets(); }
ContextThemeWrapper extends ContextWrapper { @Override public Object getSystemService(String name) { if (LAYOUT_INFLATER_SERVICE.equals(name)) { if (mInflater == null) { mInflater = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return mInflater; } return getBaseContext().getSystemService(name); } ContextThemeWrapper();  ContextThemeWrapper(Context base, @StyleRes int themeResId);  ContextThemeWrapper(Context base, Resources.Theme theme); void applyOverrideConfiguration(Configuration overrideConfiguration); @Override Resources getResources(); @Override void setTheme(int resid); int getThemeResId(); @Override Resources.Theme getTheme(); @Override Object getSystemService(String name); @Override AssetManager getAssets();  }