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

Commit 6295552d authored by Jared Duke's avatar Jared Duke
Browse files

Use RoSystemFeatures API where appropriate

Generated via the following args to platform_service_defaults errorprone
settings:
  * "-XepPatchChecks:RoSystemFeaturesChecker"
  * "-XepPatchLocation:IN_PLACE"

This is part of a series of batch updates before we enable such checks
by default.

Bug: 203143243
Test: m + presubmit
Flag: build.RELEASE_USE_SYSTEM_FEATURE_BUILD_FLAGS
Change-Id: I7e16e91fc591889fadde96aef1eeaa73efe236d7
parent 45140612
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ 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;
@@ -1330,7 +1331,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        mContext.enforceCallingOrSelfPermission(
                Manifest.permission.MANAGE_WEAK_ESCROW_TOKEN,
                "Requires MANAGE_WEAK_ESCROW_TOKEN permission.");
        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
        if (!RoSystemFeatures.hasFeatureAutomotive(mContext)) {
            throw new IllegalArgumentException(
                    "Weak escrow token are only for automotive devices.");
        }
@@ -3622,7 +3623,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }

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