diff options
| author | Eugene Susla <eugenesusla@google.com> | 2017-01-22 13:52:51 -0800 |
|---|---|---|
| committer | Eugene Susla <eugenesusla@google.com> | 2017-02-06 12:50:55 -0800 |
| commit | 6ed45d8cd33c297e608aba94fc1f61dace7a7cca (patch) | |
| tree | 7d62835183a39a490ad2b518b27cdf6c1c232cdf /core/java/android/text/TextUtils.java | |
| parent | 556897f7018e1b231d6200e21dd45657f180a63c (diff) | |
CompanionDeviceManager
This introduces an API for apps that support companion devices to provide a
more streamlined flow for pairing and setting up the device
Bug: 30932767
Test: Using a toy app, invoke the newly introduced API (CompanionDeviceManager),
and go through the flow. Ensure filtering works, and device is returned to
the calling app. Ensure the calling app can pair to the selected device.
Change-Id: I0aeb653afd65e4adead13ea9c7248ec20971b04a
Diffstat (limited to 'core/java/android/text/TextUtils.java')
| -rw-r--r-- | core/java/android/text/TextUtils.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java index bb952ab93077..55aeb1e600a0 100644 --- a/core/java/android/text/TextUtils.java +++ b/core/java/android/text/TextUtils.java @@ -62,6 +62,7 @@ import android.view.View; import com.android.internal.R; import com.android.internal.util.ArrayUtils; +import com.android.internal.util.Preconditions; import java.lang.reflect.Array; import java.util.Iterator; @@ -466,6 +467,16 @@ public class TextUtils { return isEmpty(str) ? null : str; } + /** {@hide} */ + public static String emptyIfNull(@Nullable String str) { + return str == null ? "" : str; + } + + /** {@hide} */ + public static String firstNotEmpty(@Nullable String a, @NonNull String b) { + return !isEmpty(a) ? a : Preconditions.checkStringNotEmpty(b); + } + /** * Returns the length that the specified CharSequence would have if * spaces and ASCII control characters were trimmed from the start and end, |
