Merge "Snap for 5009057 from 9e36cba49e8418c6354a193b0cf97507fa5c20be to oreo-mr1-cts-release" into oreo-mr1-cts-release
diff --git a/src/com/android/tradefed/testtype/InstrumentationFileTest.java b/src/com/android/tradefed/testtype/InstrumentationFileTest.java
index 91d28c9..4f7ad14 100644
--- a/src/com/android/tradefed/testtype/InstrumentationFileTest.java
+++ b/src/com/android/tradefed/testtype/InstrumentationFileTest.java
@@ -139,6 +139,8 @@
             // push test file to the device and run
             mFilePathOnDevice = ON_DEVICE_TEST_DIR_LOCATION + testFile.getName();
             if (pushFileToTestDevice(testFile, mFilePathOnDevice)) {
+                // Unset package name if any just in case to avoid conflict with classname.
+                mInstrumentationTest.setTestPackageName(null);
                 mInstrumentationTest.setTestFilePathOnDevice(mFilePathOnDevice);
                 CLog.d("Test file %s was successfully pushed to %s on device",
                         testFile.getAbsolutePath(), mFilePathOnDevice);
diff --git a/src/com/android/tradefed/testtype/InstrumentationTest.java b/src/com/android/tradefed/testtype/InstrumentationTest.java
index 788c2e8..b83bfa8 100644
--- a/src/com/android/tradefed/testtype/InstrumentationTest.java
+++ b/src/com/android/tradefed/testtype/InstrumentationTest.java
@@ -335,14 +335,14 @@
     /**
      * Get the class name to run.
      */
-    String getClassName() {
+    protected String getClassName() {
         return mTestClassName;
     }
 
     /**
      * Get the test method to run.
      */
-    String getMethodName() {
+    protected String getMethodName() {
         return mTestMethodName;
     }
 
@@ -353,10 +353,8 @@
         return mTestFilePathOnDevice;
     }
 
-    /**
-     * Get the test java package to run.
-     */
-    String getTestPackageName() {
+    /** Get the test java package to run. */
+    protected String getTestPackageName() {
         return mTestPackageName;
     }