You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
api-impl: add misc APIs needed for AntennaPod
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user