Loading service/src/com/android/server/bluetooth/BluetoothManagerService.java +12 −23 Original line number Diff line number Diff line Loading @@ -127,36 +127,25 @@ class BluetoothManagerService { private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; // See android.os.Build.HW_TIMEOUT_MULTIPLIER. This should not be set on real hw private static final int HW_MULTIPLIER = SystemProperties.getInt("ro.hw_timeout_multiplier", 1); // Maximum msec to wait for a bind private static final int TIMEOUT_BIND_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int TIMEOUT_BIND_MS = 4000 * HW_MULTIPLIER; // Timeout value for synchronous binder call private static final Duration SYNC_CALLS_TIMEOUT = Duration.ofSeconds(3 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1)); /** * @return timeout value for synchronous binder call */ private static Duration getSyncTimeout() { return SYNC_CALLS_TIMEOUT; } private static final Duration STATE_TIMEOUT = Duration.ofSeconds(4 * HW_MULTIPLIER); // Maximum msec to wait for service restart private static final int SERVICE_RESTART_TIME_MS = 400 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int SERVICE_RESTART_TIME_MS = 400 * HW_MULTIPLIER; // Maximum msec to wait for restart due to error private static final int ERROR_RESTART_TIME_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ERROR_RESTART_TIME_MS = 3000 * HW_MULTIPLIER; // Maximum msec to delay MESSAGE_USER_SWITCHED private static final int USER_SWITCHED_TIME_MS = 200 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int USER_SWITCHED_TIME_MS = 200 * HW_MULTIPLIER; // Delay for the addProxy function in msec private static final int ADD_PROXY_DELAY_MS = 100 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ADD_PROXY_DELAY_MS = 100 * HW_MULTIPLIER; // Delay for retrying enable and disable in msec private static final int ENABLE_DISABLE_DELAY_MS = 300 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ENABLE_DISABLE_DELAY_MS = 300 * HW_MULTIPLIER; @VisibleForTesting static final int MESSAGE_ENABLE = 1; @VisibleForTesting static final int MESSAGE_DISABLE = 2; Loading Loading @@ -2147,11 +2136,11 @@ class BluetoothManagerService { } boolean waitForManagerState(int state) { return mState.waitForState(getSyncTimeout(), state); return mState.waitForState(STATE_TIMEOUT, state); } private boolean waitForState(int... states) { return mState.waitForState(getSyncTimeout(), states); return mState.waitForState(STATE_TIMEOUT, states); } private void sendDisableMsg(int reason) { Loading Loading
service/src/com/android/server/bluetooth/BluetoothManagerService.java +12 −23 Original line number Diff line number Diff line Loading @@ -127,36 +127,25 @@ class BluetoothManagerService { private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; // See android.os.Build.HW_TIMEOUT_MULTIPLIER. This should not be set on real hw private static final int HW_MULTIPLIER = SystemProperties.getInt("ro.hw_timeout_multiplier", 1); // Maximum msec to wait for a bind private static final int TIMEOUT_BIND_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int TIMEOUT_BIND_MS = 4000 * HW_MULTIPLIER; // Timeout value for synchronous binder call private static final Duration SYNC_CALLS_TIMEOUT = Duration.ofSeconds(3 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1)); /** * @return timeout value for synchronous binder call */ private static Duration getSyncTimeout() { return SYNC_CALLS_TIMEOUT; } private static final Duration STATE_TIMEOUT = Duration.ofSeconds(4 * HW_MULTIPLIER); // Maximum msec to wait for service restart private static final int SERVICE_RESTART_TIME_MS = 400 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int SERVICE_RESTART_TIME_MS = 400 * HW_MULTIPLIER; // Maximum msec to wait for restart due to error private static final int ERROR_RESTART_TIME_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ERROR_RESTART_TIME_MS = 3000 * HW_MULTIPLIER; // Maximum msec to delay MESSAGE_USER_SWITCHED private static final int USER_SWITCHED_TIME_MS = 200 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int USER_SWITCHED_TIME_MS = 200 * HW_MULTIPLIER; // Delay for the addProxy function in msec private static final int ADD_PROXY_DELAY_MS = 100 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ADD_PROXY_DELAY_MS = 100 * HW_MULTIPLIER; // Delay for retrying enable and disable in msec private static final int ENABLE_DISABLE_DELAY_MS = 300 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); private static final int ENABLE_DISABLE_DELAY_MS = 300 * HW_MULTIPLIER; @VisibleForTesting static final int MESSAGE_ENABLE = 1; @VisibleForTesting static final int MESSAGE_DISABLE = 2; Loading Loading @@ -2147,11 +2136,11 @@ class BluetoothManagerService { } boolean waitForManagerState(int state) { return mState.waitForState(getSyncTimeout(), state); return mState.waitForState(STATE_TIMEOUT, state); } private boolean waitForState(int... states) { return mState.waitForState(getSyncTimeout(), states); return mState.waitForState(STATE_TIMEOUT, states); } private void sendDisableMsg(int reason) { Loading