1 /* 2 * Copyright (C) 2019 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.wifi; 18 19 import static com.android.server.wifi.util.InformationElementUtil.BssLoad.CHANNEL_UTILIZATION_SCALE; 20 21 import android.content.Context; 22 import android.os.Handler; 23 import android.provider.DeviceConfig; 24 import android.provider.Settings; 25 import android.util.ArraySet; 26 27 import com.android.internal.annotations.VisibleForTesting; 28 import com.android.wifi.flags.FeatureFlags; 29 30 import java.util.Collections; 31 import java.util.Optional; 32 import java.util.Set; 33 import java.util.concurrent.TimeUnit; 34 import java.util.function.Consumer; 35 36 /** 37 * This class allows getting all configurable flags from DeviceConfig. 38 */ 39 public class DeviceConfigFacade { 40 private final Context mContext; 41 private final WifiMetrics mWifiMetrics; 42 43 private static final String NAMESPACE = "wifi"; 44 private final FeatureFlags mFeatureFlags; 45 46 // Default values of fields 47 @VisibleForTesting 48 protected static final int DEFAULT_ABNORMAL_CONNECTION_DURATION_MS = 49 (int) TimeUnit.SECONDS.toMillis(30); 50 // Default duration for evaluating Wifi condition to trigger a data stall 51 // measured in milliseconds 52 public static final int DEFAULT_DATA_STALL_DURATION_MS = 1500; 53 // Default threshold of Tx throughput below which to trigger a data stall measured in Kbps 54 public static final int DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS = 2000; 55 // Default threshold of Rx throughput below which to trigger a data stall measured in Kbps 56 public static final int DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS = 2000; 57 // Default threshold of Tx packet error rate above which to trigger a data stall in percentage 58 public static final int DEFAULT_DATA_STALL_TX_PER_THR = 90; 59 // Default threshold of CCA level above which to trigger a data stall 60 public static final int DEFAULT_DATA_STALL_CCA_LEVEL_THR = CHANNEL_UTILIZATION_SCALE; 61 // Default low threshold of L2 sufficient Tx throughput in Kbps 62 public static final int DEFAULT_TX_TPUT_SUFFICIENT_THR_LOW_KBPS = 2000; 63 // Default high threshold of L2 sufficient Tx throughput in Kbps 64 public static final int DEFAULT_TX_TPUT_SUFFICIENT_THR_HIGH_KBPS = 8000; 65 // Default low threshold of L2 sufficient Rx throughput in Kbps 66 public static final int DEFAULT_RX_TPUT_SUFFICIENT_THR_LOW_KBPS = 2000; 67 // Default high threshold of L2 sufficient Rx throughput in Kbps 68 public static final int DEFAULT_RX_TPUT_SUFFICIENT_THR_HIGH_KBPS = 8000; 69 // Numerator part of default threshold of L2 throughput over L3 throughput ratio 70 public static final int DEFAULT_TPUT_SUFFICIENT_RATIO_THR_NUM = 2; 71 // Denominator part of default threshold of L2 throughput over L3 throughput ratio 72 public static final int DEFAULT_TPUT_SUFFICIENT_RATIO_THR_DEN = 1; 73 // Default threshold of Tx packet per second 74 public static final int DEFAULT_TX_PACKET_PER_SECOND_THR = 2; 75 // Default threshold of Rx packet per second 76 public static final int DEFAULT_RX_PACKET_PER_SECOND_THR = 2; 77 // Default high threshold values for various connection/disconnection cases 78 // All of them are in percent with respect to connection attempts 79 static final int DEFAULT_CONNECTION_FAILURE_HIGH_THR_PERCENT = 40; 80 static final int DEFAULT_CONNECTION_FAILURE_DISCONNECTION_HIGH_THR_PERCENT = 30; 81 static final int DEFAULT_ASSOC_REJECTION_HIGH_THR_PERCENT = 30; 82 static final int DEFAULT_ASSOC_TIMEOUT_HIGH_THR_PERCENT = 30; 83 static final int DEFAULT_AUTH_FAILURE_HIGH_THR_PERCENT = 30; 84 static final int DEFAULT_SHORT_CONNECTION_NONLOCAL_HIGH_THR_PERCENT = 20; 85 static final int DEFAULT_DISCONNECTION_NONLOCAL_HIGH_THR_PERCENT = 25; 86 // Default health monitor abnormal count minimum for various cases 87 static final int DEFAULT_CONNECTION_FAILURE_COUNT_MIN = 6; 88 static final int DEFAULT_CONNECTION_FAILURE_DISCONNECTION_COUNT_MIN = 5; 89 static final int DEFAULT_ASSOC_REJECTION_COUNT_MIN = 3; 90 static final int DEFAULT_ASSOC_TIMEOUT_COUNT_MIN = 3; 91 static final int DEFAULT_AUTH_FAILURE_COUNT_MIN = 3; 92 static final int DEFAULT_SHORT_CONNECTION_NONLOCAL_COUNT_MIN = 3; 93 static final int DEFAULT_DISCONNECTION_NONLOCAL_COUNT_MIN = 3; 94 // Numerator part of default ratio threshold values for all cases 95 static final int DEFAULT_HEALTH_MONITOR_RATIO_THR_NUMERATOR = 4; 96 // Denominator part of ratio threshold for all cases 97 static final int HEALTH_MONITOR_RATIO_THR_DENOMINATOR = 2; 98 // Minimum RSSI in dBm for connection stats collection 99 // Connection or disconnection events with RSSI below this threshold are not 100 // included in connection stats collection. 101 static final int DEFAULT_HEALTH_MONITOR_MIN_RSSI_THR_DBM = -68; 102 // Default minimum number of connection attempts to qualify daily detection 103 static final int DEFAULT_HEALTH_MONITOR_MIN_NUM_CONNECTION_ATTEMPT = 10; 104 // Default minimum wait time between two bug report captures 105 static final int DEFAULT_BUG_REPORT_MIN_WINDOW_MS = 3_600_000; 106 // Default report-high threshold to take-bug-report threshold ratio. 107 // It should be larger than 1 since the bar to take bugreport should be higher. 108 static final int DEFAULT_BUG_REPORT_THRESHOLD_EXTRA_RATIO = 2; 109 // Default overlapping connection duration threshold in ms to trigger bug report 110 static final int DEFAULT_OVERLAPPING_CONNECTION_DURATION_THRESHOLD_MS = 75_000; 111 // At low traffic, Tx link speed values below the following threshold 112 // are ignored because it could be due to low rate management frames 113 static final int DEFAULT_TX_LINK_SPEED_LOW_THRESHOLD_MBPS = 9; 114 // At low traffic, Rx link speed values below the following threshold 115 // are ignored because it could be due to low rate management frames 116 static final int DEFAULT_RX_LINK_SPEED_LOW_THRESHOLD_MBPS = 9; 117 // Default health monitor short connection duration threshold in ms 118 static final int DEFAULT_HEALTH_MONITOR_SHORT_CONNECTION_DURATION_THR_MS = 20_000; 119 120 // Default mask for abnormal disconnection reason codes. 121 // Each bit of mask corresponds to a reason code defined in 802.11 standard section 9.4.1.7 122 // For example, b0 for reason code 0, b1 for reason code 1, etc. 123 // Bits below are abnormal disconnection reasons and thus are set to 1 124 // b0: reserved (e.g., STA heartbeat failure) 125 // b2: invalid auth 126 // b4: disassociated due to inactivity 127 // b6 and b7: invalid class 2 and 3 frames 128 // b34: disassociated due to missing ACKs 129 static final long DEFAULT_ABNORMAL_DISCONNECTION_REASON_CODE_MASK = 0x4_0000_00d5L; 130 // Default maximum interval between last RSSI poll and disconnection 131 static final int DEFAULT_HEALTH_MONITOR_RSSI_POLL_VALID_TIME_MS = 2_100; 132 // Default maximum interval between scan and connection attempt in non-stationary state 133 static final int DEFAULT_NONSTATIONARY_SCAN_RSSI_VALID_TIME_MS = 5_000; 134 // Default maximum interval between scan and connection attempt in stationary state 135 static final int DEFAULT_STATIONARY_SCAN_RSSI_VALID_TIME_MS = 8_000; 136 // Default health monitor firmware alert valid time. 137 // -1 disables firmware alert time check 138 static final int DEFAULT_HEALTH_MONITOR_FW_ALERT_VALID_TIME_MS = -1; 139 // Default minimum confirmation duration for sending network score to connectivity service 140 // when score breaches low. The actual confirmation duration is longer in general and it 141 // depends on the score evaluation period normally controlled by 142 // 'com.android.wifi.resources.R' config_wifiPollRssiIntervalMilliseconds. 143 static final int DEFAULT_MIN_CONFIRMATION_DURATION_SEND_LOW_SCORE_MS = 5000; 144 // Default minimum confirmation duration for sending network score to connectivity service 145 // when score breaches high. The actual confirmation duration is longer in general and it 146 // depends on the score evaluation period normally controlled by 147 // 'com.android.wifi.resources.R' config_wifiPollRssiIntervalMilliseconds. 148 static final int DEFAULT_MIN_CONFIRMATION_DURATION_SEND_HIGH_SCORE_MS = 0; 149 // Default RSSI threshold in dBm above which low score is not sent to connectivity service 150 // when external scorer takes action. 151 static final int DEFAULT_RSSI_THRESHOLD_NOT_SEND_LOW_SCORE_TO_CS_DBM = -67; 152 // Maximum traffic stats threshold for link bandwidth estimator 153 static final int DEFAULT_TRAFFIC_STATS_THRESHOLD_MAX_KB = 8000; 154 static final int DEFAULT_BANDWIDTH_ESTIMATOR_TIME_CONSTANT_LARGE_SEC = 6; 155 static final String DEFAULT_DRY_RUN_SCORER_PKG_NAME = ""; 156 // Cached values of fields updated via updateDeviceConfigFlags() 157 private boolean mIsAbnormalConnectionBugreportEnabled; 158 private int mAbnormalConnectionDurationMs; 159 private int mDataStallDurationMs; 160 private int mDataStallTxTputThrKbps; 161 private int mDataStallRxTputThrKbps; 162 private int mDataStallTxPerThr; 163 private int mDataStallCcaLevelThr; 164 private int mTxTputSufficientLowThrKbps; 165 private int mTxTputSufficientHighThrKbps; 166 private int mRxTputSufficientLowThrKbps; 167 private int mRxTputSufficientHighThrKbps; 168 private int mTputSufficientRatioThrNum; 169 private int mTputSufficientRatioThrDen; 170 private int mTxPktPerSecondThr; 171 private int mRxPktPerSecondThr; 172 private int mConnectionFailureHighThrPercent; 173 private int mConnectionFailureCountMin; 174 private int mConnectionFailureDisconnectionHighThrPercent; 175 private int mConnectionFailureDisconnectionCountMin; 176 private int mAssocRejectionHighThrPercent; 177 private int mAssocRejectionCountMin; 178 private int mAssocTimeoutHighThrPercent; 179 private int mAssocTimeoutCountMin; 180 private int mAuthFailureHighThrPercent; 181 private int mAuthFailureCountMin; 182 private int mShortConnectionNonlocalHighThrPercent; 183 private int mShortConnectionNonlocalCountMin; 184 private int mDisconnectionNonlocalHighThrPercent; 185 private int mDisconnectionNonlocalCountMin; 186 private int mHealthMonitorRatioThrNumerator; 187 private int mHealthMonitorMinRssiThrDbm; 188 private Set<String> mRandomizationFlakySsidHotlist; 189 private Set<String> mNonPersistentMacRandomizationSsidAllowlist; 190 private Set<String> mNonPersistentMacRandomizationSsidBlocklist; 191 private boolean mIsAbnormalConnectionFailureBugreportEnabled; 192 private boolean mIsAbnormalDisconnectionBugreportEnabled; 193 private int mHealthMonitorMinNumConnectionAttempt; 194 private int mBugReportMinWindowMs; 195 private int mBugReportThresholdExtraRatio; 196 private boolean mWifiBatterySaverEnabled; 197 private boolean mIsOverlappingConnectionBugreportEnabled; 198 private int mOverlappingConnectionDurationThresholdMs; 199 private int mTxLinkSpeedLowThresholdMbps; 200 private int mRxLinkSpeedLowThresholdMbps; 201 private int mHealthMonitorShortConnectionDurationThrMs; 202 private long mAbnormalDisconnectionReasonCodeMask; 203 private int mHealthMonitorRssiPollValidTimeMs; 204 private int mNonstationaryScanRssiValidTimeMs; 205 private int mStationaryScanRssiValidTimeMs; 206 private int mHealthMonitorFwAlertValidTimeMs; 207 private int mMinConfirmationDurationSendLowScoreMs; 208 private int mMinConfirmationDurationSendHighScoreMs; 209 private int mRssiThresholdNotSendLowScoreToCsDbm; 210 private int mTrafficStatsThresholdMaxKbyte; 211 private int mBandwidthEstimatorLargeTimeConstantSec; 212 private boolean mInterfaceFailureBugreportEnabled; 213 private boolean mP2pFailureBugreportEnabled; 214 private boolean mApmEnhancementEnabled; 215 private boolean mAwareSuspensionEnabled; 216 private boolean mHighPerfLockDeprecated; 217 private Optional<Boolean> mOobPseudonymEnabled = Optional.empty(); 218 private Consumer<Boolean> mOobPseudonymFeatureFlagChangedListener = null; 219 private String mDryRunScorerPkgName; 220 private Consumer<String> mDryRunScorerPkgNameChangedListener = null; 221 private boolean mApplicationQosPolicyApiEnabled; 222 private boolean mAdjustPollRssiIntervalEnabled; 223 private boolean mSoftwarePnoEnabled; 224 private boolean mIncludePasspointSsidsInPnoScans; 225 private boolean mHandleRssiOrganicKernelFailuresEnabled; 226 private Set<String> mDisabledAutoBugreports = Collections.EMPTY_SET; 227 228 private final Handler mWifiHandler; 229 DeviceConfigFacade(Context context, Handler handler, WifiMetrics wifiMetrics)230 public DeviceConfigFacade(Context context, Handler handler, WifiMetrics wifiMetrics) { 231 mContext = context; 232 mWifiMetrics = wifiMetrics; 233 mWifiHandler = handler; 234 mFeatureFlags = new com.android.wifi.flags.FeatureFlagsImpl(); 235 updateDeviceConfigFlags(); 236 DeviceConfig.addOnPropertiesChangedListener( 237 NAMESPACE, 238 command -> handler.post(command), 239 properties -> { 240 updateDeviceConfigFlags(); 241 }); 242 } 243 updateDeviceConfigFlags()244 private void updateDeviceConfigFlags() { 245 mIsAbnormalConnectionBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 246 "abnormal_connection_bugreport_enabled", false); 247 mAbnormalConnectionDurationMs = DeviceConfig.getInt(NAMESPACE, 248 "abnormal_connection_duration_ms", 249 DEFAULT_ABNORMAL_CONNECTION_DURATION_MS); 250 251 mDataStallDurationMs = DeviceConfig.getInt(NAMESPACE, 252 "data_stall_duration_ms", DEFAULT_DATA_STALL_DURATION_MS); 253 mDataStallTxTputThrKbps = DeviceConfig.getInt(NAMESPACE, 254 "data_stall_tx_tput_thr_kbps", DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS); 255 mDataStallRxTputThrKbps = DeviceConfig.getInt(NAMESPACE, 256 "data_stall_rx_tput_thr_kbps", DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS); 257 mDataStallTxPerThr = DeviceConfig.getInt(NAMESPACE, 258 "data_stall_tx_per_thr", DEFAULT_DATA_STALL_TX_PER_THR); 259 mDataStallCcaLevelThr = DeviceConfig.getInt(NAMESPACE, 260 "data_stall_cca_level_thr", DEFAULT_DATA_STALL_CCA_LEVEL_THR); 261 mWifiMetrics.setDataStallDurationMs(mDataStallDurationMs); 262 mWifiMetrics.setDataStallTxTputThrKbps(mDataStallTxTputThrKbps); 263 mWifiMetrics.setDataStallRxTputThrKbps(mDataStallRxTputThrKbps); 264 mWifiMetrics.setDataStallTxPerThr(mDataStallTxPerThr); 265 mWifiMetrics.setDataStallCcaLevelThr(mDataStallCcaLevelThr); 266 267 mTxTputSufficientLowThrKbps = DeviceConfig.getInt(NAMESPACE, 268 "tput_sufficient_low_thr_kbps", DEFAULT_TX_TPUT_SUFFICIENT_THR_LOW_KBPS); 269 mTxTputSufficientHighThrKbps = DeviceConfig.getInt(NAMESPACE, 270 "tput_sufficient_high_thr_kbps", DEFAULT_TX_TPUT_SUFFICIENT_THR_HIGH_KBPS); 271 mRxTputSufficientLowThrKbps = DeviceConfig.getInt(NAMESPACE, 272 "rx_tput_sufficient_low_thr_kbps", DEFAULT_RX_TPUT_SUFFICIENT_THR_LOW_KBPS); 273 mRxTputSufficientHighThrKbps = DeviceConfig.getInt(NAMESPACE, 274 "rx_tput_sufficient_high_thr_kbps", DEFAULT_RX_TPUT_SUFFICIENT_THR_HIGH_KBPS); 275 mTputSufficientRatioThrNum = DeviceConfig.getInt(NAMESPACE, 276 "tput_sufficient_ratio_thr_num", DEFAULT_TPUT_SUFFICIENT_RATIO_THR_NUM); 277 mTputSufficientRatioThrDen = DeviceConfig.getInt(NAMESPACE, 278 "tput_sufficient_ratio_thr_den", DEFAULT_TPUT_SUFFICIENT_RATIO_THR_DEN); 279 mTxPktPerSecondThr = DeviceConfig.getInt(NAMESPACE, 280 "tx_pkt_per_second_thr", DEFAULT_TX_PACKET_PER_SECOND_THR); 281 mRxPktPerSecondThr = DeviceConfig.getInt(NAMESPACE, 282 "rx_pkt_per_second_thr", DEFAULT_RX_PACKET_PER_SECOND_THR); 283 284 mConnectionFailureHighThrPercent = DeviceConfig.getInt(NAMESPACE, 285 "connection_failure_high_thr_percent", 286 DEFAULT_CONNECTION_FAILURE_HIGH_THR_PERCENT); 287 mConnectionFailureCountMin = DeviceConfig.getInt(NAMESPACE, 288 "connection_failure_count_min", 289 DEFAULT_CONNECTION_FAILURE_COUNT_MIN); 290 mConnectionFailureDisconnectionHighThrPercent = DeviceConfig.getInt(NAMESPACE, 291 "connection_failure_disconnection_high_thr_percent", 292 DEFAULT_CONNECTION_FAILURE_DISCONNECTION_HIGH_THR_PERCENT); 293 mConnectionFailureDisconnectionCountMin = DeviceConfig.getInt(NAMESPACE, 294 "connection_failure_disconnection_count_min", 295 DEFAULT_CONNECTION_FAILURE_DISCONNECTION_COUNT_MIN); 296 mAssocRejectionHighThrPercent = DeviceConfig.getInt(NAMESPACE, 297 "assoc_rejection_high_thr_percent", 298 DEFAULT_ASSOC_REJECTION_HIGH_THR_PERCENT); 299 mAssocRejectionCountMin = DeviceConfig.getInt(NAMESPACE, 300 "assoc_rejection_count_min", 301 DEFAULT_ASSOC_REJECTION_COUNT_MIN); 302 mAssocTimeoutHighThrPercent = DeviceConfig.getInt(NAMESPACE, 303 "assoc_timeout_high_thr_percent", 304 DEFAULT_ASSOC_TIMEOUT_HIGH_THR_PERCENT); 305 mAssocTimeoutCountMin = DeviceConfig.getInt(NAMESPACE, 306 "assoc_timeout_count_min", 307 DEFAULT_ASSOC_TIMEOUT_COUNT_MIN); 308 mAuthFailureHighThrPercent = DeviceConfig.getInt(NAMESPACE, 309 "auth_failure_high_thr_percent", 310 DEFAULT_AUTH_FAILURE_HIGH_THR_PERCENT); 311 mAuthFailureCountMin = DeviceConfig.getInt(NAMESPACE, 312 "auth_failure_count_min", 313 DEFAULT_AUTH_FAILURE_COUNT_MIN); 314 mShortConnectionNonlocalHighThrPercent = DeviceConfig.getInt(NAMESPACE, 315 "short_connection_nonlocal_high_thr_percent", 316 DEFAULT_SHORT_CONNECTION_NONLOCAL_HIGH_THR_PERCENT); 317 mShortConnectionNonlocalCountMin = DeviceConfig.getInt(NAMESPACE, 318 "short_connection_nonlocal_count_min", 319 DEFAULT_SHORT_CONNECTION_NONLOCAL_COUNT_MIN); 320 mDisconnectionNonlocalHighThrPercent = DeviceConfig.getInt(NAMESPACE, 321 "disconnection_nonlocal_high_thr_percent", 322 DEFAULT_DISCONNECTION_NONLOCAL_HIGH_THR_PERCENT); 323 mDisconnectionNonlocalCountMin = DeviceConfig.getInt(NAMESPACE, 324 "disconnection_nonlocal_count_min", 325 DEFAULT_DISCONNECTION_NONLOCAL_COUNT_MIN); 326 mHealthMonitorRatioThrNumerator = DeviceConfig.getInt(NAMESPACE, 327 "health_monitor_ratio_thr_numerator", 328 DEFAULT_HEALTH_MONITOR_RATIO_THR_NUMERATOR); 329 mHealthMonitorMinRssiThrDbm = DeviceConfig.getInt(NAMESPACE, 330 "health_monitor_min_rssi_thr_dbm", 331 DEFAULT_HEALTH_MONITOR_MIN_RSSI_THR_DBM); 332 333 mRandomizationFlakySsidHotlist = 334 getUnmodifiableSetQuoted("randomization_flaky_ssid_hotlist"); 335 mNonPersistentMacRandomizationSsidAllowlist = 336 getUnmodifiableSetQuoted("aggressive_randomization_ssid_allowlist"); 337 mNonPersistentMacRandomizationSsidBlocklist = 338 getUnmodifiableSetQuoted("aggressive_randomization_ssid_blocklist"); 339 340 mIsAbnormalConnectionFailureBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 341 "abnormal_connection_failure_bugreport_enabled", false); 342 mIsAbnormalDisconnectionBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 343 "abnormal_disconnection_bugreport_enabled", false); 344 mHealthMonitorMinNumConnectionAttempt = DeviceConfig.getInt(NAMESPACE, 345 "health_monitor_min_num_connection_attempt", 346 DEFAULT_HEALTH_MONITOR_MIN_NUM_CONNECTION_ATTEMPT); 347 mBugReportMinWindowMs = DeviceConfig.getInt(NAMESPACE, 348 "bug_report_min_window_ms", 349 DEFAULT_BUG_REPORT_MIN_WINDOW_MS); 350 mBugReportThresholdExtraRatio = DeviceConfig.getInt(NAMESPACE, 351 "report_bug_report_threshold_extra_ratio", 352 DEFAULT_BUG_REPORT_THRESHOLD_EXTRA_RATIO); 353 mIsOverlappingConnectionBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 354 "overlapping_connection_bugreport_enabled", false); 355 mOverlappingConnectionDurationThresholdMs = DeviceConfig.getInt(NAMESPACE, 356 "overlapping_connection_duration_threshold_ms", 357 DEFAULT_OVERLAPPING_CONNECTION_DURATION_THRESHOLD_MS); 358 mTxLinkSpeedLowThresholdMbps = DeviceConfig.getInt(NAMESPACE, 359 "tx_link_speed_low_threshold_mbps", 360 DEFAULT_TX_LINK_SPEED_LOW_THRESHOLD_MBPS); 361 mRxLinkSpeedLowThresholdMbps = DeviceConfig.getInt(NAMESPACE, 362 "rx_link_speed_low_threshold_mbps", 363 DEFAULT_RX_LINK_SPEED_LOW_THRESHOLD_MBPS); 364 mWifiBatterySaverEnabled = DeviceConfig.getBoolean(NAMESPACE, "battery_saver_enabled", 365 false); 366 mHealthMonitorShortConnectionDurationThrMs = DeviceConfig.getInt(NAMESPACE, 367 "health_monitor_short_connection_duration_thr_ms", 368 DEFAULT_HEALTH_MONITOR_SHORT_CONNECTION_DURATION_THR_MS); 369 mAbnormalDisconnectionReasonCodeMask = DeviceConfig.getLong(NAMESPACE, 370 "abnormal_disconnection_reason_code_mask", 371 DEFAULT_ABNORMAL_DISCONNECTION_REASON_CODE_MASK); 372 mHealthMonitorRssiPollValidTimeMs = DeviceConfig.getInt(NAMESPACE, 373 "health_monitor_rssi_poll_valid_time_ms", 374 DEFAULT_HEALTH_MONITOR_RSSI_POLL_VALID_TIME_MS); 375 mNonstationaryScanRssiValidTimeMs = DeviceConfig.getInt(NAMESPACE, 376 "nonstationary_scan_rssi_valid_time_ms", 377 DEFAULT_NONSTATIONARY_SCAN_RSSI_VALID_TIME_MS); 378 mStationaryScanRssiValidTimeMs = DeviceConfig.getInt(NAMESPACE, 379 "stationary_scan_rssi_valid_time_ms", 380 DEFAULT_STATIONARY_SCAN_RSSI_VALID_TIME_MS); 381 mHealthMonitorFwAlertValidTimeMs = DeviceConfig.getInt(NAMESPACE, 382 "health_monitor_fw_alert_valid_time_ms", 383 DEFAULT_HEALTH_MONITOR_FW_ALERT_VALID_TIME_MS); 384 mWifiMetrics.setHealthMonitorRssiPollValidTimeMs(mHealthMonitorRssiPollValidTimeMs); 385 mMinConfirmationDurationSendLowScoreMs = DeviceConfig.getInt(NAMESPACE, 386 "min_confirmation_duration_send_low_score_ms", 387 DEFAULT_MIN_CONFIRMATION_DURATION_SEND_LOW_SCORE_MS); 388 mMinConfirmationDurationSendHighScoreMs = DeviceConfig.getInt(NAMESPACE, 389 "min_confirmation_duration_send_high_score_ms", 390 DEFAULT_MIN_CONFIRMATION_DURATION_SEND_HIGH_SCORE_MS); 391 mRssiThresholdNotSendLowScoreToCsDbm = DeviceConfig.getInt(NAMESPACE, 392 "rssi_threshold_not_send_low_score_to_cs_dbm", 393 DEFAULT_RSSI_THRESHOLD_NOT_SEND_LOW_SCORE_TO_CS_DBM); 394 mTrafficStatsThresholdMaxKbyte = DeviceConfig.getInt(NAMESPACE, 395 "traffic_stats_threshold_max_kbyte", DEFAULT_TRAFFIC_STATS_THRESHOLD_MAX_KB); 396 mBandwidthEstimatorLargeTimeConstantSec = DeviceConfig.getInt(NAMESPACE, 397 "bandwidth_estimator_time_constant_large_sec", 398 DEFAULT_BANDWIDTH_ESTIMATOR_TIME_CONSTANT_LARGE_SEC); 399 mInterfaceFailureBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 400 "interface_failure_bugreport_enabled", false); 401 mP2pFailureBugreportEnabled = DeviceConfig.getBoolean(NAMESPACE, 402 "p2p_failure_bugreport_enabled", false); 403 mApmEnhancementEnabled = DeviceConfig.getBoolean(NAMESPACE, 404 "apm_enhancement_enabled", false); 405 mAwareSuspensionEnabled = DeviceConfig.getBoolean(NAMESPACE, 406 "aware_suspension_enabled", true); 407 mHighPerfLockDeprecated = DeviceConfig.getBoolean(NAMESPACE, 408 "high_perf_lock_deprecated", true); 409 boolean oobPseudonymEnabled = DeviceConfig.getBoolean(NAMESPACE, 410 "oob_pseudonym_enabled", true); 411 if (mOobPseudonymEnabled.isPresent() 412 && mOobPseudonymEnabled.get() != oobPseudonymEnabled 413 && mOobPseudonymFeatureFlagChangedListener != null) { 414 mWifiHandler.post( 415 () -> mOobPseudonymFeatureFlagChangedListener.accept(oobPseudonymEnabled)); 416 } 417 mOobPseudonymEnabled = Optional.of(oobPseudonymEnabled); 418 419 String dryRunScorerPkgName = DeviceConfig.getString(NAMESPACE, "dry_run_scorer_pkg_name", 420 DEFAULT_DRY_RUN_SCORER_PKG_NAME); 421 if (mDryRunScorerPkgNameChangedListener != null 422 && !dryRunScorerPkgName.equalsIgnoreCase(mDryRunScorerPkgName)) { 423 mWifiHandler.post( 424 () -> mDryRunScorerPkgNameChangedListener.accept(dryRunScorerPkgName)); 425 } 426 mDryRunScorerPkgName = dryRunScorerPkgName; 427 428 mApplicationQosPolicyApiEnabled = DeviceConfig.getBoolean(NAMESPACE, 429 "application_qos_policy_api_enabled", true); 430 mAdjustPollRssiIntervalEnabled = 431 DeviceConfig.getBoolean(NAMESPACE, "adjust_poll_rssi_interval_enabled", false); 432 mSoftwarePnoEnabled = DeviceConfig.getBoolean(NAMESPACE, 433 "software_pno_enabled", false); 434 mIncludePasspointSsidsInPnoScans = DeviceConfig.getBoolean(NAMESPACE, 435 "include_passpoint_ssids_in_pno_scans", true); 436 mHandleRssiOrganicKernelFailuresEnabled = DeviceConfig.getBoolean(NAMESPACE, 437 "handle_rssi_organic_kernel_failures_enabled", true); 438 mDisabledAutoBugreports = getDisabledAutoBugreports(); 439 } 440 getDisabledAutoBugreports()441 private Set<String> getDisabledAutoBugreports() { 442 String rawList = DeviceConfig.getString(NAMESPACE, 443 "disabled_auto_bugreport_title_and_description", null); 444 if (rawList == null || rawList.isEmpty()) { 445 return Collections.EMPTY_SET; 446 } 447 Set<String> result = new ArraySet<>(); 448 String[] list = rawList.split(","); 449 for (String cur : list) { 450 if (cur.length() == 0) { 451 continue; 452 } 453 result.add(cur); 454 } 455 return Collections.unmodifiableSet(result); 456 } 457 getUnmodifiableSetQuoted(String key)458 private Set<String> getUnmodifiableSetQuoted(String key) { 459 String rawList = DeviceConfig.getString(NAMESPACE, key, ""); 460 Set<String> result = new ArraySet<>(); 461 String[] list = rawList.split(","); 462 for (String cur : list) { 463 if (cur.length() == 0) { 464 continue; 465 } 466 result.add("\"" + cur + "\""); 467 } 468 return Collections.unmodifiableSet(result); 469 } 470 471 /** 472 * Gets the feature flag for reporting abnormally long connections. 473 */ isAbnormalConnectionBugreportEnabled()474 public boolean isAbnormalConnectionBugreportEnabled() { 475 return mIsAbnormalConnectionBugreportEnabled; 476 } 477 478 /** 479 * Gets the threshold for classifying abnormally long connections. 480 */ getAbnormalConnectionDurationMs()481 public int getAbnormalConnectionDurationMs() { 482 return mAbnormalConnectionDurationMs; 483 } 484 485 /** 486 * Gets the duration of evaluating Wifi condition to trigger a data stall. 487 */ getDataStallDurationMs()488 public int getDataStallDurationMs() { 489 return mDataStallDurationMs; 490 } 491 492 /** 493 * Gets the threshold of Tx throughput below which to trigger a data stall. 494 */ getDataStallTxTputThrKbps()495 public int getDataStallTxTputThrKbps() { 496 return mDataStallTxTputThrKbps; 497 } 498 499 /** 500 * Gets the threshold of Rx throughput below which to trigger a data stall. 501 */ getDataStallRxTputThrKbps()502 public int getDataStallRxTputThrKbps() { 503 return mDataStallRxTputThrKbps; 504 } 505 506 /** 507 * Gets the threshold of Tx packet error rate above which to trigger a data stall. 508 */ getDataStallTxPerThr()509 public int getDataStallTxPerThr() { 510 return mDataStallTxPerThr; 511 } 512 513 /** 514 * Gets the threshold of CCA level above which to trigger a data stall. 515 */ getDataStallCcaLevelThr()516 public int getDataStallCcaLevelThr() { 517 return mDataStallCcaLevelThr; 518 } 519 520 /** 521 * Gets the low threshold of L2 throughput below which L2 throughput is always insufficient 522 */ getTxTputSufficientLowThrKbps()523 public int getTxTputSufficientLowThrKbps() { 524 return mTxTputSufficientLowThrKbps; 525 } 526 527 /** 528 * Gets the high threshold of L2 throughput above which L2 throughput is always sufficient 529 */ getTxTputSufficientHighThrKbps()530 public int getTxTputSufficientHighThrKbps() { 531 return mTxTputSufficientHighThrKbps; 532 } 533 534 /** 535 * Gets the low threshold of L2 throughput below which L2 Rx throughput is always insufficient 536 */ getRxTputSufficientLowThrKbps()537 public int getRxTputSufficientLowThrKbps() { 538 return mRxTputSufficientLowThrKbps; 539 } 540 541 /** 542 * Gets the high threshold of L2 throughput above which L2 Rx throughput is always sufficient 543 */ getRxTputSufficientHighThrKbps()544 public int getRxTputSufficientHighThrKbps() { 545 return mRxTputSufficientHighThrKbps; 546 } 547 548 /** 549 * Gets the numerator part of L2 throughput over L3 throughput ratio sufficiency threshold 550 * above which L2 throughput is sufficient 551 */ getTputSufficientRatioThrNum()552 public int getTputSufficientRatioThrNum() { 553 return mTputSufficientRatioThrNum; 554 } 555 556 /** 557 * Gets the denominator part of L2 throughput over L3 throughput ratio sufficiency threshold 558 * above which L2 throughput is sufficient 559 */ getTputSufficientRatioThrDen()560 public int getTputSufficientRatioThrDen() { 561 return mTputSufficientRatioThrDen; 562 } 563 564 /** 565 * Gets the threshold of Tx packet per second 566 * below which Tx throughput sufficiency check will always pass 567 */ getTxPktPerSecondThr()568 public int getTxPktPerSecondThr() { 569 return mTxPktPerSecondThr; 570 } 571 572 /** 573 * Gets the threshold of Rx packet per second 574 * below which Rx throughput sufficiency check will always pass 575 */ getRxPktPerSecondThr()576 public int getRxPktPerSecondThr() { 577 return mRxPktPerSecondThr; 578 } 579 580 /** 581 * Gets the high threshold of connection failure rate in percent 582 */ getConnectionFailureHighThrPercent()583 public int getConnectionFailureHighThrPercent() { 584 return mConnectionFailureHighThrPercent; 585 } 586 587 /** 588 * Gets connection-failure-due-to-disconnection min count 589 */ getConnectionFailureDisconnectionCountMin()590 public int getConnectionFailureDisconnectionCountMin() { 591 return mConnectionFailureDisconnectionCountMin; 592 } 593 594 /** 595 * Gets the high threshold of connection-failure-due-to-disconnection rate in percent 596 */ getConnectionFailureDisconnectionHighThrPercent()597 public int getConnectionFailureDisconnectionHighThrPercent() { 598 return mConnectionFailureDisconnectionHighThrPercent; 599 } 600 601 /** 602 * Gets connection failure min count 603 */ getConnectionFailureCountMin()604 public int getConnectionFailureCountMin() { 605 return mConnectionFailureCountMin; 606 } 607 608 /** 609 * Gets the high threshold of association rejection rate in percent 610 */ getAssocRejectionHighThrPercent()611 public int getAssocRejectionHighThrPercent() { 612 return mAssocRejectionHighThrPercent; 613 } 614 615 /** 616 * Gets association rejection min count 617 */ getAssocRejectionCountMin()618 public int getAssocRejectionCountMin() { 619 return mAssocRejectionCountMin; 620 } 621 622 /** 623 * Gets the high threshold of association timeout rate in percent 624 */ getAssocTimeoutHighThrPercent()625 public int getAssocTimeoutHighThrPercent() { 626 return mAssocTimeoutHighThrPercent; 627 } 628 629 /** 630 * Gets association timeout min count 631 */ getAssocTimeoutCountMin()632 public int getAssocTimeoutCountMin() { 633 return mAssocTimeoutCountMin; 634 } 635 636 637 /** 638 * Gets the high threshold of authentication failure rate in percent 639 */ getAuthFailureHighThrPercent()640 public int getAuthFailureHighThrPercent() { 641 return mAuthFailureHighThrPercent; 642 } 643 644 /** 645 * Gets authentication failure min count 646 */ getAuthFailureCountMin()647 public int getAuthFailureCountMin() { 648 return mAuthFailureCountMin; 649 } 650 651 /** 652 * Gets the high threshold of nonlocal short connection rate in percent 653 */ getShortConnectionNonlocalHighThrPercent()654 public int getShortConnectionNonlocalHighThrPercent() { 655 return mShortConnectionNonlocalHighThrPercent; 656 } 657 658 /** 659 * Gets nonlocal short connection min count 660 */ getShortConnectionNonlocalCountMin()661 public int getShortConnectionNonlocalCountMin() { 662 return mShortConnectionNonlocalCountMin; 663 } 664 665 /** 666 * Gets the high threshold of nonlocal disconnection rate in percent 667 */ getDisconnectionNonlocalHighThrPercent()668 public int getDisconnectionNonlocalHighThrPercent() { 669 return mDisconnectionNonlocalHighThrPercent; 670 } 671 672 /** 673 * Gets nonlocal disconnection min count 674 */ getDisconnectionNonlocalCountMin()675 public int getDisconnectionNonlocalCountMin() { 676 return mDisconnectionNonlocalCountMin; 677 } 678 679 /** 680 * Gets health monitor ratio threshold, numerator part 681 */ getHealthMonitorRatioThrNumerator()682 public int getHealthMonitorRatioThrNumerator() { 683 return mHealthMonitorRatioThrNumerator; 684 } 685 686 /** 687 * Gets health monitor min RSSI threshold in dBm 688 */ getHealthMonitorMinRssiThrDbm()689 public int getHealthMonitorMinRssiThrDbm() { 690 return mHealthMonitorMinRssiThrDbm; 691 } 692 693 /** 694 * Gets the Set of SSIDs in the flaky SSID hotlist. 695 */ getRandomizationFlakySsidHotlist()696 public Set<String> getRandomizationFlakySsidHotlist() { 697 return mRandomizationFlakySsidHotlist; 698 } 699 700 /** 701 * Gets the list of SSIDs for non-persistent MAC randomization. 702 */ getNonPersistentMacRandomizationSsidAllowlist()703 public Set<String> getNonPersistentMacRandomizationSsidAllowlist() { 704 return mNonPersistentMacRandomizationSsidAllowlist; 705 } 706 707 /** 708 * Gets the list of SSIDs that non-persistent MAC randomization should not be used for. 709 */ getNonPersistentMacRandomizationSsidBlocklist()710 public Set<String> getNonPersistentMacRandomizationSsidBlocklist() { 711 return mNonPersistentMacRandomizationSsidBlocklist; 712 } 713 /** 714 * Gets the feature flag for reporting abnormal connection failure. 715 */ isAbnormalConnectionFailureBugreportEnabled()716 public boolean isAbnormalConnectionFailureBugreportEnabled() { 717 return mIsAbnormalConnectionFailureBugreportEnabled; 718 } 719 720 /** 721 * Gets the feature flag for reporting abnormal disconnection. 722 */ isAbnormalDisconnectionBugreportEnabled()723 public boolean isAbnormalDisconnectionBugreportEnabled() { 724 return mIsAbnormalDisconnectionBugreportEnabled; 725 } 726 727 /** 728 * Gets health monitor min number of connection attempt threshold 729 */ getHealthMonitorMinNumConnectionAttempt()730 public int getHealthMonitorMinNumConnectionAttempt() { 731 return mHealthMonitorMinNumConnectionAttempt; 732 } 733 734 /** 735 * Gets minimum wait time between two bug report captures 736 */ getBugReportMinWindowMs()737 public int getBugReportMinWindowMs() { 738 return mBugReportMinWindowMs; 739 } 740 741 /** 742 * Gets the extra ratio of threshold to trigger bug report. 743 */ getBugReportThresholdExtraRatio()744 public int getBugReportThresholdExtraRatio() { 745 return mBugReportThresholdExtraRatio; 746 } 747 748 /** 749 * Gets the feature flag for reporting overlapping connection. 750 */ isOverlappingConnectionBugreportEnabled()751 public boolean isOverlappingConnectionBugreportEnabled() { 752 return mIsOverlappingConnectionBugreportEnabled; 753 } 754 755 /** 756 * Gets overlapping connection duration threshold in ms 757 */ getOverlappingConnectionDurationThresholdMs()758 public int getOverlappingConnectionDurationThresholdMs() { 759 return mOverlappingConnectionDurationThresholdMs; 760 } 761 762 /** 763 * Gets the threshold of link speed below which Tx link speed is ignored at low traffic 764 */ getTxLinkSpeedLowThresholdMbps()765 public int getTxLinkSpeedLowThresholdMbps() { 766 return mTxLinkSpeedLowThresholdMbps; 767 } 768 769 /** 770 * Gets the threshold of link speed below which Rx link speed is ignored at low traffic 771 */ getRxLinkSpeedLowThresholdMbps()772 public int getRxLinkSpeedLowThresholdMbps() { 773 return mRxLinkSpeedLowThresholdMbps; 774 } 775 776 /** 777 * Gets the feature flag for Wifi battery saver. 778 */ isWifiBatterySaverEnabled()779 public boolean isWifiBatterySaverEnabled() { 780 return mWifiBatterySaverEnabled; 781 } 782 783 /** 784 * Gets health monitor short connection duration threshold in ms 785 */ getHealthMonitorShortConnectionDurationThrMs()786 public int getHealthMonitorShortConnectionDurationThrMs() { 787 return mHealthMonitorShortConnectionDurationThrMs; 788 } 789 790 /** 791 * Gets abnormal disconnection reason code mask 792 */ getAbnormalDisconnectionReasonCodeMask()793 public long getAbnormalDisconnectionReasonCodeMask() { 794 return mAbnormalDisconnectionReasonCodeMask; 795 } 796 797 /** 798 * Gets health monitor RSSI poll valid time in ms 799 */ getHealthMonitorRssiPollValidTimeMs()800 public int getHealthMonitorRssiPollValidTimeMs() { 801 return mHealthMonitorRssiPollValidTimeMs; 802 } 803 804 /** 805 * Gets scan rssi valid time in ms when device is in non-stationary state 806 */ getNonstationaryScanRssiValidTimeMs()807 public int getNonstationaryScanRssiValidTimeMs() { 808 return mNonstationaryScanRssiValidTimeMs; 809 } 810 811 /** 812 * Gets scan rssi valid time in ms when device is in stationary state 813 */ getStationaryScanRssiValidTimeMs()814 public int getStationaryScanRssiValidTimeMs() { 815 return mStationaryScanRssiValidTimeMs; 816 } 817 818 /** 819 * Gets health monitor firmware alert valid time in ms, 820 * -1 disables firmware alert time check 821 */ getHealthMonitorFwAlertValidTimeMs()822 public int getHealthMonitorFwAlertValidTimeMs() { 823 return mHealthMonitorFwAlertValidTimeMs; 824 } 825 826 /** 827 * Gets the minimum confirmation duration for sending network score to connectivity service 828 * when score breaches low. 829 */ getMinConfirmationDurationSendLowScoreMs()830 public int getMinConfirmationDurationSendLowScoreMs() { 831 return mMinConfirmationDurationSendLowScoreMs; 832 } 833 834 /** 835 * Gets the minimum confirmation duration for sending network score to connectivity service 836 * when score breaches high. 837 */ getMinConfirmationDurationSendHighScoreMs()838 public int getMinConfirmationDurationSendHighScoreMs() { 839 return mMinConfirmationDurationSendHighScoreMs; 840 } 841 842 /** 843 * Gets the RSSI threshold above which low score is not sent to connectivity service when 844 * external scorer takes action. 845 */ getRssiThresholdNotSendLowScoreToCsDbm()846 public int getRssiThresholdNotSendLowScoreToCsDbm() { 847 return mRssiThresholdNotSendLowScoreToCsDbm; 848 } 849 850 /** 851 * Gets traffic stats maximum threshold in KByte 852 */ getTrafficStatsThresholdMaxKbyte()853 public int getTrafficStatsThresholdMaxKbyte() { 854 return mTrafficStatsThresholdMaxKbyte; 855 } 856 857 /** 858 * Gets bandwidth estimator large time constant in second 859 */ getBandwidthEstimatorLargeTimeConstantSec()860 public int getBandwidthEstimatorLargeTimeConstantSec() { 861 return mBandwidthEstimatorLargeTimeConstantSec; 862 } 863 864 /** 865 * Gets the feature flag for reporting interface setup failure 866 */ isInterfaceFailureBugreportEnabled()867 public boolean isInterfaceFailureBugreportEnabled() { 868 return mInterfaceFailureBugreportEnabled; 869 } 870 871 /** 872 * Gets the feature flag for reporting p2p setup failure 873 */ isP2pFailureBugreportEnabled()874 public boolean isP2pFailureBugreportEnabled() { 875 return mP2pFailureBugreportEnabled; 876 } 877 878 /** 879 * Gets the feature flag for APM enhancement 880 */ isApmEnhancementEnabled()881 public boolean isApmEnhancementEnabled() { 882 // reads the value set by Bluetooth device config for APM enhancement feature flag 883 return Settings.Global.getInt( 884 mContext.getContentResolver(), "apm_enhancement_enabled", 0) == 1; 885 } 886 887 /** 888 * Gets the feature flag for Aware suspension 889 */ isAwareSuspensionEnabled()890 public boolean isAwareSuspensionEnabled() { 891 return mAwareSuspensionEnabled; 892 } 893 894 /** 895 * Gets the feature flag for High Perf lock deprecation 896 */ isHighPerfLockDeprecated()897 public boolean isHighPerfLockDeprecated() { 898 return mHighPerfLockDeprecated; 899 } 900 901 /** 902 * Gets the feature flag for the OOB pseudonym of EAP-SIM/AKA/AKA' 903 */ isOobPseudonymEnabled()904 public boolean isOobPseudonymEnabled() { 905 return mOobPseudonymEnabled.isPresent() && mOobPseudonymEnabled.get(); 906 } 907 908 /** 909 * Gets the feature flag indicating whether the application QoS policy API is enabled. 910 */ isApplicationQosPolicyApiEnabled()911 public boolean isApplicationQosPolicyApiEnabled() { 912 return mApplicationQosPolicyApiEnabled; 913 } 914 915 /** 916 * Gets the feature flag for adjusting link layer stats and RSSI polling interval 917 */ isAdjustPollRssiIntervalEnabled()918 public boolean isAdjustPollRssiIntervalEnabled() { 919 return mAdjustPollRssiIntervalEnabled; 920 } 921 922 /** 923 * Gets the feature flag for Software PNO 924 */ isSoftwarePnoEnabled()925 public boolean isSoftwarePnoEnabled() { 926 return mSoftwarePnoEnabled; 927 } 928 929 /** 930 * Gets the feature flag indicating whether Passpoint SSIDs should be included in PNO scans. 931 */ includePasspointSsidsInPnoScans()932 public boolean includePasspointSsidsInPnoScans() { 933 return mIncludePasspointSsidsInPnoScans; 934 } 935 936 /** 937 * Gets the feature flag indicating whether handling IP reachability failures triggered from 938 * Wi-Fi RSSI polling or organic kernel probes the same as failure post roaming. 939 */ isHandleRssiOrganicKernelFailuresEnabled()940 public boolean isHandleRssiOrganicKernelFailuresEnabled() { 941 return mHandleRssiOrganicKernelFailuresEnabled; 942 } 943 944 /* 945 * Sets the listener to be notified when the OOB Pseudonym feature is enabled; 946 * Only 1 listener is accepted. 947 */ setOobPseudonymFeatureFlagChangedListener( Consumer<Boolean> listener)948 public void setOobPseudonymFeatureFlagChangedListener( 949 Consumer<Boolean> listener) { 950 mOobPseudonymFeatureFlagChangedListener = listener; 951 } 952 953 /* 954 * Sets the listener to be notified when the DryRunScorerPkgName is changed. 955 * Only 1 listener is accepted. 956 */ setDryRunScorerPkgNameChangedListener(Consumer<String> listener)957 public void setDryRunScorerPkgNameChangedListener(Consumer<String> listener) { 958 mDryRunScorerPkgNameChangedListener = listener; 959 } 960 getDryRunScorerPkgName()961 public String getDryRunScorerPkgName() { 962 return mDryRunScorerPkgName; 963 } 964 965 /** 966 * Get the set of bugreports that are explicitly disabled. 967 * @return A Set of String to indicate disabled auto-bugreports trigger points. 968 */ getDisabledAutoBugreportTitleAndDetails()969 public Set<String> getDisabledAutoBugreportTitleAndDetails() { 970 return mDisabledAutoBugreports; 971 } 972 getFeatureFlags()973 public FeatureFlags getFeatureFlags() { 974 return mFeatureFlags; 975 } 976 } 977