Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SensorKit] Updates for Xcode13 Beta1 #12188

Merged
merged 2 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions src/sensorkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,32 @@ enum SRWristLocation : long
Right,
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum SRKeyboardMetricsSentimentCategory : long
{
Absolutist,
Down,
Death,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a rather depressing enum...

Anxiety,
Anger,
Health,
Positive,
Sad,
LowEnergy,
Confused,
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum SRTextInputSessionType : long
{
Keyboard = 1,
ThirdPartyKeyboard,
Pencil,
Dictation,
}

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[MacCatalyst (14,0)]
Expand Down Expand Up @@ -243,6 +269,14 @@ interface SRApplicationUsage {

[Export ("usageTime")]
double /* NSTimeInterval */ UsageTime { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("reportApplicationIdentifier")]
string ReportApplicationIdentifier { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("textInputSessions", ArgumentSemantic.Copy)]
SRTextInputSession[] TextInputSessions { get; }
}

[NoWatch, NoTV, NoMac]
Expand Down Expand Up @@ -376,6 +410,10 @@ interface SRKeyboardMetrics {
[Export ("height")]
NSMeasurement<NSUnitLength> Height { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("inputModes", ArgumentSemantic.Copy)]
string[] InputModes { get; }

// SRKeyboardMetrics_ScalarMetrics

[Export ("totalWords")]
Expand Down Expand Up @@ -573,6 +611,36 @@ interface SRKeyboardMetrics {

[Export ("deleteToDeletes", ArgumentSemantic.Strong)]
SRKeyboardProbabilityMetric<NSUnitDuration>[] DeleteToDeletes { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("pathTypingSpeed")]
double PathTypingSpeed { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("totalPathPauses")]
nint TotalPathPauses { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("totalPauses")]
nint TotalPauses { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("totalTypingEpisodes")]
nint TotalTypingEpisodes { get; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("typingSpeed")]
double TypingSpeed { get; }

// SRKeyboardMetrics_SentimentCounts

[iOS (15,0), MacCatalyst (15,0)]
[Export ("wordCountForSentimentCategory:")]
nint WordCount (SRKeyboardMetricsSentimentCategory category);

[iOS (15,0), MacCatalyst (15,0)]
[Export ("emojiCountForSentimentCategory:")]
nint EmojiCount (SRKeyboardMetricsSentimentCategory category);
}

[NoWatch, NoTV, NoMac]
Expand Down Expand Up @@ -708,6 +776,14 @@ enum SRSensor {

[Field ("SRSensorKeyboardMetrics")]
KeyboardMetrics,

[iOS (15,0), MacCatalyst (15,0)]
[Field ("SRSensorSiriSpeechMetrics")]
SiriSpeechMetrics,

[iOS (15,0), MacCatalyst (15,0)]
[Field ("SRSensorTelephonySpeechMetrics")]
TelephonySpeechMetrics,
}

[NoWatch, NoTV, NoMac]
Expand Down Expand Up @@ -821,4 +897,15 @@ interface NSString_SRDeletionRecord {
[Export ("sr_sensorForDeletionRecordsFromSensor")]
NSString _GetSensorForDeletionRecordsFromSensor ();
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
interface SRTextInputSession /* privately conforms to NSCoding and NSSecureCoding */
{
[Export ("duration")]
double Duration { get; }

[Export ("sessionType")]
SRTextInputSessionType SessionType { get; }
}
}
2 changes: 2 additions & 0 deletions tests/introspection/iOS/iOSApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ protected override bool Skip (Type type, string protocolName)
case "ARDepthData":
case "ARSkeletonDefinition": // device only
case "NSMergePolicy":
case "SRTextInputSession": // conformance not in headers
return true;
}
break;
Expand Down Expand Up @@ -678,6 +679,7 @@ protected override bool Skip (Type type, string protocolName)
case "ARDepthData":
case "ARSkeletonDefinition": // device only
case "NSMergePolicy":
case "SRTextInputSession": // conformance not in headers
return true;
}
break;
Expand Down
17 changes: 0 additions & 17 deletions tests/xtro-sharpie/MacCatalyst-SensorKit.todo

This file was deleted.

17 changes: 0 additions & 17 deletions tests/xtro-sharpie/iOS-SensorKit.todo

This file was deleted.