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

Commit 2ee8e774 authored by Eric Biggers's avatar Eric Biggers
Browse files

Revert "Use RoSystemFeatures API where appropriate"

This reverts commit 6295552d because it
is not compatible with the mocking done by WeakEscrowTokenTests, causing
these tests to fail on Cuttlefish phone.  (The failure started not at
that commit, but rather when ag/33559128 turned the RoSystemFeatures
check into a build-time check.)

Test: atest FrameworksServicesTests:WeakEscrowTokenTests
Test: atest FrameworksServicesTests:com.android.server.locksettings
Bug: 418862901
Flag: TEST_ONLY
Change-Id: I149ea5d2bed958b66631e226ca9695fd8a51b065
parent 2250eae1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.pm.RoSystemFeatures;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.IndentingPrintWriter;
@@ -1297,7 +1296,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        mContext.enforceCallingOrSelfPermission(
                Manifest.permission.MANAGE_WEAK_ESCROW_TOKEN,
                "Requires MANAGE_WEAK_ESCROW_TOKEN permission.");
        if (!RoSystemFeatures.hasFeatureAutomotive(mContext)) {
        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
            throw new IllegalArgumentException(
                    "Weak escrow token are only for automotive devices.");
        }
@@ -3559,7 +3558,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }

        // Escrow tokens are enabled on automotive builds.
        if (RoSystemFeatures.hasFeatureAutomotive(mContext)) {
        if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
            return;
        }