Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3996432d authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixes ManagedUserContentResolverTest for automotive.

It should check if the device supports the managed_users feature.

Test: atest ManagedUserContentResolverTest
Fixes: 215200534
Change-Id: I23f62b4a55a42458cfd59b611ffa80f2d4eee75a
parent 489cec02
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.content;

import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;

import android.app.ActivityManager;
import android.app.activity.LocalProvider;
@@ -58,10 +59,12 @@ abstract class AbstractCrossUserContentResolverTest {
    @Before
    public void setUp() throws Exception {
        mContext = InstrumentationRegistry.getContext();
        final PackageManager pm = mContext.getPackageManager();
        assumeTrue("device doesn't have the " + PackageManager.FEATURE_MANAGED_USERS + " feature",
                pm.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS));
        mUm = UserManager.get(mContext);
        final UserInfo userInfo = createUser();
        mCrossUserId = userInfo.id;
        final PackageManager pm = mContext.getPackageManager();
        pm.installExistingPackageAsUser(mContext.getPackageName(), mCrossUserId);
        unlockUser();