diff options
author | Steve Kondik <steve@cyngn.com> | 2016-04-25 16:34:21 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-04-26 01:17:30 -0700 |
commit | 35315d3c0f3a04fdcc46619987734cebe3b9ffeb (patch) | |
tree | 324719247126619b3f58d3205a3a070d0a3024c0 /sdk/src | |
parent | c68b38ac3a2d8a2714a5fcf0192956359220159c (diff) | |
download | vendor_cmsdk-35315d3c0f3a04fdcc46619987734cebe3b9ffeb.zip vendor_cmsdk-35315d3c0f3a04fdcc46619987734cebe3b9ffeb.tar.gz vendor_cmsdk-35315d3c0f3a04fdcc46619987734cebe3b9ffeb.tar.bz2 |
cmsdk: Fix crash when getting LiveDisplay config
* If capabilities is empty, BitSet.toLongArray returns an empty array.
Change-Id: I17476438995b581050feda346d0348228519ff44
Diffstat (limited to 'sdk/src')
-rw-r--r-- | sdk/src/java/cyanogenmod/hardware/LiveDisplayConfig.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sdk/src/java/cyanogenmod/hardware/LiveDisplayConfig.java b/sdk/src/java/cyanogenmod/hardware/LiveDisplayConfig.java index 9e499ce..81945f7 100644 --- a/sdk/src/java/cyanogenmod/hardware/LiveDisplayConfig.java +++ b/sdk/src/java/cyanogenmod/hardware/LiveDisplayConfig.java @@ -132,7 +132,8 @@ public class LiveDisplayConfig implements Parcelable { ParcelInfo parcelInfo = Concierge.prepareParcel(out); // ==== FIG ===== - out.writeLong(mCapabilities.toLongArray()[0]); + long[] caps = mCapabilities.toLongArray(); + out.writeLong(caps != null && caps.length > 0 ? caps[0] : 0L); out.writeInt(mDefaultMode); out.writeInt(mDefaultDayTemperature); out.writeInt(mDefaultNightTemperature); |