blob: b20b228f98149a1223b11ab8140e2d8ea9893877 [file] [log] [blame]
Jared Duke2d1a8322024-08-23 22:17:09 +00001// This file is auto-generated. DO NOT MODIFY.
2// Args: com.android.systemfeatures.RwFeatures \
3// --readonly=false \
4// --feature=WATCH:1 \
5// --feature=WIFI:0 \
Jared Duke90e43632024-09-20 17:05:02 +00006// --feature=VULKAN:UNAVAILABLE \
Jared Duke2d1a8322024-08-23 22:17:09 +00007// --feature=AUTO:
8package com.android.systemfeatures;
9
Jared Duke568adec2024-09-20 21:11:17 +000010import android.annotation.NonNull;
Jared Duke2d1a8322024-08-23 22:17:09 +000011import android.annotation.Nullable;
12import android.content.Context;
Jared Duke568adec2024-09-20 21:11:17 +000013import android.content.pm.FeatureInfo;
Jared Duke2d1a8322024-08-23 22:17:09 +000014import android.content.pm.PackageManager;
Jared Duke568adec2024-09-20 21:11:17 +000015import java.util.HashMap;
16import java.util.Map;
Jared Duke2d1a8322024-08-23 22:17:09 +000017
18/**
19 * @hide
20 */
21public final class RwFeatures {
22 /**
23 * Check for FEATURE_WATCH.
24 *
25 * @hide
26 */
27 public static boolean hasFeatureWatch(Context context) {
28 return hasFeatureFallback(context, PackageManager.FEATURE_WATCH);
29 }
30
31 /**
32 * Check for FEATURE_WIFI.
33 *
34 * @hide
35 */
36 public static boolean hasFeatureWifi(Context context) {
37 return hasFeatureFallback(context, PackageManager.FEATURE_WIFI);
38 }
39
40 /**
41 * Check for FEATURE_VULKAN.
42 *
43 * @hide
44 */
45 public static boolean hasFeatureVulkan(Context context) {
46 return hasFeatureFallback(context, PackageManager.FEATURE_VULKAN);
47 }
48
49 /**
50 * Check for FEATURE_AUTO.
51 *
52 * @hide
53 */
54 public static boolean hasFeatureAuto(Context context) {
55 return hasFeatureFallback(context, PackageManager.FEATURE_AUTO);
56 }
57
58 private static boolean hasFeatureFallback(Context context, String featureName) {
59 return context.getPackageManager().hasSystemFeature(featureName, 0);
60 }
61
62 /**
63 * @hide
64 */
65 @Nullable
66 public static Boolean maybeHasFeature(String featureName, int version) {
67 return null;
68 }
Jared Duke568adec2024-09-20 21:11:17 +000069
70 /**
71 * Gets features marked as available at compile-time, keyed by name.
72 *
73 * @hide
74 */
75 @NonNull
76 public static Map<String, FeatureInfo> getCompileTimeAvailableFeatures() {
77 Map<String, FeatureInfo> features = new HashMap<>(0);
78 return features;
79 }
Jared Duke2d1a8322024-08-23 22:17:09 +000080}