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
This commit is contained in:
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user