diff options
| author | Rahul Sabnis <rahulsabnis@google.com> | 2021-06-10 17:28:38 -0700 |
|---|---|---|
| committer | Rahul Sabnis <rahulsabnis@google.com> | 2021-06-14 23:40:27 +0000 |
| commit | 508506d886e5bc53c0b39ffabaaa8d4aa9881551 (patch) | |
| tree | 98d6f93227d30efdce0e8c87d0d19ae5a2561f2e /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 0a67fabedbf8f985ba2c7b85591213a3f053590a (diff) | |
Update nullability checks to use Objects#requireNonNull
instead of deprecated method in Preconditions class
Tag: #feature
Bug: 190767948
Test: Manual
Merged-In: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
Change-Id: Ie7f7282b89c13f587fdfe1bf3288eb4a3c7dcc6e
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 63221c5d89..331fd07a6a 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -17,6 +17,8 @@ package android.bluetooth; +import static java.util.Objects.requireNonNull; + import android.Manifest; import android.annotation.CallbackExecutor; import android.annotation.IntDef; @@ -53,8 +55,6 @@ import android.os.SystemProperties; import android.util.Log; import android.util.Pair; -import com.android.internal.util.Preconditions; - import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -3091,8 +3091,8 @@ public final class BluetoothAdapter { */ WrappedOobDataCallback(@NonNull OobDataCallback callback, @NonNull @CallbackExecutor Executor executor) { - Preconditions.checkNotNull(callback); - Preconditions.checkNotNull(executor); + requireNonNull(callback); + requireNonNull(executor); mCallback = callback; mExecutor = executor; } @@ -3158,7 +3158,7 @@ public final class BluetoothAdapter { != BluetoothDevice.TRANSPORT_LE) { throw new IllegalArgumentException("Invalid transport '" + transport + "'!"); } - Preconditions.checkNotNull(callback); + requireNonNull(callback); if (!isEnabled()) { Log.w(TAG, "generateLocalOobData(): Adapter isn't enabled!"); callback.onError(OOB_ERROR_ADAPTER_DISABLED); @@ -3293,7 +3293,7 @@ public final class BluetoothAdapter { * @hide */ public static boolean isAddressRandomStatic(@NonNull String address) { - Preconditions.checkNotNull(address); + requireNonNull(address); return checkBluetoothAddress(address) && (Integer.parseInt(address.split(":")[5], 16) & 0b11) == 0b11; } |
