livedisplay: Fix error checks when fetching config

Change-Id: I8ba43f32b2c45f626401f3cbc0050bc0593748c8
This commit is contained in:
Steve Kondik 2016-04-13 18:14:10 -07:00 committed by Gerrit Code Review
parent 14190e4f00
commit 763e39ad54

View File

@ -127,8 +127,8 @@ public class LiveDisplayManager {
} }
sService = getService(); sService = getService();
if (context.getPackageManager().hasSystemFeature( if (!context.getPackageManager().hasSystemFeature(
CMContextConstants.Features.LIVEDISPLAY) && !checkService()) { CMContextConstants.Features.LIVEDISPLAY) || !checkService()) {
throw new RuntimeException("Unable to get LiveDisplayService. The service either" + throw new RuntimeException("Unable to get LiveDisplayService. The service either" +
" crashed, was not started, or the interface has been called to early in" + " crashed, was not started, or the interface has been called to early in" +
" SystemServer init"); " SystemServer init");
@ -136,6 +136,9 @@ public class LiveDisplayManager {
try { try {
mConfig = sService.getConfig(); mConfig = sService.getConfig();
if (mConfig == null) {
throw new RuntimeException("Unable to get LiveDisplay configuration!");
}
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Unable to fetch LiveDisplay configuration!", e); throw new RuntimeException("Unable to fetch LiveDisplay configuration!", e);
} }