diff options
| author | 2018-11-01 12:13:00 -0700 | |
|---|---|---|
| committer | 2018-11-01 13:14:17 -0700 | |
| commit | 926c73479bbf90d0f0b18bbdf8e270cdd1ad578c (patch) | |
| tree | ae2efcc0588b730db7d4bb42ec57e56021233a23 | |
| parent | 2c87f2ead8f92ea571764e7fc5e2ca3b1751c10e (diff) | |
Performs null checks in NanoApp class
Bug: 37274672
Test: Compile only
Change-Id: I5a82edd2f7a99a05c26c72b09872e964dbffd935
| -rw-r--r-- | core/java/android/hardware/location/NanoApp.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/hardware/location/NanoApp.java b/core/java/android/hardware/location/NanoApp.java index ded1bb8c4c44..62e7182a7ccd 100644 --- a/core/java/android/hardware/location/NanoApp.java +++ b/core/java/android/hardware/location/NanoApp.java @@ -20,6 +20,8 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.Log; +import com.android.internal.util.Preconditions; + /** A class describing nano apps. * A nano app is a piece of executable code that can be * downloaded onto a specific architecture. These are targtted @@ -195,10 +197,12 @@ public class NanoApp implements Parcelable { * needed Sensors */ public void setNeededSensors(int[] neededSensors) { + Preconditions.checkNotNull(neededSensors, "neededSensors must not be null"); mNeededSensors = neededSensors; } public void setOutputEvents(int[] outputEvents) { + Preconditions.checkNotNull(outputEvents, "outputEvents must not be null"); mOutputEvents = outputEvents; } @@ -208,10 +212,10 @@ public class NanoApp implements Parcelable { * @param appBinary generated events */ public void setAppBinary(byte[] appBinary) { + Preconditions.checkNotNull(appBinary, "appBinary must not be null"); mAppBinary = appBinary; } - /** * get the publisher name * |