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

Commit c05e7ca1 authored by William Escande's avatar William Escande
Browse files

SystemServer: Add more situational log for sleep

Bug: 361850050
Flag: Exempt logging only
Test: m service-Bluetooth
Change-Id: Ia40528c46952a9822541b4a2b29703d334c5bf11
parent 32724566
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1246,6 +1246,7 @@ class BluetoothManagerService {
            mShutdownLatencyHistogram.logSample((float) timeSpentForShutdown);
            mShutdownLatencyHistogram.logSample((float) timeSpentForShutdown);


            // TODO: b/356931756 - Remove sleep
            // TODO: b/356931756 - Remove sleep
            Log.d(TAG, "Force sleep 100 ms for propagating Bluetooth app death");
            SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death
            SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death


            mAdapter = null;
            mAdapter = null;
@@ -1840,8 +1841,10 @@ class BluetoothManagerService {
            // shut down completely before attempting to restart.
            // shut down completely before attempting to restart.
            //
            //
            if (didDisableTimeout) {
            if (didDisableTimeout) {
                Log.d(TAG, "Force sleep 3000 ms for user switch that timed out");
                SystemClock.sleep(3000);
                SystemClock.sleep(3000);
            } else {
            } else {
                Log.d(TAG, "Force sleep 100 ms for");
                SystemClock.sleep(100);
                SystemClock.sleep(100);
            }
            }


@@ -2116,6 +2119,7 @@ class BluetoothManagerService {
    }
    }


    private boolean waitForState(int... states) {
    private boolean waitForState(int... states) {
        Log.d(TAG, "Waiting " + STATE_TIMEOUT + " for state: " + Arrays.toString(states));
        return mState.waitForState(STATE_TIMEOUT, states);
        return mState.waitForState(STATE_TIMEOUT, states);
    }
    }


@@ -2173,6 +2177,7 @@ class BluetoothManagerService {
            mAdapterLock.readLock().unlock();
            mAdapterLock.readLock().unlock();
        }
        }


        Log.d(TAG, "Force sleep 500 ms for recovering from error");
        SystemClock.sleep(500);
        SystemClock.sleep(500);


        // disable
        // disable