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
This commit is contained in:
Bruno Martins
2019-01-27 00:52:09 +00:00
committed by Michael Bestas
parent dc5d872a2f
commit a7d159461d

View File

@@ -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;