api-impl: add misc APIs needed for AntennaPod

This commit is contained in:
Julian Winkler
2025-02-10 18:19:55 +01:00
parent c7f1e05f5d
commit 1cf48085ff
30 changed files with 223 additions and 44 deletions

View File

@@ -179,6 +179,17 @@ public class BaseBundle {
mMap.put(key, value);
}
/**
* Inserts a long array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null.
*
* @param key a String, or null
* @param value a long array object, or null
*/
public void putLongArray(String key, long[] value) {
mMap.put(key, value);
}
/**
* Inserts a String array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null.
@@ -282,6 +293,27 @@ public class BaseBundle {
return getInt(key, 0);
}
/**
* Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null
* value is explicitly associated with the key.
*
* @param key a String, or null
* @return a long[] value, or null
*/
public long[] getLongArray(String key) {
Object o = mMap.get(key);
if (o == null) {
return null;
}
try {
return (long[])o;
} catch (ClassCastException e) {
typeWarning(key, o, "long[]", e);
return null;
}
}
/**
* Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null