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

Commit 5871f36d authored by William Escande's avatar William Escande
Browse files

MapClient: App exception aren't from SystemServer

Calling into IBluetoothMapClient will call the MapClientService 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: Idf5401282da69391e49361113f3db6c8dcecfec7
parent 241b4b97
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -369,7 +369,7 @@ public final class BluetoothMapClient implements BluetoothProfile, AutoCloseable
                        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()));
            }
@@ -406,7 +406,7 @@ public final class BluetoothMapClient implements BluetoothProfile, AutoCloseable
                        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()));
            }
@@ -439,7 +439,7 @@ public final class BluetoothMapClient implements BluetoothProfile, AutoCloseable
                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()));
            }
@@ -503,7 +503,7 @@ public final class BluetoothMapClient implements BluetoothProfile, AutoCloseable
                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()));
            }
@@ -562,7 +562,7 @@ public final class BluetoothMapClient implements BluetoothProfile, AutoCloseable
                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()));
            }