Merge "Relax /data/data check in AppDataIsolationTests" am: f66877199d am: da75bba326

Original change: https://android-review.googlesource.com/c/platform/cts/+/1532498

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41f9c78d3a755456c59bb9f2b8218dd994479822
diff --git a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppB/src/com/android/cts/appdataisolation/appb/AppBTests.java b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppB/src/com/android/cts/appdataisolation/appb/AppBTests.java
index 9229fa6..41ca80d 100644
--- a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppB/src/com/android/cts/appdataisolation/appb/AppBTests.java
+++ b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppB/src/com/android/cts/appdataisolation/appb/AppBTests.java
@@ -24,6 +24,7 @@
 
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
+import android.os.UserHandle;
 
 import androidx.test.filters.SmallTest;
 import androidx.test.platform.app.InstrumentationRegistry;
@@ -59,7 +60,9 @@
         ApplicationInfo applicationInfo = mContext.getApplicationInfo();
         assertDirIsAccessible(replacePackageBWithPackageA(applicationInfo.dataDir));
         assertDirIsAccessible(replacePackageBWithPackageA(applicationInfo.deviceProtectedDataDir));
-        assertDirIsAccessible("/data/data/" + APPA_PKG);
+        if (getCurrentUserId() == UserHandle.USER_SYSTEM) {
+            assertDirIsAccessible("/data/data/" + APPA_PKG);
+        }
         assertFileIsAccessible("/data/misc/profiles/cur/" + getCurrentUserId() + "/"
                 + APPA_PKG + "/primary.prof");
         assertDirIsNotAccessible("/data/misc/profiles/ref");