ananjaser1211 / hadesRom_Reports

24 stars 0 forks source link

[BUG] Flash shortcut crashing the system. #59

Closed Hidden-Help closed 2 years ago

Hidden-Help commented 3 years ago

Describe the bug As title says. But the only reason I'm reporting this is if it may help you find something missing for flashlight in future. It's not something everyone uses anyways.

To Reproduce Steps to reproduce the behavior:

  1. Go to settings, lock screen, shortcuts.
  2. Add flashlight as a shortcut for lock screen.
  3. Lock the phone.
  4. Swipe on the flashlight shortcut to bring it up.
  5. Everything goes black.

Expected behavior flash to work or whatever but as I said it's not a big problem. I'm just hoping it may help with something.

Smartphone (please complete the following information):

Additional context I'll gather logs if it's not reproducible. As I'm really just trying to help and not complain or anything.

With love.

ananjaser1211 commented 3 years ago

This has to do with #5 , only the qs toggle and camera will run flash light system wise, shortcuts. edge panel (sos stuff) etc will not work and possibly crash.

this is unlikely to be ever fixed

lucf15 commented 3 years ago

The flashlight level doesn't work as CameraService gives this error "Camera 0 has no flashlight" but I've patched the SystemUI.apk so that flashlight shortcut from lockscreen works.

Basically the shortcut when pressed triggers the FlashlightControllerImpl.setFlashlightLevel method which invokes this.mCameraManager.setTorchMode with 3 arguments, the last argument is the level but this method has also a overload with two parameters that enables flashlight without specifying level so I basically removed the level argument so that the method enables flashlight but with the default level (I guess) which works.

(Tested with the flashlight shortcut in lockscreen).

I've attatched here the SystemUI patched. As the apk is bigger than 10MB I've added the apk into a zip archive and splitted in 8 parts but since Github doesn't allow to attach files with 00x extensions I've renamed each part adding the zip extension.

SystemUI.zip.001.zip SystemUI.zip.002.zip SystemUI.zip.003.zip SystemUI.zip.004.zip SystemUI.zip.005.zip SystemUI.zip.006.zip SystemUI.zip.007.zip SystemUI.zip.008.zip

ananjaser1211 commented 2 years ago

This now affects S8/S8+ models, since fixing iris involved breaking the fix that made flash intensity controller work. i indeed should have just disabled the flash level controller but it totally slipped my mind.

@lucf15 thanks for the fix (i know it is pretty late) will implement it in the next release.

corsicanu commented 2 years ago

This now affects S8/S8+ models, since fixing iris involved breaking the fix that made flash intensity controller work. i indeed should have just disabled the flash level controller but it totally slipped my mind.

@lucf15 thanks for the fix (i know it is pretty late) will implement it in the next release.

Do not forget this is system wide and needs to be patched also in places like edge tools or more.

ananjaser1211 commented 2 years ago

Hades V3.0 Has been released and addressed this issue, if the issue persists, please reopen with logs / details