OSDN Git Service

Fix the build failure with enabling DEBUG_PSS
authorXiong Li <xiong.li@sony.com>
Tue, 26 Feb 2019 09:13:54 +0000 (17:13 +0800)
committerXiong Li <xiong.li@sony.com>
Tue, 26 Feb 2019 09:23:23 +0000 (17:23 +0800)
frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:2688:
error: variable pid might not have been initialized
    if (DEBUG_PSS) Slog.d(TAG_PSS, "Skipped pss collection of " + pid +

Bug: None
Test: make -j12
Change-Id: Ib668ba2606348f92239355b04039b45cae025cf3

services/core/java/com/android/server/am/ActivityManagerService.java

index 06d1ca6..a6b622d 100644 (file)
@@ -2653,7 +2653,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                     ProcessRecord proc;
                     int procState;
                     int statType;
-                    int pid;
+                    int pid = -1;
                     long lastPssTime;
                     synchronized (ActivityManagerService.this) {
                         if (mPendingPssProcesses.size() <= 0) {