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

Commit 55e3b74b authored by William Escande's avatar William Escande
Browse files

LeBroadcast: 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: I6adb47ceb1d075f001ff972dded6e44716368363
parent a8a8fe23
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -449,7 +449,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
                } catch (TimeoutException e) {
                    Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                } catch (RemoteException e) {
                    throw e.rethrowFromSystemServer();
                    throw e.rethrowAsRuntimeException();
                }
            }

@@ -502,7 +502,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException | IllegalStateException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
    }
@@ -574,7 +574,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (SecurityException e) {
                throw e;
            }
@@ -614,7 +614,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (SecurityException e) {
                throw e;
            }
@@ -663,7 +663,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (SecurityException e) {
                throw e;
            }
@@ -709,7 +709,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (SecurityException e) {
                throw e;
            }
@@ -751,7 +751,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            } catch (SecurityException e) {
                throw e;
            }
@@ -786,7 +786,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -820,7 +820,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -848,7 +848,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -877,7 +877,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;
@@ -909,7 +909,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            } catch (TimeoutException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowAsRuntimeException();
            }
        }
        return defaultValue;