Revert^2 "Use Collections for empty list return"
This reverts commit a9ddf816f3c3425268bce64493b2dd6144f9e5c2.
Reason for revert: Relanding the feature after proper testing
Delta with original CL is in audio_util/helpers/Util.java
The toMetadataList should return a modifiable list and not an immutable
collection
Bug: 331250048
Bug: 331494257
Test: atest BluetoothInstrumentationTests
Flag: Exempt, code cleanup
Change-Id: I84b1eab66dc7f4da3ef4e65d4bdaa8f5a0f847f9
diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java
index 5823f69..0ec2c6a 100644
--- a/framework/java/android/bluetooth/BluetoothHeadset.java
+++ b/framework/java/android/bluetooth/BluetoothHeadset.java
@@ -38,7 +38,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -496,7 +496,7 @@
Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
}
}
- return new ArrayList<>();
+ return Collections.emptyList();
}
/** {@inheritDoc} */
@@ -518,7 +518,7 @@
Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
}
}
- return new ArrayList<>();
+ return Collections.emptyList();
}
/** {@inheritDoc} */