OSDN Git Service

Fix FingerprintService package comparison
authorKevin Chyn <kchyn@google.com>
Wed, 11 Apr 2018 19:28:59 +0000 (12:28 -0700)
committerKevin Chyn <kchyn@google.com>
Wed, 11 Apr 2018 19:28:59 +0000 (12:28 -0700)
Test: manual test following steps b/77633366 comment #4

Change-Id: I623c5bb3bf5af669752deab602a94747277affd4
Fixes: 77633366

services/core/java/com/android/server/fingerprint/FingerprintService.java

index 4e95bdf..4a1beb1 100644 (file)
@@ -230,10 +230,11 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
                 }
                 List<ActivityManager.RunningTaskInfo> runningTasks = mActivityManager.getTasks(1);
                 if (!runningTasks.isEmpty()) {
-                    if (runningTasks.get(0).topActivity.getPackageName()
-                            != mCurrentClient.getOwnerString()) {
+                    final String topPackage = runningTasks.get(0).topActivity.getPackageName();
+                    if (!topPackage.contentEquals(mCurrentClient.getOwnerString())) {
                         mCurrentClient.stop(false /* initiatedByClient */);
-                        Slog.e(TAG, "Stopping background authentication");
+                        Slog.e(TAG, "Stopping background authentication, top: " + topPackage
+                                + " currentClient: " + mCurrentClient.getOwnerString());
                     }
                 }
             } catch (RemoteException e) {