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

View File

@@ -15,4 +15,8 @@ public class Binder implements IBinder {
@Override
public boolean transact(int code, Parcel data, Parcel reply, int flags) { return false; }
public static int getCallingUid() { return 0; }
public static int getCallingPid() { return 0; }
}

View File

@@ -488,17 +488,6 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
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 float array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null.
@@ -1042,27 +1031,6 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
}
}
/**
* 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

View File

@@ -73,6 +73,9 @@ public final class StrictMode {
public Builder penaltyLog() {
return this;
}
public Builder penaltyDeath() {
return this;
}
public ThreadPolicy build() {
return new ThreadPolicy(mask, listener, executor);
}