From 96ba588a82bc7af28093ee7d6be33ca731bcc773 Mon Sep 17 00:00:00 2001 From: Hakan Seyalioglu Date: Wed, 25 Jan 2017 10:48:44 -0800 Subject: [PATCH] Mark two test methods public so they can be mocked Without this, the mocked version looks like it's calling the default implementation (which immediately fails due to a bunch of null fields) - with this it just returns null. I would ultimately like to stop mocking out the controller and instead use a mocked package manager (which there is already some set up to do). But in the meanwhile, this at least gets the test passing. Test: Checked the test passes. Change-Id: I92d1f2796cfce21bf55e927bd56690c582f41e91 --- .../java/com/android/internal/app/ResolverListController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/app/ResolverListController.java b/core/java/com/android/internal/app/ResolverListController.java index 00faf65d004c9..4071ff4ebd5a8 100644 --- a/core/java/com/android/internal/app/ResolverListController.java +++ b/core/java/com/android/internal/app/ResolverListController.java @@ -69,14 +69,14 @@ public class ResolverListController { } @VisibleForTesting - ResolveInfo getLastChosen() throws RemoteException { + public ResolveInfo getLastChosen() throws RemoteException { return AppGlobals.getPackageManager().getLastChosenActivity( mTargetIntent, mTargetIntent.resolveTypeIfNeeded(mContext.getContentResolver()), PackageManager.MATCH_DEFAULT_ONLY); } @VisibleForTesting - void setLastChosen(Intent intent, IntentFilter filter, int match) + public void setLastChosen(Intent intent, IntentFilter filter, int match) throws RemoteException { AppGlobals.getPackageManager().setLastChosenActivity(intent, intent.resolveType(mContext.getContentResolver()),