From a7d159461d38e0b1d798ff48d2de14b78569f512 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sun, 27 Jan 2019 00:52:09 +0000 Subject: [PATCH] LiveDisplayService: Catch NPE before LiveDisplayConfig is initialized * During boot up phase the system is trying to update LiveDisplay tile status based on the applied mode. However, with LiveDisplayConfig not yet initialized this results in a NullPointerException. Address it and fallback to MODE_OFF. Change-Id: I736da21455e74801aae69e16b9e80c8985b83a5a --- .../platform/internal/display/LiveDisplayService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lineage/lib/main/java/org/lineageos/platform/internal/display/LiveDisplayService.java b/lineage/lib/main/java/org/lineageos/platform/internal/display/LiveDisplayService.java index d671dae1..48d8725e 100644 --- a/lineage/lib/main/java/org/lineageos/platform/internal/display/LiveDisplayService.java +++ b/lineage/lib/main/java/org/lineageos/platform/internal/display/LiveDisplayService.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project + * 2019 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -239,7 +240,7 @@ public class LiveDisplayService extends LineageSystemService { @Override public int getMode() { - if (mConfig.hasModeSupport()) { + if (mConfig != null && mConfig.hasModeSupport()) { return mModeObserver.getMode(); } else { return MODE_OFF;