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

Commit 358cdb36 authored by Xiaohui Niu's avatar Xiaohui Niu
Browse files

Fix exception when setTorchMode

Camera HAL return error is an
expected exception, should catch it
and don't crash the system.

Bug: 352454999
Test: manual test
Change-Id: I5458d9968605ee430964a3fc1e9f5eef3811c266
parent 266fd322
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -659,6 +659,8 @@ class FlashNotificationsController {
                mIsTorchTouched = on;
            } catch (CameraAccessException e) {
                Log.e(LOG_TAG, "Failed to setTorchMode: " + e);
            } catch (IllegalArgumentException  e) {
                Log.e(LOG_TAG, "Failed to setTorchMode: " + e);
            }
        } else {
            Log.e(LOG_TAG, "Can not use camera flash notification, please check CameraManager!");