also looking at this
feat(android): the contacts pair in Zig — ratchet 79 → 77
#166
7 files
+974
-3
| @@ -38,6 +38,8 @@ pub const granted: i32 = 0; | ||
| 38 | 38 | |
| 39 | 39 | pub const read_calendar = "android.permission.READ_CALENDAR"; |
| 40 | 40 | pub const write_calendar = "android.permission.WRITE_CALENDAR"; |
| 41 | pub const read_contacts = "android.permission.READ_CONTACTS"; | |
| 42 | pub const write_contacts = "android.permission.WRITE_CONTACTS"; | |
| 41 | 43 | |
| 42 | 44 | /// `activity.checkSelfPermission(permission) == PERMISSION_GRANTED`. |
| 43 | 45 | pub fn isGranted(j: Jni, activity: jobject, permission: [*:0]const u8) !bool { |
| @@ -88,6 +90,8 @@ test "the permission names match Manifest.permission exactly" { | ||
| 88 | 90 | // that is never granted and an action that always rejects. |
| 89 | 91 | try testing.expectEqualStrings("android.permission.READ_CALENDAR", read_calendar); |
| 90 | 92 | try testing.expectEqualStrings("android.permission.WRITE_CALENDAR", write_calendar); |
| 93 | try testing.expectEqualStrings("android.permission.READ_CONTACTS", read_contacts); | |
| 94 | try testing.expectEqualStrings("android.permission.WRITE_CONTACTS", write_contacts); | |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | 97 | test "PERMISSION_GRANTED is zero, and PERMISSION_DENIED is not" { |