Merge "Avoid NPE when getting last shutdown reason." into oc-dev
am: 0cf6b908a8
Change-Id: Ib31807bddc953d2bba068359c9468257d1b92a9f
This commit is contained in:
@@ -4607,6 +4607,9 @@ public final class PowerManagerService extends SystemService
|
||||
} catch (IOException e) {
|
||||
Slog.e(TAG, "Failed to read last_reboot_reason file", e);
|
||||
}
|
||||
if (line == null) {
|
||||
return PowerManager.SHUTDOWN_REASON_UNKNOWN;
|
||||
}
|
||||
switch (line) {
|
||||
case REASON_SHUTDOWN:
|
||||
return PowerManager.SHUTDOWN_REASON_SHUTDOWN;
|
||||
|
||||
Reference in New Issue
Block a user