|
|
|
|
@ -43,6 +43,7 @@ public class AdvancedDisplaySettingsActivity extends BaseInputActivity
|
|
|
|
|
private String mStrPlatform;
|
|
|
|
|
private boolean mIsSupportDRM;
|
|
|
|
|
private boolean isFirstIn = true;
|
|
|
|
|
private boolean mBcshChanged = false;
|
|
|
|
|
/**
|
|
|
|
|
* BCSH亮度
|
|
|
|
|
*/
|
|
|
|
|
@ -172,6 +173,10 @@ public class AdvancedDisplaySettingsActivity extends BaseInputActivity
|
|
|
|
|
new Class[] { int.class }, new Object[] { mDisplayId });
|
|
|
|
|
mOldBcshTone = (Integer) ReflectUtils.invokeMethod(mRkDisplayManager, "getSWHue", new Class[] { int.class },
|
|
|
|
|
new Object[] { mDisplayId });
|
|
|
|
|
if (mOldBcshBrightness == 0 && mOldBcshContrast == 0 && mOldBcshStauration == 0 && mOldBcshTone == 0) {
|
|
|
|
|
mOldBcshBrightness = mOldBcshContrast = mOldBcshStauration = mOldBcshTone = 50;
|
|
|
|
|
Log.w(TAG, "invalid Bcsh value, use reset value " + mOldBcshBrightness);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mOldBcshBrightness = (Integer) ReflectUtils.invokeMethod(mRkDisplayManager, "getBrightness",
|
|
|
|
|
new Class[] { int.class }, new Object[] { mDisplayId });
|
|
|
|
|
@ -181,7 +186,8 @@ public class AdvancedDisplaySettingsActivity extends BaseInputActivity
|
|
|
|
|
new Class[] { int.class }, new Object[] { mDisplayId });
|
|
|
|
|
mOldBcshTone = (Integer) ReflectUtils.invokeMethod(mRkDisplayManager, "getHue", new Class[] { int.class },
|
|
|
|
|
new Object[] { mDisplayId });
|
|
|
|
|
} }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mSeekBarBcshBrightness.setOnSeekBarChangeListener(this);
|
|
|
|
|
mSeekBarBcshContrast.setOnSeekBarChangeListener(this);
|
|
|
|
|
mSeekBarBcshSaturation.setOnSeekBarChangeListener(this);
|
|
|
|
|
@ -206,13 +212,25 @@ public class AdvancedDisplaySettingsActivity extends BaseInputActivity
|
|
|
|
|
@Override
|
|
|
|
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
|
if (seekBar == mSeekBarBcshBrightness) {
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
if (progress != mOldBcshBrightness) {
|
|
|
|
|
mBcshChanged = true;
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
}
|
|
|
|
|
} else if (seekBar == mSeekBarBcshContrast) {
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
if (progress != mOldBcshContrast) {
|
|
|
|
|
mBcshChanged = true;
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
}
|
|
|
|
|
} else if (seekBar == mSeekBarBcshSaturation) {
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
if (progress != mOldBcshStauration) {
|
|
|
|
|
mBcshChanged = true;
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
}
|
|
|
|
|
} else if (seekBar == mSeekBarBcshTone) {
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
if (progress != mOldBcshTone) {
|
|
|
|
|
mBcshChanged = true;
|
|
|
|
|
updateBcshValue();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Log.i(TAG, "onProgressChanged->progress:" + progress);
|
|
|
|
|
}
|
|
|
|
|
@ -276,6 +294,11 @@ public class AdvancedDisplaySettingsActivity extends BaseInputActivity
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void recoveryOldValue() {
|
|
|
|
|
if (!mBcshChanged) {
|
|
|
|
|
Log.d(TAG, "unchanged Bcsh value, skipping");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mIsSupportDRM && mRkDisplayManager != null) {
|
|
|
|
|
if ("rk3576".equals(mStrPlatform)) {
|
|
|
|
|
ReflectUtils.invokeMethod(mRkDisplayManager, "setSWBrightness", new Class[] { int.class, int.class },
|
|
|
|
|
|