Skip to content

Commit

Permalink
base: services: add config_fingerprintRemoveClientOnCancel
Browse files Browse the repository at this point in the history
to call removeClient right in cancelAuthentification removing
possible delays when calling stop in startClient

Change-Id: Ia7fc2cb53e8182d0514f4773dfc914770b9ea585
  • Loading branch information
maxwen committed Apr 8, 2017
1 parent 10d5010 commit 4086660
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion core/res/res/values/config.xml
Expand Up @@ -2722,5 +2722,4 @@
<!-- Configuartion to support SIM contact batch operation.-->
<bool name="config_sim_phonebook_batch_operation">true</bool>
<bool name="config_volte_preferred">false</bool>

</resources>
4 changes: 4 additions & 0 deletions core/res/res/values/custom_config.xml
Expand Up @@ -87,6 +87,10 @@
true will use SystemClock.elapsedRealtimeNanos() to set timestamp. -->
<bool name="config_useSystemClockforRotationSensor">false</bool>

<!-- call removeCient in cancelAuthentification after stop to
avoid 3s delay for certain fpc HALs -->
<bool name="config_fingerprintRemoveClientOnCancel">false</bool>

<!-- ######## CAF #########-->
<!-- operator custom sim icon feature -->
<bool name="operator_custom_sim_icon">false</bool>
Expand Down
2 changes: 2 additions & 0 deletions core/res/res/values/custom_symbols.xml
Expand Up @@ -112,6 +112,8 @@
<java-symbol type="integer" name="config_longPressOnMenuBehavior" />

<java-symbol type="bool" name="config_useSystemClockforRotationSensor" />
<java-symbol type="bool" name="config_fingerprintRemoveClientOnCancel" />

<!-- CAF -->
<java-symbol type="string" name="power_key_emergency_number" />
<java-symbol type="integer" name="power_key_hits_emergency" />
Expand Down
Expand Up @@ -121,6 +121,7 @@ private class PerformanceStats {
private ClientMonitor mCurrentClient;
private ClientMonitor mPendingClient;
private PerformanceStats mPerformanceStats;
private boolean mRemoveClientOnCancel;

// Normal fingerprint authentications are tracked by mPerformanceMap.
private HashMap<Integer, PerformanceStats> mPerformanceMap
Expand Down Expand Up @@ -191,6 +192,8 @@ public FingerprintService(Context context) {
mContext.registerReceiver(mLockoutReceiver, new IntentFilter(ACTION_LOCKOUT_RESET),
RESET_FINGERPRINT_LOCKOUT, null /* handler */);
mUserManager = UserManager.get(mContext);
mRemoveClientOnCancel = context.getResources().getBoolean(
com.android.internal.R.bool.config_fingerprintRemoveClientOnCancel);
}

@Override
Expand Down Expand Up @@ -854,6 +857,9 @@ public void run() {
if (client.getToken() == token) {
if (DEBUG) Slog.v(TAG, "stop client " + client.getOwnerString());
client.stop(client.getToken() == token);
if (mRemoveClientOnCancel) {
removeClient(client);
}
} else {
if (DEBUG) Slog.v(TAG, "can't stop client "
+ client.getOwnerString() + " since tokens don't match");
Expand Down

0 comments on commit 4086660

Please sign in to comment.