Index: build/android/pylib/instrumentation/instrumentation_test_instance.py |
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
index cd8617cfc15f7bb84fa79a60caa1a71261dd2de9..e9c33f1c544c7fc9fbac1fc0092b8d9cea6f69a8 100644 |
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py |
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
@@ -276,9 +276,11 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
self._test_runner = self._test_apk.GetInstrumentationName() |
self._package_info = None |
- for package_info in constants.PACKAGE_INFO.itervalues(): |
- if self._test_package == package_info.test_package: |
- self._package_info = package_info |
+ if self._apk_under_test: |
+ package_under_test = self._apk_under_test.GetPackageName() |
+ for package_info in constants.PACKAGE_INFO.itervalues(): |
+ if package_under_test == package_info.package: |
+ self._package_info = package_info |
if not self._package_info: |
logging.warning('Unable to find package info for %s', self._test_package) |