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

Commit 85eedeef authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Log local stacktrace to aid investigation.

We've seen reports of connectAllEnabledProfiles() making calls
back into the Bluetooth stack without Binder.clearCallingIdentity();
to track these down add additional logging and continue throwing
the original exception.

Bug: 188391719
Test: manual
Change-Id: I4075a69b484247960c017e0ba7d9253848542028
parent 9bbaadf9
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ import com.android.internal.app.IBatteryStats;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.ArrayUtils;

import libcore.util.SneakyThrow;

import com.google.protobuf.InvalidProtocolBufferException;

import java.io.FileDescriptor;
@@ -1728,7 +1730,13 @@ public class AdapterService extends Service {

            enforceBluetoothPrivilegedPermission(service);

            try {
                return service.connectAllEnabledProfiles(device);
            } catch (Exception e) {
                Log.v(TAG, "connectAllEnabledProfiles() failed", e);
                SneakyThrow.sneakyThrow(e);
                throw new RuntimeException(e);
            }
        }

        @Override
@@ -1743,7 +1751,13 @@ public class AdapterService extends Service {

            enforceBluetoothPrivilegedPermission(service);

            try {
                return service.disconnectAllEnabledProfiles(device);
            } catch (Exception e) {
                Log.v(TAG, "disconnectAllEnabledProfiles() failed", e);
                SneakyThrow.sneakyThrow(e);
                throw new RuntimeException(e);
            }
        }

        @Override