Merge "Remove a binder call from BiometricSensor#toString" into tm-dev

This commit is contained in:
Ilya Matyukhin
2022-03-30 18:14:43 +00:00
committed by Android (Google) Code Review

View File

@@ -22,10 +22,8 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricManager;
import android.hardware.biometrics.IBiometricAuthenticator;
import android.hardware.biometrics.IBiometricSensorReceiver;
import android.hardware.biometrics.SensorPropertiesInternal;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -149,7 +147,7 @@ public abstract class BiometricSensor {
* Returns the actual strength, taking any updated strengths into effect. Since more bits
* means lower strength, the resulting strength is never stronger than the OEM's configured
* strength.
* @return a bitfield, see {@link BiometricManager.Authenticators}
* @return a bitfield, see {@link android.hardware.biometrics.BiometricManager.Authenticators}
*/
@Authenticators.Types int getCurrentStrength() {
return oemStrength | mUpdatedStrength;
@@ -169,27 +167,19 @@ public abstract class BiometricSensor {
* @param newStrength
*/
void updateStrength(@Authenticators.Types int newStrength) {
String log = "updateStrength: Before(" + toString() + ")";
String log = "updateStrength: Before(" + this + ")";
mUpdatedStrength = newStrength;
log += " After(" + toString() + ")";
log += " After(" + this + ")";
Slog.d(TAG, log);
}
@Override
public String toString() {
SensorPropertiesInternal properties = null;
try {
properties = impl.getSensorProperties(mContext.getOpPackageName());
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
}
return "ID(" + id + ")"
+ ", oemStrength: " + oemStrength
+ ", updatedStrength: " + mUpdatedStrength
+ ", modality " + modality
+ ", state: " + mSensorState
+ ", cookie: " + mCookie
+ ", props: " + properties;
+ ", cookie: " + mCookie;
}
}