Skip to content
Snippets Groups Projects
Commit a8a8fe23 authored by William Escande's avatar William Escande
Browse files

VolumeControl: App exception aren't from SystemServer

Calling into IBluetoothVolumeControl will call the VolumeControlService
from Bluetooth app that does not live in the systemServer.
Therefore, exception should be rethrown as runtimeException

Keeping the only call into the systemServer as a rethrow from
systemServer

Bug: 298264617
Test: atest CtsBluetoothTestCases | Cts does not handled failure in the
      binder nor any of the Test framework we currently have
Change-Id: Iaa23917a29833671c3e21a4a89d2b2fd92c808a9
parent 36d0841e
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
mgr.registerStateChangeCallback(mBluetoothStateChangeCallback);
} catch (RemoteException e) {
Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
// IBluetoothManager run in the system server
throw e.rethrowFromSystemServer();
}
}
......@@ -370,7 +371,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
}
} 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()));
}
......@@ -421,7 +422,7 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
}
} catch (RemoteException e) {
Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
throw e.rethrowFromSystemServer();
throw e.rethrowAsRuntimeException();
} catch (IllegalStateException | TimeoutException e) {
Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment