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

Commit 17a262fa authored by William Escande's avatar William Escande
Browse files

Headset: App exception aren't from SystemServer

Calling into IBluetoothHeadset will call the HeadsetService from
Bluetooth app that does not live in the systemServer.
Therefore, exception should be rethrown as runtimeException

Bug: 298264617
Test: atest CtsBluetoothTestCases | Cts does not handled failure in the
      binder nor any of the Test framework we currently have
Change-Id: I617c28686fc3af639b2ca980129974633403ff2f
parent 24072ec1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -852,7 +852,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(defaultValue);
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                return BluetoothStatusCodes.ERROR_TIMEOUT;
@@ -919,7 +919,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return BluetoothStatusCodes.ERROR_TIMEOUT;
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }

@@ -959,7 +959,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return BluetoothStatusCodes.ERROR_TIMEOUT;
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }

@@ -1044,7 +1044,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(defaultValue);
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                return BluetoothStatusCodes.ERROR_TIMEOUT;
@@ -1099,7 +1099,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(defaultValue);
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                return BluetoothStatusCodes.ERROR_TIMEOUT;