diff options
| author | Philip P. Moltmann <moltmann@google.com> | 2016-01-14 14:45:04 -0800 |
|---|---|---|
| committer | Philip P. Moltmann <moltmann@google.com> | 2016-01-14 15:59:44 -0800 |
| commit | cdf2b400349ca22fedfeb5a2deb8a043791b22ef (patch) | |
| tree | b4f87721bc788f5fea633125769176ff7f841ede /core/java/android/printservice/PrintService.java | |
| parent | cde1c2a7174833dc9c73c261ea6d6be9f7a4634b (diff) | |
Enforce non-nullness in PrinterId and exploit it.
Change-Id: Ifdf3b2329548a665d609dd66b738baab5c765b54
Diffstat (limited to 'core/java/android/printservice/PrintService.java')
| -rw-r--r-- | core/java/android/printservice/PrintService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/printservice/PrintService.java b/core/java/android/printservice/PrintService.java index d0037b762560..310449222a0b 100644 --- a/core/java/android/printservice/PrintService.java +++ b/core/java/android/printservice/PrintService.java @@ -30,6 +30,8 @@ import android.print.PrintJobInfo; import android.print.PrinterId; import android.util.Log; +import com.android.internal.util.Preconditions; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -346,6 +348,7 @@ public abstract class PrintService extends Service { */ public final PrinterId generatePrinterId(String localId) { throwIfNotCalledOnMainThread(); + localId = Preconditions.checkNotNull(localId, "localId cannot be null"); return new PrinterId(new ComponentName(getPackageName(), getClass().getName()), localId); } |
