add Java APIs needed for WhatsApp MainActivity and ConversationActivity

This commit is contained in:
Julian Winkler
2024-08-25 11:20:01 +02:00
parent 9d8e091799
commit c492e1f03f
74 changed files with 903 additions and 69 deletions

View File

@@ -28,10 +28,12 @@ public class Settings {
}
}
public static final class System {
public static final Uri CONTENT_URI = null; // Uri.parse("content://settings/system");
public static final Uri CONTENT_URI = Uri.parse("content://settings/system");
public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor("notification_sound");
public static final Uri DEFAULT_RINGTONE_URI = getUriFor("ringtone");
public static int getInt(ContentResolver cr, String key, int def) {
int ret = getInt(cr, key);
if (ret != -1) {
@@ -54,7 +56,7 @@ public class Settings {
}
public static Uri getUriFor(String name) {
return null;
return Uri.withAppendedPath(CONTENT_URI, name);
}
public static float getFloat(ContentResolver cr, String key, float def) {
@@ -71,6 +73,14 @@ public class Settings {
return def;
}
}
public static float getFloat(ContentResolver cr, String key, float def) {
switch (key) {
default:
java.lang.System.out.println("!!!! Settings$Global.getFloat: unknown key: >" + key + "<");
return def;
}
}
}
public static class SettingNotFoundException extends AndroidException {}