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

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

LeAudio: App exception aren't from SystemServer

Calling into IBluetoothLeAudio will call the LeAudioService 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: Idfb7ae662fcadf33358bfd728554fcdb25e92a4c
parent 17a262fa
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -961,7 +961,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
                } catch (TimeoutException e) {
                    Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                } catch (RemoteException e) {
                    throw e.rethrowFromSystemServer();
                    throw e.rethrowAsRuntimeException();
                }
            }

@@ -1013,7 +1013,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
    }
@@ -1281,7 +1281,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -1432,7 +1432,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -1474,7 +1474,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
                                        mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
    }