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

Commit 5a1d4285 authored by William Escande's avatar William Escande
Browse files

PbapClient: App exception aren't from SystemServer

Calling into IBluetoothPbapClient will call the PbapClientService 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: I2fe53581f12ce7f40d96ed9450b10f52fd89211a
parent e4597721
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ public final class BluetoothPbapClient implements BluetoothProfile, AutoCloseabl
                        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()));
            }
@@ -286,7 +286,7 @@ public final class BluetoothPbapClient implements BluetoothProfile, AutoCloseabl
                        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()));
            }
@@ -321,7 +321,7 @@ public final class BluetoothPbapClient implements BluetoothProfile, AutoCloseabl
                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()));
            }
@@ -399,7 +399,7 @@ public final class BluetoothPbapClient implements BluetoothProfile, AutoCloseabl
                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()));
            }
@@ -460,7 +460,7 @@ public final class BluetoothPbapClient implements BluetoothProfile, AutoCloseabl
                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()));
            }