[Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework part. This is a back port from aosp/1639943, aosp/1645152 and aosp/1648047 Bug: 179640862 Test: local Change-Id: I035db55a71f94000ca35f8d71f03c19208423c73
This commit is contained in:
@@ -77,7 +77,7 @@ public class DisclaimerItemListAdapterTest {
|
||||
|
||||
when(mLayoutInflater.inflate(anyInt(), anyObject(), anyBoolean())).thenReturn(mView);
|
||||
when(mViewGroup.getContext()).thenReturn(mContext);
|
||||
when(mViewGroup.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).thenReturn(
|
||||
when(mViewGroup.getContext().getSystemService(LayoutInflater.class)).thenReturn(
|
||||
mLayoutInflater);
|
||||
when(mView.findViewById(ID_DISCLAIMER_ITEM_TITLE)).thenReturn(mTestView);
|
||||
when(mView.findViewById(ID_DISCLAIMER_ITEM_DESCRIPTION)).thenReturn(mDescView);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class EmergencyCallLimitationDisclaimerTest {
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
|
||||
doReturn(mCarrierConfigManager).when(mContext).getSystemService(
|
||||
Context.CARRIER_CONFIG_SERVICE);
|
||||
CarrierConfigManager.class);
|
||||
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);
|
||||
|
||||
doReturn(getSharedPreferences()).when(mContext).getSharedPreferences(anyString(), anyInt());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class LocationPolicyDisclaimerTest {
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
|
||||
doReturn(mCarrierConfigManager).when(mContext).getSystemService(
|
||||
Context.CARRIER_CONFIG_SERVICE);
|
||||
CarrierConfigManager.class);
|
||||
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);
|
||||
doReturn(getSharedPreferences()).when(mContext).getSharedPreferences(anyString(), anyInt());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user