aboutsummaryrefslogtreecommitdiff
path: root/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java')
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java b/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
index ea19b62625..da3920e872 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java
@@ -108,7 +108,7 @@ import java.util.Set;
* Controls a test {@link Context} as would be provided by the Android framework to an
* {@code Activity}, {@code Service} or other system-instantiated component.
*
- * Contains Fake<Component> classes like FakeContext for components that require complex and
+ * Contains {@code Fake<Component>} classes like FakeContext for components that require complex and
* reusable stubbing. Others can be mocked using Mockito functions in tests or constructor/public
* methods of this class.
*/
@@ -117,7 +117,6 @@ public class ContextFixture implements TestFixture<Context> {
public static final String PERMISSION_ENABLE_ALL = "android.permission.STUB_PERMISSION";
public static class FakeContentProvider extends MockContentProvider {
- private String[] mColumns = {"name", "value"};
private HashMap<String, String> mKeyValuePairs = new HashMap<String, String>();
private int mNumKeyValuePairs = 0;
private HashMap<String, String> mFlags = new HashMap<>();
@@ -747,18 +746,14 @@ public class ContextFixture implements TestFixture<Context> {
doAnswer(new Answer<List<ResolveInfo>>() {
@Override
public List<ResolveInfo> answer(InvocationOnMock invocation) throws Throwable {
- return doQueryIntentServices(
- (Intent) invocation.getArguments()[0],
- (Integer) invocation.getArguments()[1]);
+ return doQueryIntentServices((Intent) invocation.getArguments()[0]);
}
}).when(mPackageManager).queryIntentServices((Intent) any(), anyInt());
doAnswer(new Answer<List<ResolveInfo>>() {
@Override
public List<ResolveInfo> answer(InvocationOnMock invocation) throws Throwable {
- return doQueryIntentServices(
- (Intent) invocation.getArguments()[0],
- (Integer) invocation.getArguments()[1]);
+ return doQueryIntentServices((Intent) invocation.getArguments()[0]);
}
}).when(mPackageManager).queryIntentServicesAsUser((Intent) any(), anyInt(), any());
@@ -766,6 +761,7 @@ public class ContextFixture implements TestFixture<Context> {
doReturn(mPackageInfo).when(mPackageManager).getPackageInfo(nullable(String.class),
anyInt());
} catch (NameNotFoundException e) {
+ Log.d(TAG, "NameNotFoundException: e=" + e);
}
doAnswer((Answer<Boolean>)
@@ -775,7 +771,7 @@ public class ContextFixture implements TestFixture<Context> {
try {
doReturn(mResources).when(mPackageManager).getResourcesForApplication(anyString());
} catch (NameNotFoundException ex) {
- Log.d(TAG, "NameNotFoundException: " + ex);
+ Log.d(TAG, "NameNotFoundException: ex=" + ex);
}
doReturn(mBundle).when(mCarrierConfigManager).getConfigForSubId(anyInt());
@@ -851,7 +847,7 @@ public class ContextFixture implements TestFixture<Context> {
mMockBindingFailureForPackage.add(packageName);
}
- private List<ResolveInfo> doQueryIntentServices(Intent intent, int flags) {
+ private List<ResolveInfo> doQueryIntentServices(Intent intent) {
List<ResolveInfo> result = new ArrayList<ResolveInfo>();
for (ComponentName componentName : mComponentNamesByAction.get(intent.getAction())) {
ResolveInfo resolveInfo = new ResolveInfo();