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

Commit 51f0dac6 authored by Xiaohui Niu's avatar Xiaohui Niu
Browse files

Headset: Remove RuntimeException in SystemServer

API to bluetooth return RemoteException is an
expected exception when bluetooth is died.
Don't crash system under this scenario.

Bug: 356772531
Test: manual test
Change-Id: Ic7fc2c17b52a3006b48284efcd99e43ac81ce8c6
parent 56056198
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -819,7 +819,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return service.getAudioState(device, mAttributionSource);
                return service.getAudioState(device, mAttributionSource);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowAsRuntimeException();
            }
            }
        }
        }
        return BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
        return BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
@@ -878,7 +877,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return BluetoothStatusCodes.SUCCESS;
                return BluetoothStatusCodes.SUCCESS;
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowAsRuntimeException();
            }
            }
        }
        }


@@ -913,7 +911,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
                        : BluetoothStatusCodes.NOT_ALLOWED;
                        : BluetoothStatusCodes.NOT_ALLOWED;
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowAsRuntimeException();
            }
            }
        }
        }


@@ -995,7 +992,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return service.connectAudio(mAttributionSource);
                return service.connectAudio(mAttributionSource);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowAsRuntimeException();
            }
            }
        }
        }


@@ -1046,7 +1042,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
                return service.disconnectAudio(mAttributionSource);
                return service.disconnectAudio(mAttributionSource);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                throw e.rethrowAsRuntimeException();
            }
            }
        }
        }