mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_sm6150-common
synced 2026-01-27 16:26:02 +00:00
sm6150-common: camera: Add enabled bool for finished workarounds
Change-Id: Iede122113f17789cdf88896cb32bc30f574ec54f Signed-off-by: John Galt <johngaltfirstrun@gmail.com> Signed-off-by: therealmharc <therealmharc@gmail.com>
This commit is contained in:
@@ -47,7 +47,7 @@ bool supportsSetTorchModeExt() {
|
||||
}
|
||||
|
||||
int32_t getTorchDefaultStrengthLevelExt() {
|
||||
return 7;
|
||||
return 50;
|
||||
}
|
||||
|
||||
int32_t getTorchMaxStrengthLevelExt() {
|
||||
@@ -64,17 +64,17 @@ int32_t getTorchStrengthLevelExt() {
|
||||
return get(node, 0);
|
||||
}
|
||||
|
||||
void setTorchStrengthLevelExt(int32_t torchStrength) {
|
||||
void setTorchStrengthLevelExt(int32_t torchStrength, bool enabled) {
|
||||
set(TOGGLE_SWITCH, 0);
|
||||
for (auto& path : kTorchLedPaths) {
|
||||
auto node = path + "/" + TORCH_BRIGHTNESS;
|
||||
set(node, torchStrength);
|
||||
}
|
||||
if (torchStrength > 0)
|
||||
if (enabled)
|
||||
set(TOGGLE_SWITCH, 255);
|
||||
}
|
||||
|
||||
void setTorchModeExt(bool enabled) {
|
||||
int32_t strength = getTorchDefaultStrengthLevelExt();
|
||||
setTorchStrengthLevelExt(enabled ? strength : 0);
|
||||
setTorchStrengthLevelExt(enabled ? strength : 0, enabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user