OSDN Git Service

Fix operator precedence bug causing a crash.
authorJim Miller <jaggies@google.com>
Mon, 18 Apr 2016 20:00:40 +0000 (13:00 -0700)
committerJim Miller <jaggies@google.com>
Mon, 18 Apr 2016 21:08:37 +0000 (14:08 -0700)
This fixes a bug where string expression was being evaluated
and then compared to null.  The result is a constant expression
which always passes, resulting in inadvertently accessing the
null variable.

Fixes bug 28237450

Change-Id: I755b4466fd1985bd7f8984c17e06839ac4a30642

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

index 2dafa3e..c770620 100644 (file)
@@ -222,7 +222,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
             removeClient(client);
         }
         if (DEBUG) Slog.v(TAG, "handleError(client="
-                + client != null ? client.getOwnerString() : "null" + ", error = " + error + ")");
+                + (client != null ? client.getOwnerString() : "null") + ", error = " + error + ")");
         // This is the magic code that starts the next client when the old client finishes.
         if (error == FingerprintManager.FINGERPRINT_ERROR_CANCELED) {
             mHandler.removeCallbacks(mResetClientState);