Merge "Fix(?) for some disabled ChooserActivityTest cases" into tm-dev am: b2af04737d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17913996

Change-Id: I957f1ff94831b5a22e57b72adda92073ab7b49ea
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
James O'Leary
2022-04-22 20:44:08 +00:00
committed by Automerger Merge Worker

View File

@@ -3073,8 +3073,15 @@ public class ChooserActivityTest {
// framework code on the device is up-to-date. // framework code on the device is up-to-date.
// TODO: is there a better way to do this? (Other than abandoning inheritance-based DI wrapper?) // TODO: is there a better way to do this? (Other than abandoning inheritance-based DI wrapper?)
private int getRuntimeResourceId(String name, String defType) { private int getRuntimeResourceId(String name, String defType) {
int id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android"); int id = -1;
if (ChooserActivityOverrideData.getInstance().resources != null) {
id = ChooserActivityOverrideData.getInstance().resources.getIdentifier(
name, defType, "android");
} else {
id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android");
}
assertThat(id, greaterThan(0)); assertThat(id, greaterThan(0));
return id; return id;
} }
} }