1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.server.uwb;
18 
19 import android.content.Context;
20 import android.os.Handler;
21 import android.provider.DeviceConfig;
22 import android.util.Log;
23 
24 import com.android.uwb.resources.R;
25 
26 /**
27  * This class allows getting all configurable flags from DeviceConfig.
28  */
29 public class DeviceConfigFacade {
30     private static final String LOG_TAG = DeviceConfigFacade.class.getSimpleName();
31 
32     /**
33      */
34     private static final int MAX_FOV = 180;
35 
36     public static final int DEFAULT_RANGING_RESULT_LOG_INTERVAL_MS = 5_000;
37     private static final int MS_IN_HOUR = 60 * 60 * 1000;
38     public static final int DEFAULT_BUG_REPORT_MIN_INTERVAL_MS = 24 * MS_IN_HOUR;
39     private static final String TAG = "DeviceConfigFacadeUwb";
40 
41     public enum PoseSourceType {
42         NONE,
43         ROTATION_VECTOR,
44         GYRO,
45         SIXDOF,
46         DOUBLE_INTEGRATE,
47     }
48 
49     private final Context mContext;
50 
51     // Cached values of fields updated via updateDeviceConfigFlags()
52     private int mRangingResultLogIntervalMs;
53     private boolean mDeviceErrorBugreportEnabled;
54     private boolean mSessionInitErrorBugreportEnabled;
55     private int mBugReportMinIntervalMs;
56     private boolean mEnableFilters;
57     private int mFilterDistanceInliersPercent;
58     private int mFilterDistanceWindow;
59     private int mFilterAngleInliersPercent;
60     private int mFilterAngleWindow;
61     private PoseSourceType mPoseSourceType;
62     private boolean mEnablePrimerEstElevation;
63     private boolean mEnablePrimerAoA;
64     private boolean mEnablePrimerFov;
65     private int mPrimerFovDegree;
66     private boolean mEnableBackAzimuth;
67     private boolean mEnableBackAzimuthMasking;
68     private int mBackAzimuthWindow;
69     private float mFrontAzimuthRadiansPerSecond;
70     private float mBackAzimuthRadiansPerSecond;
71     private float mMirrorScoreStdRadians;
72     private float mBackNoiseInfluenceCoeff;
73     private int mPredictionTimeoutSeconds;
74 
75     // Config parameters related to Advertising Profile.
76     private int mAdvertiseAoaCriteriaAngle;
77     private int mAdvertiseTimeThresholdMillis;
78     private int mAdvertiseArraySizeToCheck;
79     private int mAdvertiseArrayStartIndexToCalVariance;
80     private int mAdvertiseArrayEndIndexToCalVariance;
81     private int mAdvertiseTrustedVarianceValue;
82 
83     // Config parameters related to Rx/Tx data packets.
84     private int mRxDataMaxPacketsToStore;
85     // Flag to enable unlimited background ranging.
86     private boolean mBackgroundRangingEnabled;
87     // Flag to disable error streak timer when a session is ongoing.
88     private boolean mRangingErrorStreakTimerEnabled;
89     // Flag to enable sending ranging stopped params.
90     private boolean mCccRangingStoppedParamsSendEnabled;
91     // Flag to enable the UWB Initiation time as an absolute time, for a CCC ranging session.
92     private boolean mCccAbsoluteUwbInitiationTimeEnabled;
93     // Flag to enable usage of location APIs for country code determination
94     private boolean mLocationUseForCountryCodeEnabled;
95     // Flag to disable UWB until first toggle
96     private boolean mUwbDisabledUntilFirstToggle;
97     // Flag to interpret CCC supported sync codes value as little endian
98     private boolean mCccSupportedSyncCodesLittleEndian;
99     // Flag to control whether RANGE_DATA_NTF_CONFIG and related fields should be configured
100     // for a CCC ranging session.
101     private boolean mCccSupportedRangeDataNtfConfig;
102     private boolean mPersistentCacheUseForCountryCodeEnabled;
103     private boolean mHwIdleTurnOffEnabled;
104     private boolean mIsAntennaModeConfigSupported;
105 
DeviceConfigFacade(Handler handler, Context context)106     public DeviceConfigFacade(Handler handler, Context context) {
107         mContext = context;
108 
109         updateDeviceConfigFlags();
110         DeviceConfig.addOnPropertiesChangedListener(
111                 DeviceConfig.NAMESPACE_UWB,
112                 command -> handler.post(command),
113                 properties -> {
114                     updateDeviceConfigFlags();
115                 });
116     }
117 
updateDeviceConfigFlags()118     private void updateDeviceConfigFlags() {
119         String poseSourceName;
120         mRangingResultLogIntervalMs = DeviceConfig.getInt(DeviceConfig.NAMESPACE_UWB,
121                 "ranging_result_log_interval_ms", DEFAULT_RANGING_RESULT_LOG_INTERVAL_MS);
122         mDeviceErrorBugreportEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_UWB,
123                 "device_error_bugreport_enabled", false);
124         mSessionInitErrorBugreportEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_UWB,
125                 "session_init_error_bugreport_enabled", false);
126         mBugReportMinIntervalMs = DeviceConfig.getInt(DeviceConfig.NAMESPACE_UWB,
127                 "bug_report_min_interval_ms", DEFAULT_BUG_REPORT_MIN_INTERVAL_MS);
128 
129         // Default values come from the overlay file (config.xml).
130         mEnableFilters = DeviceConfig.getBoolean(
131                 DeviceConfig.NAMESPACE_UWB,
132                 "enable_filters",
133                 mContext.getResources().getBoolean(R.bool.enable_filters)
134         );
135         mFilterDistanceInliersPercent = DeviceConfig.getInt(
136                 DeviceConfig.NAMESPACE_UWB,
137                 "filter_distance_inliers_percent",
138                 mContext.getResources().getInteger(R.integer.filter_distance_inliers_percent)
139         );
140         mFilterDistanceWindow = DeviceConfig.getInt(
141                 DeviceConfig.NAMESPACE_UWB,
142                 "filter_distance_window",
143                 mContext.getResources().getInteger(R.integer.filter_distance_window)
144         );
145         mFilterAngleInliersPercent = DeviceConfig.getInt(
146                 DeviceConfig.NAMESPACE_UWB,
147                 "filter_angle_inliers_percent",
148                 mContext.getResources().getInteger(R.integer.filter_angle_inliers_percent)
149         );
150         mFilterAngleWindow = DeviceConfig.getInt(
151                 DeviceConfig.NAMESPACE_UWB,
152                 "filter_angle_window",
153                 mContext.getResources().getInteger(R.integer.filter_angle_window)
154         );
155         poseSourceName = DeviceConfig.getString(
156                 DeviceConfig.NAMESPACE_UWB,
157                 "pose_source_type",
158                 mContext.getResources().getString(R.string.pose_source_type)
159         );
160         mEnablePrimerEstElevation = DeviceConfig.getBoolean(
161                 DeviceConfig.NAMESPACE_UWB,
162                 "enable_primer_est_elevation",
163                 mContext.getResources().getBoolean(R.bool.enable_primer_est_elevation)
164         );
165         mEnablePrimerAoA = DeviceConfig.getBoolean(
166                 DeviceConfig.NAMESPACE_UWB,
167                 "enable_primer_aoa",
168                 mContext.getResources().getBoolean(R.bool.enable_primer_aoa)
169         );
170         mPrimerFovDegree = DeviceConfig.getInt(
171                 DeviceConfig.NAMESPACE_UWB,
172                 "primer_fov_degrees",
173                 mContext.getResources().getInteger(R.integer.primer_fov_degrees)
174         );
175         mPredictionTimeoutSeconds = DeviceConfig.getInt(
176                 DeviceConfig.NAMESPACE_UWB,
177                 "prediction_timeout_seconds",
178                 mContext.getResources().getInteger(R.integer.prediction_timeout_seconds)
179         );
180         mEnableBackAzimuth = DeviceConfig.getBoolean(
181                 DeviceConfig.NAMESPACE_UWB,
182                 "enable_azimuth_mirroring",
183                 mContext.getResources().getBoolean(R.bool.enable_azimuth_mirroring)
184         );
185         mEnableBackAzimuthMasking = DeviceConfig.getBoolean(
186                 DeviceConfig.NAMESPACE_UWB,
187                 "predict_rear_azimuths",
188                 mContext.getResources().getBoolean(R.bool.predict_rear_azimuths)
189         );
190         mBackAzimuthWindow = DeviceConfig.getInt(
191                 DeviceConfig.NAMESPACE_UWB,
192                 "mirror_detection_window",
193                 mContext.getResources().getInteger(R.integer.mirror_detection_window)
194         );
195         int frontAzimuthDegreesPerSecond = DeviceConfig.getInt(
196                 DeviceConfig.NAMESPACE_UWB,
197                 "front_mirror_dps",
198                 mContext.getResources().getInteger(R.integer.front_mirror_dps)
199         );
200         int backAzimuthDegreesPerSecond = DeviceConfig.getInt(
201                 DeviceConfig.NAMESPACE_UWB,
202                 "back_mirror_dps",
203                 mContext.getResources().getInteger(R.integer.back_mirror_dps)
204         );
205         int mirrorScoreStdDegrees = DeviceConfig.getInt(
206                 DeviceConfig.NAMESPACE_UWB,
207                 "mirror_score_std_degrees",
208                 mContext.getResources().getInteger(R.integer.mirror_score_std_degrees)
209         );
210         int backNoiseInfluencePercent = DeviceConfig.getInt(
211                 DeviceConfig.NAMESPACE_UWB,
212                 "back_noise_influence_percent",
213                 mContext.getResources().getInteger(R.integer.back_noise_influence_percent)
214         );
215 
216         // Read the Advertising profile config parameters.
217         mAdvertiseAoaCriteriaAngle = DeviceConfig.getInt(
218                 DeviceConfig.NAMESPACE_UWB,
219                 "advertise_aoa_criteria_angle",
220                 mContext.getResources().getInteger(R.integer.advertise_aoa_criteria_angle)
221         );
222         mAdvertiseTimeThresholdMillis = DeviceConfig.getInt(
223                 DeviceConfig.NAMESPACE_UWB,
224                 "advertise_time_threshold_millis",
225                 mContext.getResources().getInteger(R.integer.advertise_time_threshold_millis)
226         );
227         mAdvertiseArraySizeToCheck = DeviceConfig.getInt(
228                 DeviceConfig.NAMESPACE_UWB,
229                 "advertise_array_size_to_check",
230                 mContext.getResources().getInteger(R.integer.advertise_array_size_to_check)
231         );
232         mAdvertiseArrayStartIndexToCalVariance = DeviceConfig.getInt(
233                 DeviceConfig.NAMESPACE_UWB,
234                 "advertise_array_start_index_to_cal_variance",
235                 mContext.getResources().getInteger(
236                         R.integer.advertise_array_start_index_to_cal_variance)
237         );
238         mAdvertiseArrayEndIndexToCalVariance = DeviceConfig.getInt(
239                 DeviceConfig.NAMESPACE_UWB,
240                 "advertise_array_end_index_to_cal_variance",
241                 mContext.getResources().getInteger(
242                         R.integer.advertise_array_end_index_to_cal_variance)
243         );
244         mAdvertiseTrustedVarianceValue = DeviceConfig.getInt(
245                 DeviceConfig.NAMESPACE_UWB,
246                 "advertise_trusted_variance_value",
247                 mContext.getResources().getInteger(R.integer.advertise_trusted_variance_value)
248         );
249 
250         // Rx data packets.
251         mRxDataMaxPacketsToStore = DeviceConfig.getInt(
252                 DeviceConfig.NAMESPACE_UWB,
253                 "rx_data_max_packets_to_store",
254                 mContext.getResources().getInteger(R.integer.rx_data_max_packets_to_store)
255         );
256 
257         mBackgroundRangingEnabled = DeviceConfig.getBoolean(
258                 DeviceConfig.NAMESPACE_UWB,
259                 "background_ranging_enabled",
260                 mContext.getResources().getBoolean(R.bool.background_ranging_enabled)
261         );
262 
263         mRangingErrorStreakTimerEnabled = DeviceConfig.getBoolean(
264                 DeviceConfig.NAMESPACE_UWB,
265                 "ranging_error_streak_timer_enabled",
266                 mContext.getResources().getBoolean(R.bool.ranging_error_streak_timer_enabled)
267         );
268 
269         mCccRangingStoppedParamsSendEnabled = DeviceConfig.getBoolean(
270                 DeviceConfig.NAMESPACE_UWB,
271                 "ccc_ranging_stopped_params_send_enabled",
272                 mContext.getResources().getBoolean(R.bool.ccc_ranging_stopped_params_send_enabled)
273         );
274 
275         mCccAbsoluteUwbInitiationTimeEnabled = DeviceConfig.getBoolean(
276                 DeviceConfig.NAMESPACE_UWB,
277                 "ccc_absolute_uwb_initiation_time_enabled",
278                 mContext.getResources().getBoolean(R.bool.ccc_absolute_uwb_initiation_time_enabled)
279         );
280 
281         mLocationUseForCountryCodeEnabled = DeviceConfig.getBoolean(
282                 DeviceConfig.NAMESPACE_UWB,
283                 "location_use_for_country_code_enabled",
284                 mContext.getResources().getBoolean(R.bool.location_use_for_country_code_enabled)
285         );
286 
287         mUwbDisabledUntilFirstToggle = DeviceConfig.getBoolean(
288                 DeviceConfig.NAMESPACE_UWB,
289                 "uwb_disabled_until_first_toggle",
290                 mContext.getResources().getBoolean(R.bool.uwb_disabled_until_first_toggle)
291         );
292 
293         mCccSupportedSyncCodesLittleEndian = DeviceConfig.getBoolean(
294                 DeviceConfig.NAMESPACE_UWB,
295                 "ccc_supported_sync_codes_little_endian",
296                 mContext.getResources().getBoolean(R.bool.ccc_supported_sync_codes_little_endian)
297         );
298 
299         mCccSupportedRangeDataNtfConfig = DeviceConfig.getBoolean(
300                 DeviceConfig.NAMESPACE_UWB,
301                 "ccc_supported_range_data_ntf_config",
302                 mContext.getResources().getBoolean(R.bool.ccc_supported_range_data_ntf_config)
303         );
304 
305         mPersistentCacheUseForCountryCodeEnabled = DeviceConfig.getBoolean(
306                 DeviceConfig.NAMESPACE_UWB,
307                 "persistent_cache_use_for_country_code_enabled",
308                 mContext.getResources().getBoolean(
309                         R.bool.persistent_cache_use_for_country_code_enabled)
310         );
311 
312         mHwIdleTurnOffEnabled = DeviceConfig.getBoolean(
313                 DeviceConfig.NAMESPACE_UWB,
314                 "hw_idle_turn_off_enabled",
315                 mContext.getResources().getBoolean(R.bool.hw_idle_turn_off_enabled)
316         );
317 
318         mIsAntennaModeConfigSupported = DeviceConfig.getBoolean(
319                 DeviceConfig.NAMESPACE_UWB,
320                 "is_antenna_mode_config_supported",
321                 mContext.getResources().getBoolean(R.bool.is_antenna_mode_config_supported)
322         );
323 
324         // A little parsing and cleanup:
325         mFrontAzimuthRadiansPerSecond = (float) Math.toRadians(frontAzimuthDegreesPerSecond);
326         mBackAzimuthRadiansPerSecond = (float) Math.toRadians(backAzimuthDegreesPerSecond);
327         mMirrorScoreStdRadians = (float) Math.toRadians(mirrorScoreStdDegrees);
328         mBackNoiseInfluenceCoeff = backNoiseInfluencePercent / 100F;
329         try {
330             mPoseSourceType = PoseSourceType.valueOf(poseSourceName);
331         } catch (IllegalArgumentException e) {
332             mPoseSourceType = PoseSourceType.ROTATION_VECTOR;
333             Log.e(LOG_TAG, "UWB pose source '" + poseSourceName + "' defined in flags or"
334                     + "overlay file is invalid. Defaulting to " + mPoseSourceType.name());
335         }
336         mEnablePrimerFov = mPrimerFovDegree > 0 && mPrimerFovDegree < MAX_FOV;
337     }
338 
339     /**
340      * Gets ranging result logging interval in ms
341      */
342     public int getRangingResultLogIntervalMs() {
343         return mRangingResultLogIntervalMs;
344     }
345 
346     /**
347      * Gets the feature flag for reporting device error
348      */
349     public boolean isDeviceErrorBugreportEnabled() {
350         return mDeviceErrorBugreportEnabled;
351     }
352 
353     /**
354      * Gets the feature flag for reporting session init error
355      */
356     public boolean isSessionInitErrorBugreportEnabled() {
357         return mSessionInitErrorBugreportEnabled;
358     }
359 
360     /**
361      * Gets minimum wait time between two bug report captures
362      */
363     public int getBugReportMinIntervalMs() {
364         return mBugReportMinIntervalMs;
365     }
366 
367     /**
368      * Gets the flag for enabling UWB filtering.
369      */
370     public boolean isEnableFilters() {
371         return mEnableFilters;
372     }
373 
374     /**
375      * Gets the percentage (0-100) of inliers to be used in the distance filter cut.
376      */
377     public int getFilterDistanceInliersPercent() {
378         return mFilterDistanceInliersPercent;
379     }
380 
381     /**
382      * Gets the size of the distance filter moving window.
383      */
384     public int getFilterDistanceWindow() {
385         return mFilterDistanceWindow;
386     }
387 
388     /**
389      * Gets the percentage (0-100) of inliers to be used inthe angle filter cut.
390      */
391     public int getFilterAngleInliersPercent() {
392         return mFilterAngleInliersPercent;
393     }
394 
395     /**
396      * Gets the size of the angle filter moving window.
397      */
398     public int getFilterAngleWindow() {
399         return mFilterAngleWindow;
400     }
401 
402     /**
403      * Gets the type of pose source that should be used by default.
404      */
405     public PoseSourceType getPoseSourceType() {
406         return mPoseSourceType;
407     }
408 
409     /**
410      * Gets the flag that enables the elevation estimation primer.
411      */
412     public boolean isEnablePrimerEstElevation() {
413         return mEnablePrimerEstElevation;
414     }
415 
416     /**
417      * Gets the flag that enables the primer that converts AoA to spherical coordinates.
418      */
419     public boolean isEnablePrimerAoA() {
420         return mEnablePrimerAoA;
421     }
422 
423     /**
424      * Gets a value indicating if the FOV primer should be enabled.
425      */
426     public boolean isEnablePrimerFov() {
427         return mEnablePrimerFov;
428     }
429 
430     /**
431      * Gets the configured field of view.
432      */
433     public int getPrimerFovDegree() {
434         return mPrimerFovDegree;
435     }
436 
437     /**
438      * Gets how long to replace reports with an error status with predicted reports in seconds.
439      */
440     public int getPredictionTimeoutSeconds() {
441         return mPredictionTimeoutSeconds;
442     }
443 
444     /**
445      * Gets the flag that enables back-azimuth detection.
446      */
447     public boolean isEnableBackAzimuth() {
448         return mEnableBackAzimuth;
449     }
450 
451     /**
452      * Gets the flag that causes rear azimuth values to be replaced with predictions.
453      */
454     public boolean isEnableBackAzimuthMasking() {
455         return mEnableBackAzimuthMasking;
456     }
457 
458     /**
459      * Gets the size of the back-azimuth detection window.
460      */
461     public int getBackAzimuthWindow() {
462         return mBackAzimuthWindow;
463     }
464 
465     /**
466      * Gets minimum correlation rate required to assume azimuth readings are coming from the front.
467      */
468     public float getFrontAzimuthRadiansPerSecond() {
469         return mFrontAzimuthRadiansPerSecond;
470     }
471 
472     /**
473      * Gets minimum correlation rate required to assume azimuth readings are coming from the back.
474      */
475     public float getBackAzimuthRadiansPerSecond() {
476         return mBackAzimuthRadiansPerSecond;
477     }
478 
479     /**
480      * Gets the standard deviation of the mirror detection bell curve.
481      */
482     public float getMirrorScoreStdRadians() {
483         return mMirrorScoreStdRadians;
484     }
485 
486     /**
487      * Gets a coefficient of how much noise adds to the back-facing mirroring score.
488      */
489     public float getBackNoiseInfluenceCoeff() {
490         return mBackNoiseInfluenceCoeff;
491     }
492 
493     /**
494      * Gets the Advertising Profile AoA Criteria Angle.
495      */
496     public int getAdvertiseAoaCriteriaAngle() {
497         return mAdvertiseAoaCriteriaAngle;
498     }
499 
500     /**
501      * Gets the Advertising profile time threshold (for the received Owr Aoa Measurements).
502      */
503     public int getAdvertiseTimeThresholdMillis() {
504         return mAdvertiseTimeThresholdMillis;
505     }
506 
507     /**
508      * Gets the Advertising profile Array Size (of the stored values from Owr Aoa Measurements).
509      */
510     public int getAdvertiseArraySizeToCheck() {
511         return mAdvertiseArraySizeToCheck;
512     }
513 
514     /**
515      * Gets the Advertising profile Array Start Index (of the stored values from Owr Aoa
516      * Measurements), which we will use to calculate Variance.
517      */
518     public int getAdvertiseArrayStartIndexToCalVariance() {
519         return mAdvertiseArrayStartIndexToCalVariance;
520     }
521 
522     /**
523      * Gets the Advertising profile Array End Index (of the stored values from Owr Aoa
524      * Measurements), which we will use to calculate Variance.
525      */
526     public int getAdvertiseArrayEndIndexToCalVariance() {
527         return mAdvertiseArrayEndIndexToCalVariance;
528     }
529 
530     /**
531      * Gets the Advertising profile Trusted Variance Value (the threshold within which computed
532      * variance from the Owr Aoa Measurements is acceptable).
533      */
534     public int getAdvertiseTrustedVarianceValue() {
535         return mAdvertiseTrustedVarianceValue;
536     }
537 
538     /**
539      * Gets the max number of Rx data packets (received on a UWB session from the remote device),
540      * to be stored in the UWB framework.
541      */
542     public int getRxDataMaxPacketsToStore() {
543         return mRxDataMaxPacketsToStore;
544     }
545 
546     /**
547      * Returns whether background ranging is enabled or not.
548      * If enabled:
549      *  * Background 3p apps are allowed to open new ranging sessions
550      *  * When previously foreground 3p apps moves to background, sessions are not terminated
551      */
552     public boolean isBackgroundRangingEnabled() {
553         return mBackgroundRangingEnabled;
554     }
555 
556     /**
557      * Returns whether ranging error streak timer is enabled or not.
558      * If disabled, session would not be automatically stopped if there is no peer available.
559      */
560     public boolean isRangingErrorStreakTimerEnabled() {
561         return mRangingErrorStreakTimerEnabled;
562     }
563 
564     /**
565      * Returns whether to send ranging stopped params for CCC session stop or not.
566      * If enabled, newly added `CccRangingStoppedParams` are sent in `onStopped()` callback.
567      */
568     public boolean isCccRangingStoppedParamsSendEnabled() {
569         return mCccRangingStoppedParamsSendEnabled;
570     }
571 
572     /**
573      * Returns whether an absolute UWB initiation time should be computed and configured for
574      * CCC ranging session(s).
575      * If disabled, a relative UWB initiation time (the value in CCCStartRangingParams), is
576      * configured for the CCC ranging session.
577      */
578     public boolean isCccAbsoluteUwbInitiationTimeEnabled() {
579         return mCccAbsoluteUwbInitiationTimeEnabled;
580     }
581 
582     /**
583      * Returns whether to use location APIs in the algorithm to determine country code or not.
584      * If disabled, will use other sources (telephony, wifi, etc) to determine device location for
585      * UWB regulatory purposes.
586      */
587     public boolean isLocationUseForCountryCodeEnabled() {
588         return mLocationUseForCountryCodeEnabled;
589     }
590 
591     /**
592      * Returns whether to disable uwb until first toggle or not.
593      * If enabled, UWB will remain disabled on boot until the user toggles UWB on for the
594      * first time.
595      */
596     public boolean isUwbDisabledUntilFirstToggle() {
597         return mUwbDisabledUntilFirstToggle;
598     }
599 
600     /**
601      * Returns whether CCC supported sync codes value is interpreted as little endian.
602      */
603     public boolean isCccSupportedSyncCodesLittleEndian() {
604         return mCccSupportedSyncCodesLittleEndian;
605     }
606 
607     /**
608      * Returns whether the RANGE_DATA_NTF_CONFIG and related fields are supported (ie, should be
609      * configured), for a CCC ranging session.
610      */
611     public boolean isCccSupportedRangeDataNtfConfig() {
612         return mCccSupportedRangeDataNtfConfig;
613     }
614 
615     /**
616      * Returns whether to use persistent cache in the algorithm to determine country code or not.
617      */
618     public boolean isPersistentCacheUseForCountryCodeEnabled() {
619         return mPersistentCacheUseForCountryCodeEnabled;
620     }
621 
622     /**
623      * Returns whether hardware idle turn off is enabled or not.
624      */
625     public boolean isHwIdleTurnOffEnabled() {
626         return mHwIdleTurnOffEnabled;
627     }
628 
629     /**
630      * Returns whether antenna mode configuration is supported or not.
631      */
632     public boolean isAntennaModeConfigSupported() { return mIsAntennaModeConfigSupported; }
633 }
634