multiple additions and fixes for the Java APIs

Stuff needed for WhatsApp support
This commit is contained in:
Julian Winkler
2024-06-24 18:44:31 +02:00
committed by Mis012
parent ef77bb287a
commit 3c5a21357d
53 changed files with 357 additions and 43 deletions

View File

@@ -62,6 +62,16 @@ public class BaseBundle {
return mMap.containsKey(key);
}
/**
* Returns the entry with the given key as an object.
*
* @param key a String key
* @return an Object, or null
*/
public Object get(String key) {
return mMap.get(key);
}
/**
* 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
@@ -94,6 +104,17 @@ public class BaseBundle {
return (s == null) ? defaultValue : s;
}
/**
* Returns the value associated with the given key, or 0L if
* no mapping of the desired type exists for the given key.
*
* @param key a String
* @return a long value
*/
public long getLong(String key) {
return getLong(key, 0L);
}
/**
* Returns the value associated with the given key, or defaultValue if
* no mapping of the desired type exists for the given key.

View File

@@ -5,4 +5,8 @@ public class Binder extends IBinder {
public void attachInterface(IInterface owner, String descriptor) {}
public static void flushPendingCommands() {}
public static long clearCallingIdentity() { return 0; }
public static void restoreCallingIdentity(long identityToken) {}
}

View File

@@ -188,16 +188,6 @@ public final class Bundle extends BaseBundle implements Cloneable {
mFdsKnown = true;
}
/**
* Returns the entry with the given key as an object.
*
* @param key a String key
* @return an Object, or null
*/
public Object get(String key) {
return mMap.get(key);
}
/**
* Removes any entry with the given key from the mapping of this Bundle.
*
@@ -752,17 +742,6 @@ public final class Bundle extends BaseBundle implements Cloneable {
}
}
/**
* Returns the value associated with the given key, or 0L if
* no mapping of the desired type exists for the given key.
*
* @param key a String
* @return a long value
*/
public long getLong(String key) {
return getLong(key, 0L);
}
/**
* Returns the value associated with the given key, or 0.0f if
* no mapping of the desired type exists for the given key.

View File

@@ -35,4 +35,8 @@ public class Parcel {
public byte[] marshall() {
return new byte[0];
}
public int dataPosition() {
return 0;
}
}