Allow UdfpsController to be extended

Bug: 178533728
Test: build
Change-Id: I6b5bcf771784ecdc0d93528dc116a01fca4cf7b2
This commit is contained in:
Ilya Matyukhin
2021-01-27 00:58:30 -08:00
committed by Kevin Chyn
parent 1ee0214118
commit e40a05702f

View File

@@ -47,6 +47,7 @@ import androidx.annotation.Nullable;
import com.android.internal.BrightnessSynchronizer;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeReceiver;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -71,7 +72,8 @@ import javax.inject.Inject;
* {@code sensorId} parameters.
*/
@SuppressWarnings("deprecation")
class UdfpsController implements DozeReceiver {
@SysUISingleton
public class UdfpsController implements DozeReceiver {
private static final String TAG = "UdfpsController";
// Gamma approximation for the sRGB color space.
private static final float DISPLAY_GAMMA = 2.2f;
@@ -177,7 +179,7 @@ class UdfpsController implements DozeReceiver {
};
@Inject
UdfpsController(@NonNull Context context,
public UdfpsController(@NonNull Context context,
@Main Resources resources,
LayoutInflater inflater,
@Nullable FingerprintManager fingerprintManager,
@@ -464,7 +466,7 @@ class UdfpsController implements DozeReceiver {
onFingerUp();
}
private void onFingerDown(int x, int y, float minor, float major) {
protected void onFingerDown(int x, int y, float minor, float major) {
if (mHbmSupported) {
try {
FileWriter fw = new FileWriter(mHbmPath);
@@ -482,7 +484,7 @@ class UdfpsController implements DozeReceiver {
mView.showScrimAndDot();
}
private void onFingerUp() {
protected void onFingerUp() {
mFingerprintManager.onPointerUp(mSensorProps.sensorId);
// Hiding the scrim before disabling HBM results in less noticeable flicker.
mView.hideScrimAndDot();
@@ -521,4 +523,8 @@ class UdfpsController implements DozeReceiver {
}
return normalizedBacklight;
}
protected UdfpsView getView() {
return mView;
}
}