aboutsummaryrefslogtreecommitdiffstats
path: root/sdk
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-04-13 18:14:10 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-04-14 20:34:59 -0700
commit763e39ad54cc231f10c71722c2024654320e123d (patch)
tree179d4cbdeec0d5c3dd42fac3724c7fb3974dbfc3 /sdk
parent14190e4f00113d7fc69d127259634673c82c5eed (diff)
downloadvendor_cmsdk-763e39ad54cc231f10c71722c2024654320e123d.zip
vendor_cmsdk-763e39ad54cc231f10c71722c2024654320e123d.tar.gz
vendor_cmsdk-763e39ad54cc231f10c71722c2024654320e123d.tar.bz2
livedisplay: Fix error checks when fetching config
Change-Id: I8ba43f32b2c45f626401f3cbc0050bc0593748c8
Diffstat (limited to 'sdk')
-rw-r--r--sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java b/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java
index 0e4f7a1..e75c9d8 100644
--- a/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java
+++ b/sdk/src/java/cyanogenmod/hardware/LiveDisplayManager.java
@@ -127,8 +127,8 @@ public class LiveDisplayManager {
}
sService = getService();
- if (context.getPackageManager().hasSystemFeature(
- CMContextConstants.Features.LIVEDISPLAY) && !checkService()) {
+ if (!context.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.LIVEDISPLAY) || !checkService()) {
throw new RuntimeException("Unable to get LiveDisplayService. The service either" +
" crashed, was not started, or the interface has been called to early in" +
" SystemServer init");
@@ -136,6 +136,9 @@ public class LiveDisplayManager {
try {
mConfig = sService.getConfig();
+ if (mConfig == null) {
+ throw new RuntimeException("Unable to get LiveDisplay configuration!");
+ }
} catch (RemoteException e) {
throw new RuntimeException("Unable to fetch LiveDisplay configuration!", e);
}