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

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

HeadsetClient: App exception aren't from SystemServer

Calling into IBluetoothHeadsetClient will call the HeadsetClientService
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: Iaba3c59907fec05c4285751e475a03507c5d704e
parent 5871f36d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -873,7 +873,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
                        mAttributionSource);
            } 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()));
            }
@@ -910,7 +910,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
                        mAttributionSource);
            } 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()));
            }
@@ -943,7 +943,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
                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()));
            }
@@ -1004,7 +1004,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
                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()));
            }
@@ -1062,7 +1062,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
                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()));
            }