Merge "[DO NOT MERGE] Add sysUiSessionId between BiometricService and AuthController" into rvc-dev
This commit is contained in:
@@ -137,7 +137,7 @@ oneway interface IStatusBar
|
|||||||
// Used to show the authentication dialog (Biometrics, Device Credential)
|
// Used to show the authentication dialog (Biometrics, Device Credential)
|
||||||
void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
||||||
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId);
|
long operationId, int sysUiSessionId);
|
||||||
// Used to notify the authentication dialog that a biometric has been authenticated
|
// Used to notify the authentication dialog that a biometric has been authenticated
|
||||||
void onBiometricAuthenticated();
|
void onBiometricAuthenticated();
|
||||||
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ interface IStatusBarService
|
|||||||
// Used to show the authentication dialog (Biometrics, Device Credential)
|
// Used to show the authentication dialog (Biometrics, Device Credential)
|
||||||
void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
||||||
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId);
|
long operationId, int sysUiSessionId);
|
||||||
// Used to notify the authentication dialog that a biometric has been authenticated
|
// Used to notify the authentication dialog that a biometric has been authenticated
|
||||||
void onBiometricAuthenticated();
|
void onBiometricAuthenticated();
|
||||||
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ public abstract class AuthBiometricView extends LinearLayout {
|
|||||||
Utils.notifyAccessibilityContentChanged(mAccessibilityManager, this);
|
Utils.notifyAccessibilityContentChanged(mAccessibilityManager, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateState(@BiometricState int newState) {
|
void updateState(@BiometricState int newState) {
|
||||||
Log.v(TAG, "newState: " + newState);
|
Log.v(TAG, "newState: " + newState);
|
||||||
|
|
||||||
switch (newState) {
|
switch (newState) {
|
||||||
@@ -453,8 +453,10 @@ public abstract class AuthBiometricView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
announceForAccessibility(getResources()
|
announceForAccessibility(getResources()
|
||||||
.getString(R.string.biometric_dialog_authenticated));
|
.getString(R.string.biometric_dialog_authenticated));
|
||||||
mHandler.postDelayed(() -> mCallback.onAction(Callback.ACTION_AUTHENTICATED),
|
mHandler.postDelayed(() -> {
|
||||||
getDelayAfterAuthenticatedDurationMs());
|
Log.d(TAG, "Sending ACTION_AUTHENTICATED");
|
||||||
|
mCallback.onAction(Callback.ACTION_AUTHENTICATED);
|
||||||
|
}, getDelayAfterAuthenticatedDurationMs());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_PENDING_CONFIRMATION:
|
case STATE_PENDING_CONFIRMATION:
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class AuthContainerView extends LinearLayout
|
|||||||
int mModalityMask;
|
int mModalityMask;
|
||||||
boolean mSkipIntro;
|
boolean mSkipIntro;
|
||||||
long mOperationId;
|
long mOperationId;
|
||||||
|
int mSysUiSessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
@@ -158,6 +159,11 @@ public class AuthContainerView extends LinearLayout
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setSysUiSessionId(int sysUiSessionId) {
|
||||||
|
mConfig.mSysUiSessionId = sysUiSessionId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AuthContainerView build(int modalityMask) {
|
public AuthContainerView build(int modalityMask) {
|
||||||
mConfig.mModalityMask = modalityMask;
|
mConfig.mModalityMask = modalityMask;
|
||||||
return new AuthContainerView(mConfig, new Injector());
|
return new AuthContainerView(mConfig, new Injector());
|
||||||
@@ -203,6 +209,9 @@ public class AuthContainerView extends LinearLayout
|
|||||||
final class BiometricCallback implements AuthBiometricView.Callback {
|
final class BiometricCallback implements AuthBiometricView.Callback {
|
||||||
@Override
|
@Override
|
||||||
public void onAction(int action) {
|
public void onAction(int action) {
|
||||||
|
Log.d(TAG, "onAction: " + action
|
||||||
|
+ ", sysUiSessionId: " + mConfig.mSysUiSessionId
|
||||||
|
+ ", state: " + mContainerState);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case AuthBiometricView.Callback.ACTION_AUTHENTICATED:
|
case AuthBiometricView.Callback.ACTION_AUTHENTICATED:
|
||||||
animateAway(AuthDialogCallback.DISMISSED_BIOMETRIC_AUTHENTICATED);
|
animateAway(AuthDialogCallback.DISMISSED_BIOMETRIC_AUTHENTICATED);
|
||||||
@@ -461,13 +470,13 @@ public class AuthContainerView extends LinearLayout
|
|||||||
if (animate) {
|
if (animate) {
|
||||||
animateAway(false /* sendReason */, 0 /* reason */);
|
animateAway(false /* sendReason */, 0 /* reason */);
|
||||||
} else {
|
} else {
|
||||||
removeWindowIfAttached();
|
removeWindowIfAttached(false /* sendReason */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dismissFromSystemServer() {
|
public void dismissFromSystemServer() {
|
||||||
removeWindowIfAttached();
|
removeWindowIfAttached(true /* sendReason */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -540,7 +549,7 @@ public class AuthContainerView extends LinearLayout
|
|||||||
|
|
||||||
final Runnable endActionRunnable = () -> {
|
final Runnable endActionRunnable = () -> {
|
||||||
setVisibility(View.INVISIBLE);
|
setVisibility(View.INVISIBLE);
|
||||||
removeWindowIfAttached();
|
removeWindowIfAttached(true /* sendReason */);
|
||||||
};
|
};
|
||||||
|
|
||||||
postOnAnimation(() -> {
|
postOnAnimation(() -> {
|
||||||
@@ -575,19 +584,24 @@ public class AuthContainerView extends LinearLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendPendingCallbackIfNotNull() {
|
private void sendPendingCallbackIfNotNull() {
|
||||||
Log.d(TAG, "pendingCallback: " + mPendingCallbackReason);
|
Log.d(TAG, "pendingCallback: " + mPendingCallbackReason
|
||||||
|
+ " sysUISessionId: " + mConfig.mSysUiSessionId);
|
||||||
if (mPendingCallbackReason != null) {
|
if (mPendingCallbackReason != null) {
|
||||||
mConfig.mCallback.onDismissed(mPendingCallbackReason, mCredentialAttestation);
|
mConfig.mCallback.onDismissed(mPendingCallbackReason, mCredentialAttestation);
|
||||||
mPendingCallbackReason = null;
|
mPendingCallbackReason = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeWindowIfAttached() {
|
private void removeWindowIfAttached(boolean sendReason) {
|
||||||
sendPendingCallbackIfNotNull();
|
if (sendReason) {
|
||||||
|
sendPendingCallbackIfNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
if (mContainerState == STATE_GONE) {
|
if (mContainerState == STATE_GONE) {
|
||||||
|
Log.w(TAG, "Container already STATE_GONE, mSysUiSessionId: " + mConfig.mSysUiSessionId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Log.d(TAG, "Removing container, mSysUiSessionId: " + mConfig.mSysUiSessionId);
|
||||||
mContainerState = STATE_GONE;
|
mContainerState = STATE_GONE;
|
||||||
mWindowManager.removeView(this);
|
mWindowManager.removeView(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,14 +276,15 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
@Override
|
@Override
|
||||||
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
||||||
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId) {
|
long operationId, int sysUiSessionId) {
|
||||||
final int authenticators = Utils.getAuthenticators(bundle);
|
final int authenticators = Utils.getAuthenticators(bundle);
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "showAuthenticationDialog, authenticators: " + authenticators
|
Log.d(TAG, "showAuthenticationDialog, authenticators: " + authenticators
|
||||||
+ ", biometricModality: " + biometricModality
|
+ ", biometricModality: " + biometricModality
|
||||||
+ ", requireConfirmation: " + requireConfirmation
|
+ ", requireConfirmation: " + requireConfirmation
|
||||||
+ ", operationId: " + operationId);
|
+ ", operationId: " + operationId
|
||||||
|
+ ", sysUiSessionId: " + sysUiSessionId);
|
||||||
}
|
}
|
||||||
SomeArgs args = SomeArgs.obtain();
|
SomeArgs args = SomeArgs.obtain();
|
||||||
args.arg1 = bundle;
|
args.arg1 = bundle;
|
||||||
@@ -293,6 +294,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
args.argi2 = userId;
|
args.argi2 = userId;
|
||||||
args.arg4 = opPackageName;
|
args.arg4 = opPackageName;
|
||||||
args.arg5 = operationId;
|
args.arg5 = operationId;
|
||||||
|
args.argi3 = sysUiSessionId;
|
||||||
|
|
||||||
boolean skipAnimation = false;
|
boolean skipAnimation = false;
|
||||||
if (mCurrentDialog != null) {
|
if (mCurrentDialog != null) {
|
||||||
@@ -382,6 +384,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
final int userId = args.argi2;
|
final int userId = args.argi2;
|
||||||
final String opPackageName = (String) args.arg4;
|
final String opPackageName = (String) args.arg4;
|
||||||
final long operationId = (long) args.arg5;
|
final long operationId = (long) args.arg5;
|
||||||
|
final int sysUiSessionId = args.argi3;
|
||||||
|
|
||||||
// Create a new dialog but do not replace the current one yet.
|
// Create a new dialog but do not replace the current one yet.
|
||||||
final AuthDialog newDialog = buildDialog(
|
final AuthDialog newDialog = buildDialog(
|
||||||
@@ -391,7 +394,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
type,
|
type,
|
||||||
opPackageName,
|
opPackageName,
|
||||||
skipAnimation,
|
skipAnimation,
|
||||||
operationId);
|
operationId,
|
||||||
|
sysUiSessionId);
|
||||||
|
|
||||||
if (newDialog == null) {
|
if (newDialog == null) {
|
||||||
Log.e(TAG, "Unsupported type: " + type);
|
Log.e(TAG, "Unsupported type: " + type);
|
||||||
@@ -403,7 +407,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
+ " savedState: " + savedState
|
+ " savedState: " + savedState
|
||||||
+ " mCurrentDialog: " + mCurrentDialog
|
+ " mCurrentDialog: " + mCurrentDialog
|
||||||
+ " newDialog: " + newDialog
|
+ " newDialog: " + newDialog
|
||||||
+ " type: " + type);
|
+ " type: " + type
|
||||||
|
+ " sysUiSessionId: " + sysUiSessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCurrentDialog != null) {
|
if (mCurrentDialog != null) {
|
||||||
@@ -458,7 +463,8 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation,
|
protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation,
|
||||||
int userId, int type, String opPackageName, boolean skipIntro, long operationId) {
|
int userId, int type, String opPackageName, boolean skipIntro, long operationId,
|
||||||
|
int sysUiSessionId) {
|
||||||
return new AuthContainerView.Builder(mContext)
|
return new AuthContainerView.Builder(mContext)
|
||||||
.setCallback(this)
|
.setCallback(this)
|
||||||
.setBiometricPromptBundle(biometricPromptBundle)
|
.setBiometricPromptBundle(biometricPromptBundle)
|
||||||
@@ -467,6 +473,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
|
|||||||
.setOpPackageName(opPackageName)
|
.setOpPackageName(opPackageName)
|
||||||
.setSkipIntro(skipIntro)
|
.setSkipIntro(skipIntro)
|
||||||
.setOperationId(operationId)
|
.setOperationId(operationId)
|
||||||
|
.setSysUiSessionId(sysUiSessionId)
|
||||||
.build(type);
|
.build(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
|
|||||||
default void showAuthenticationDialog(Bundle bundle,
|
default void showAuthenticationDialog(Bundle bundle,
|
||||||
IBiometricServiceReceiverInternal receiver, int biometricModality,
|
IBiometricServiceReceiverInternal receiver, int biometricModality,
|
||||||
boolean requireConfirmation, int userId, String opPackageName,
|
boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId) { }
|
long operationId, int sysUiSessionId) { }
|
||||||
default void onBiometricAuthenticated() { }
|
default void onBiometricAuthenticated() { }
|
||||||
default void onBiometricHelp(String message) { }
|
default void onBiometricHelp(String message) { }
|
||||||
default void onBiometricError(int modality, int error, int vendorCode) { }
|
default void onBiometricError(int modality, int error, int vendorCode) { }
|
||||||
@@ -782,7 +782,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
|
|||||||
@Override
|
@Override
|
||||||
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
||||||
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId) {
|
long operationId, int sysUiSessionId) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
SomeArgs args = SomeArgs.obtain();
|
SomeArgs args = SomeArgs.obtain();
|
||||||
args.arg1 = bundle;
|
args.arg1 = bundle;
|
||||||
@@ -792,6 +792,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
|
|||||||
args.argi2 = userId;
|
args.argi2 = userId;
|
||||||
args.arg4 = opPackageName;
|
args.arg4 = opPackageName;
|
||||||
args.arg5 = operationId;
|
args.arg5 = operationId;
|
||||||
|
args.argi3 = sysUiSessionId;
|
||||||
mHandler.obtainMessage(MSG_BIOMETRIC_SHOW, args)
|
mHandler.obtainMessage(MSG_BIOMETRIC_SHOW, args)
|
||||||
.sendToTarget();
|
.sendToTarget();
|
||||||
}
|
}
|
||||||
@@ -1169,7 +1170,8 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
|
|||||||
(boolean) someArgs.arg3 /* requireConfirmation */,
|
(boolean) someArgs.arg3 /* requireConfirmation */,
|
||||||
someArgs.argi2 /* userId */,
|
someArgs.argi2 /* userId */,
|
||||||
(String) someArgs.arg4 /* opPackageName */,
|
(String) someArgs.arg4 /* opPackageName */,
|
||||||
(long) someArgs.arg5 /* operationId */);
|
(long) someArgs.arg5 /* operationId */,
|
||||||
|
someArgs.argi3 /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
someArgs.recycle();
|
someArgs.recycle();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -470,7 +470,8 @@ public class AuthControllerTest extends SysuiTestCase {
|
|||||||
true /* requireConfirmation */,
|
true /* requireConfirmation */,
|
||||||
0 /* userId */,
|
0 /* userId */,
|
||||||
"testPackage",
|
"testPackage",
|
||||||
0 /* operationId */);
|
0 /* operationId */,
|
||||||
|
0 /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Bundle createTestDialogBundle(int authenticators) {
|
private Bundle createTestDialogBundle(int authenticators) {
|
||||||
@@ -508,7 +509,7 @@ public class AuthControllerTest extends SysuiTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected AuthDialog buildDialog(Bundle biometricPromptBundle,
|
protected AuthDialog buildDialog(Bundle biometricPromptBundle,
|
||||||
boolean requireConfirmation, int userId, int type, String opPackageName,
|
boolean requireConfirmation, int userId, int type, String opPackageName,
|
||||||
boolean skipIntro, long operationId) {
|
boolean skipIntro, long operationId, int sysUiSessionId) {
|
||||||
|
|
||||||
mLastBiometricPromptBundle = biometricPromptBundle;
|
mLastBiometricPromptBundle = biometricPromptBundle;
|
||||||
|
|
||||||
|
|||||||
@@ -410,11 +410,12 @@ public class CommandQueueTest extends SysuiTestCase {
|
|||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
String packageName = "test";
|
String packageName = "test";
|
||||||
final long operationId = 1;
|
final long operationId = 1;
|
||||||
|
final int sysUiSessionId = 2;
|
||||||
mCommandQueue.showAuthenticationDialog(bundle, null /* receiver */, 1, true, 3,
|
mCommandQueue.showAuthenticationDialog(bundle, null /* receiver */, 1, true, 3,
|
||||||
packageName, operationId);
|
packageName, operationId, sysUiSessionId);
|
||||||
waitForIdleSync();
|
waitForIdleSync();
|
||||||
verify(mCallbacks).showAuthenticationDialog(eq(bundle), eq(null), eq(1), eq(true), eq(3),
|
verify(mCallbacks).showAuthenticationDialog(eq(bundle), eq(null), eq(1), eq(true), eq(3),
|
||||||
eq(packageName), eq(operationId));
|
eq(packageName), eq(operationId), eq(sysUiSessionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -170,6 +170,8 @@ public class BiometricService extends SystemService {
|
|||||||
final String mOpPackageName;
|
final String mOpPackageName;
|
||||||
// Info to be shown on BiometricDialog when all cookies are returned.
|
// Info to be shown on BiometricDialog when all cookies are returned.
|
||||||
final Bundle mBundle;
|
final Bundle mBundle;
|
||||||
|
// Random id associated to this AuthSession
|
||||||
|
final int mSysUiSessionId;
|
||||||
final int mCallingUid;
|
final int mCallingUid;
|
||||||
final int mCallingPid;
|
final int mCallingPid;
|
||||||
final int mCallingUserId;
|
final int mCallingUserId;
|
||||||
@@ -203,11 +205,13 @@ public class BiometricService extends SystemService {
|
|||||||
mClientReceiver = receiver;
|
mClientReceiver = receiver;
|
||||||
mOpPackageName = opPackageName;
|
mOpPackageName = opPackageName;
|
||||||
mBundle = bundle;
|
mBundle = bundle;
|
||||||
|
mSysUiSessionId = mRandom.nextInt();
|
||||||
mCallingUid = callingUid;
|
mCallingUid = callingUid;
|
||||||
mCallingPid = callingPid;
|
mCallingPid = callingPid;
|
||||||
mCallingUserId = callingUserId;
|
mCallingUserId = callingUserId;
|
||||||
mModality = modality;
|
mModality = modality;
|
||||||
mRequireConfirmation = requireConfirmation;
|
mRequireConfirmation = requireConfirmation;
|
||||||
|
Slog.d(TAG, "New AuthSession, mSysUiSessionId: " + mSysUiSessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isCrypto() {
|
boolean isCrypto() {
|
||||||
@@ -1457,7 +1461,8 @@ public class BiometricService extends SystemService {
|
|||||||
false /* requireConfirmation */,
|
false /* requireConfirmation */,
|
||||||
mCurrentAuthSession.mUserId,
|
mCurrentAuthSession.mUserId,
|
||||||
mCurrentAuthSession.mOpPackageName,
|
mCurrentAuthSession.mOpPackageName,
|
||||||
mCurrentAuthSession.mSessionId);
|
mCurrentAuthSession.mSessionId,
|
||||||
|
mCurrentAuthSession.mSysUiSessionId);
|
||||||
} else {
|
} else {
|
||||||
mPendingAuthSession.mClientReceiver.onError(modality, error, vendorCode);
|
mPendingAuthSession.mClientReceiver.onError(modality, error, vendorCode);
|
||||||
mPendingAuthSession = null;
|
mPendingAuthSession = null;
|
||||||
@@ -1680,7 +1685,8 @@ public class BiometricService extends SystemService {
|
|||||||
mStatusBarService.showAuthenticationDialog(mCurrentAuthSession.mBundle,
|
mStatusBarService.showAuthenticationDialog(mCurrentAuthSession.mBundle,
|
||||||
mInternalReceiver, modality, requireConfirmation, userId,
|
mInternalReceiver, modality, requireConfirmation, userId,
|
||||||
mCurrentAuthSession.mOpPackageName,
|
mCurrentAuthSession.mOpPackageName,
|
||||||
mCurrentAuthSession.mSessionId);
|
mCurrentAuthSession.mSessionId,
|
||||||
|
mCurrentAuthSession.mSysUiSessionId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "Remote exception", e);
|
Slog.e(TAG, "Remote exception", e);
|
||||||
}
|
}
|
||||||
@@ -1766,7 +1772,8 @@ public class BiometricService extends SystemService {
|
|||||||
false /* requireConfirmation */,
|
false /* requireConfirmation */,
|
||||||
mCurrentAuthSession.mUserId,
|
mCurrentAuthSession.mUserId,
|
||||||
mCurrentAuthSession.mOpPackageName,
|
mCurrentAuthSession.mOpPackageName,
|
||||||
sessionId);
|
sessionId,
|
||||||
|
mCurrentAuthSession.mSysUiSessionId);
|
||||||
} else {
|
} else {
|
||||||
mPendingAuthSession.mState = STATE_AUTH_CALLED;
|
mPendingAuthSession.mState = STATE_AUTH_CALLED;
|
||||||
for (AuthenticatorWrapper authenticator : mAuthenticators) {
|
for (AuthenticatorWrapper authenticator : mAuthenticators) {
|
||||||
|
|||||||
@@ -665,12 +665,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
|
||||||
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
int biometricModality, boolean requireConfirmation, int userId, String opPackageName,
|
||||||
long operationId) {
|
long operationId, int sysUiSessionId) {
|
||||||
enforceBiometricDialog();
|
enforceBiometricDialog();
|
||||||
if (mBar != null) {
|
if (mBar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showAuthenticationDialog(bundle, receiver, biometricModality,
|
mBar.showAuthenticationDialog(bundle, receiver, biometricModality,
|
||||||
requireConfirmation, userId, opPackageName, operationId);
|
requireConfirmation, userId, opPackageName, operationId, sysUiSessionId);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -269,7 +270,8 @@ public class BiometricServiceTest {
|
|||||||
eq(false) /* requireConfirmation */,
|
eq(false) /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -407,7 +409,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
|
|
||||||
// Hardware authenticated
|
// Hardware authenticated
|
||||||
final byte[] HAT = generateRandomHAT();
|
final byte[] HAT = generateRandomHAT();
|
||||||
@@ -462,7 +465,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -610,7 +614,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
anyString(),
|
anyString(),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -711,7 +716,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -1207,7 +1213,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
|
|
||||||
// Requesting strong and credential, when credential is setup
|
// Requesting strong and credential, when credential is setup
|
||||||
resetReceiver();
|
resetReceiver();
|
||||||
@@ -1227,7 +1234,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
|
|
||||||
// Un-downgrading the authenticator allows successful strong auth
|
// Un-downgrading the authenticator allows successful strong auth
|
||||||
for (BiometricService.AuthenticatorWrapper wrapper : mBiometricService.mAuthenticators) {
|
for (BiometricService.AuthenticatorWrapper wrapper : mBiometricService.mAuthenticators) {
|
||||||
@@ -1250,7 +1258,8 @@ public class BiometricServiceTest {
|
|||||||
anyBoolean() /* requireConfirmation */,
|
anyBoolean() /* requireConfirmation */,
|
||||||
anyInt() /* userId */,
|
anyInt() /* userId */,
|
||||||
eq(TEST_PACKAGE_NAME),
|
eq(TEST_PACKAGE_NAME),
|
||||||
anyLong() /* sessionId */);
|
anyLong() /* sessionId */,
|
||||||
|
anyInt() /* sysUiSessionId */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test(expected = IllegalStateException.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user