Skip to content

Commit da6e345

Browse files
authored
Merge pull request #32 from PureSwift/feature/6.3-fixes
Add support for Swift 6.3
2 parents 020d51f + f7e5fc5 commit da6e345

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Sources/AndroidBinder/Parcel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public extension Parcel {
132132
* \param length number of bytes to marshal, or nil to marshal from \p start to end.
133133
* \return the marshaled bytes.
134134
*/
135+
@available(Android 33, *)
135136
func marshal(start: Int = 0, length: Int? = nil) throws(AndroidBinderError) -> [UInt8] {
136137
let len = length ?? (dataSize - start)
137138
var buffer = [UInt8](repeating: 0, count: len)
@@ -148,6 +149,7 @@ public extension Parcel {
148149
*
149150
* \param data the bytes to unmarshal.
150151
*/
152+
@available(Android 33, *)
151153
func unmarshal(_ data: [UInt8]) throws(AndroidBinderError) {
152154
if let base = data.withUnsafeBufferPointer({ $0.baseAddress }) {
153155
try handle.unmarshal(base, length: data.count).get()
@@ -671,6 +673,7 @@ internal extension Parcel.Handle {
671673
*
672674
* Available since API level 33.
673675
*/
676+
@available(Android 33, *)
674677
func marshal(into buffer: UnsafeMutablePointer<UInt8>, start: Int, length: Int) -> Result<Void, AndroidBinderError> {
675678
AParcel_marshal(pointer, buffer, start, length).mapError()
676679
}
@@ -680,6 +683,7 @@ internal extension Parcel.Handle {
680683
*
681684
* Available since API level 33.
682685
*/
686+
@available(Android 33, *)
683687
func unmarshal(_ data: UnsafePointer<UInt8>, length: Int) -> Result<Void, AndroidBinderError> {
684688
AParcel_unmarshal(pointer, data, length).mapError()
685689
}

Sources/AndroidHardware/Sensor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public extension Sensor {
8282
}
8383

8484
/// The hardware sensor handle, unique within a device.
85+
@available(Android 29, *)
8586
var handle: Int32 {
8687
ASensor_getHandle(pointer)
8788
}

Sources/AndroidInput/Keycodes.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -748,13 +748,7 @@ public extension KeyCode {
748748

749749
/// Recent Apps key.
750750
static var recentApps: KeyCode { KeyCode(rawValue: AKEYCODE_RECENT_APPS) }
751-
752-
/// Screenshot key.
753-
static var screenshot: KeyCode { KeyCode(rawValue: AKEYCODE_SCREENSHOT) }
754-
755-
/// Emoji Picker key.
756-
static var emojiPicker: KeyCode { KeyCode(rawValue: AKEYCODE_EMOJI_PICKER) }
757-
751+
758752
// MARK: System Navigation Gestures
759753

760754
/// System Navigation Up key.

Sources/AndroidManifest/PermissionCheck.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public extension Permission {
5353
/// - pid: Process ID to evaluate. Defaults to the current process ID.
5454
/// - uid: User ID to evaluate. Defaults to the current user ID.
5555
/// - Returns: Permission check status.
56+
@available(Android 31, *)
5657
func check(
5758
pid: pid_t = getpid(),
5859
uid: uid_t = getuid()
@@ -67,6 +68,7 @@ public extension Permission {
6768
/// - pid: Process ID to evaluate. Defaults to the current process ID.
6869
/// - uid: User ID to evaluate. Defaults to the current user ID.
6970
/// - Returns: Permission check status.
71+
@available(Android 31, *)
7072
internal func _check(
7173
pid: pid_t = getpid(),
7274
uid: uid_t = getuid()
@@ -87,6 +89,7 @@ public extension Permission {
8789
}
8890

8991
/// Returns `true` when this permission is granted for the current process.
92+
@available(Android 31, *)
9093
var isGranted: Bool {
9194
let status = _check()
9295
switch status {

0 commit comments

Comments
 (0)