diff options
author | cyberta <cyberta@riseup.net> | 2024-01-25 23:41:42 +0000 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2024-01-25 23:41:42 +0000 |
commit | 5bf3f807a4804c18b7dc88e07e4e34ecf0791713 (patch) | |
tree | a092fd4ab72d1a31daa3cc442331cbb05d034ef0 /app/src/test/java/android/content/Intent.java | |
parent | ce8106f60d83ee2a788f1920437a0bbd48d6b15f (diff) | |
parent | e84289ab4380ae61cc9f2a86da9a16d1aae45cbd (diff) |
Merge branch 'post_release_work' into 'master'
post release tweaks and fixes
Closes #9150 and #8983
See merge request leap/bitmask_android!264
Diffstat (limited to 'app/src/test/java/android/content/Intent.java')
-rw-r--r-- | app/src/test/java/android/content/Intent.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/app/src/test/java/android/content/Intent.java b/app/src/test/java/android/content/Intent.java new file mode 100644 index 00000000..92211558 --- /dev/null +++ b/app/src/test/java/android/content/Intent.java @@ -0,0 +1,61 @@ +package android.content; + +import android.os.Bundle; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class Intent { + final String[] action = new String[1]; + final Map<String, Object> fakeExtras = new HashMap<>(); + final List<String> categories = new ArrayList<>(); + + public Intent setAction(String action) { + this.action[0] = action; + return this; + } + + public String getAction() { + return action[0]; + } + + public Intent putExtra(String key, Bundle bundle) { + fakeExtras.put(key, bundle); + return this; + } + + public Bundle getBundleExtra(String key) { + Object o = fakeExtras.get(key); + if (o != null) { + return (Bundle) o; + } + return null; + } + + public Intent putExtra(String key, Parcelable extra) { + fakeExtras.put(key, extra); + return this; + } + + public Parcelable getParcelableExtra(String key) { + Object o = fakeExtras.get(key); + if (o != null) { + return (Parcelable) o; + } + return null; + } + + public Intent addCategory(String key) { + categories.add(key); + return this; + } + + public Set<String> getCategories() { + return new HashSet<>(categories); + } +} |