Skip to content

Commit 5678689

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Update Darwin availability annotations. (#31249)
* Update Darwin availability annotations. In addition to updating the availability YAML: * Introduces MTR_UNSTABLE_API and uses that for the metadata APIs, which are not ready to ship yet. * Turns off MTR_PER_CONTROLLER_STORAGE_ENABLED for now. * Updates availability on non-generated API bits. * Address review comment
1 parent 8f93258 commit 5678689

12 files changed

+692
-921
lines changed

src/darwin/Framework/CHIP/MTRCluster.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ NS_ASSUME_NONNULL_BEGIN
4444
/**
4545
* The endpoint this cluster lives on.
4646
*/
47-
@property (nonatomic, readonly) NSNumber * endpointID NS_REFINED_FOR_SWIFT MTR_NEWLY_AVAILABLE;
47+
@property (nonatomic, readonly) NSNumber * endpointID NS_REFINED_FOR_SWIFT MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4));
4848
@end
4949

5050
/**
5151
* Base for all MTRBaseCluster* types.
5252
*/
53-
MTR_NEWLY_AVAILABLE
53+
MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4))
5454
@interface MTRGenericBaseCluster : MTRCluster
5555
@end
5656

5757
/**
5858
* Base for all MTRCluster* types.
5959
*/
60-
MTR_NEWLY_AVAILABLE
60+
MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4))
6161
@interface MTRGenericCluster : MTRCluster
6262
/**
6363
* The device this cluster object is associated with.

src/darwin/Framework/CHIP/MTRDefines.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,30 @@
6060

6161
#define MTR_NEWLY_AVAILABLE
6262

63+
#define MTR_UNAVAILABLE NS_UNAVAILABLE MTR_HIDDEN
64+
6365
#if !defined(MTR_ENABLE_PROVISIONAL)
6466
#define MTR_ENABLE_PROVISIONAL 0
6567
#endif
6668

6769
#if MTR_ENABLE_PROVISIONAL
6870
#define MTR_PROVISIONALLY_AVAILABLE MTR_NEWLY_AVAILABLE
6971
#else
70-
#define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE MTR_HIDDEN
72+
#define MTR_PROVISIONALLY_AVAILABLE MTR_UNAVAILABLE
73+
#endif
74+
75+
#if !defined(MTR_ENABLE_UNSTABLE_API)
76+
#define MTR_ENABLE_UNSTABLE_API 0
77+
#endif
78+
79+
#if MTR_ENABLE_UNSTABLE_API
80+
#define MTR_UNSTABLE_API MTR_NEWLY_AVAILABLE
81+
#else
82+
#define MTR_UNSTABLE_API MTR_UNAVAILABLE
7183
#endif
7284

7385
#ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED
74-
#define MTR_PER_CONTROLLER_STORAGE_ENABLED 1
86+
#define MTR_PER_CONTROLLER_STORAGE_ENABLED 0
7587
#endif
7688

7789
#pragma mark - Types

src/darwin/Framework/CHIP/MTRDevice.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
8181
* The controller this device was created for. May return nil if that
8282
* controller has been shut down.
8383
*/
84-
@property (nonatomic, readonly, nullable) MTRDeviceController * deviceController MTR_NEWLY_AVAILABLE;
84+
@property (nonatomic, readonly, nullable) MTRDeviceController * deviceController MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4));
8585

8686
/**
8787
* The node ID of the node this device corresponds to.
8888
*/
89-
@property (nonatomic, readonly, copy) NSNumber * nodeID NS_REFINED_FOR_SWIFT MTR_NEWLY_AVAILABLE;
89+
@property (nonatomic, readonly, copy) NSNumber * nodeID NS_REFINED_FOR_SWIFT MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4));
9090

9191
/**
9292
* Set the delegate to receive asynchronous callbacks about the device.
@@ -189,7 +189,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
189189
expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues
190190
expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval
191191
queue:(dispatch_queue_t)queue
192-
completion:(MTRDeviceResponseHandler)completion MTR_NEWLY_AVAILABLE;
192+
completion:(MTRDeviceResponseHandler)completion MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4));
193193

194194
- (void)invokeCommandWithEndpointID:(NSNumber *)endpointID
195195
clusterID:(NSNumber *)clusterID
@@ -255,22 +255,22 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
255255
* List of all client data types supported
256256
*
257257
*/
258-
- (NSArray *)supportedClientDataClasses MTR_NEWLY_AVAILABLE;
258+
- (NSArray *)supportedClientDataClasses MTR_UNSTABLE_API;
259259

260260
/**
261261
*
262262
* List of all client data keys stored
263263
*
264264
*/
265-
- (NSArray * _Nullable)clientDataKeys MTR_NEWLY_AVAILABLE;
265+
- (NSArray * _Nullable)clientDataKeys MTR_UNSTABLE_API;
266266

267267
/**
268268
*
269269
* Retrieve client metadata for a key, returns nil if no value is set
270270
*
271271
* @param key NSString * for the key to store the value as
272272
*/
273-
- (id<NSSecureCoding> _Nullable)clientDataForKey:(NSString *)key MTR_NEWLY_AVAILABLE;
273+
- (id<NSSecureCoding> _Nullable)clientDataForKey:(NSString *)key MTR_UNSTABLE_API;
274274

275275
/**
276276
*
@@ -279,22 +279,22 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
279279
* @param key NSString * for the key to store the value as
280280
* @param value id <NSSecureCoding> for the value to store
281281
*/
282-
- (void)setClientDataForKey:(NSString *)key value:(id<NSSecureCoding>)value MTR_NEWLY_AVAILABLE;
282+
- (void)setClientDataForKey:(NSString *)key value:(id<NSSecureCoding>)value MTR_UNSTABLE_API;
283283

284284
/**
285285
*
286286
* Remove client metadata for a key.
287287
*
288288
* @param key NSString * for the key to store the value as
289289
*/
290-
- (void)removeClientDataForKey:(NSString *)key MTR_NEWLY_AVAILABLE;
290+
- (void)removeClientDataForKey:(NSString *)key MTR_UNSTABLE_API;
291291

292292
/**
293293
*
294294
* List of all client data keys stored
295295
*
296296
*/
297-
- (NSArray * _Nullable)clientDataKeysForEndpointID:(NSNumber *)endpointID MTR_NEWLY_AVAILABLE;
297+
- (NSArray * _Nullable)clientDataKeysForEndpointID:(NSNumber *)endpointID MTR_UNSTABLE_API;
298298

299299
/**
300300
*
@@ -303,7 +303,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
303303
* @param key NSString * for the key to store the value as
304304
* @param endpointID NSNumber * for the endpoint to associate the metadata with
305305
*/
306-
- (id<NSSecureCoding> _Nullable)clientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID MTR_NEWLY_AVAILABLE;
306+
- (id<NSSecureCoding> _Nullable)clientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID MTR_UNSTABLE_API;
307307

308308
/**
309309
*
@@ -313,7 +313,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
313313
* @param endpointID NSNumber * for the endpoint to associate the metadata with
314314
* @param value id <NSSecureCoding> for the value to store
315315
*/
316-
- (void)setClientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID value:(id<NSSecureCoding>)value MTR_NEWLY_AVAILABLE;
316+
- (void)setClientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID value:(id<NSSecureCoding>)value MTR_UNSTABLE_API;
317317

318318
/**
319319
*
@@ -322,7 +322,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
322322
* @param key NSString * for the key to store the value as
323323
* @param endpointID NSNumber * for the endpoint to associate the metadata with
324324
*/
325-
- (void)removeClientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID MTR_NEWLY_AVAILABLE;
325+
- (void)removeClientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID MTR_UNSTABLE_API;
326326

327327
@end
328328

src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
4040
{{#if (isInConfigList
4141
(concat (asUpperCamelCase cluster preserveAcronyms=true) "::" (asUpperCamelCase command preserveAcronyms=true))
4242
"LegacyCommandsWithOnlyOptionalArguments")}}
43-
{{availability cluster command=command minimalRelease="Future"}}; {{! TODO: Use the right thing here when we know what it's called }}
43+
{{availability cluster command=command minimalRelease="Early 2024"}};
4444
{{else}}
4545
{{availability cluster command=command minimalRelease="First major API revamp"}};
4646
{{/if}}

src/darwin/Framework/CHIP/templates/MTRClusters.zapt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
3535
{{#if (isInConfigList
3636
(concat (asUpperCamelCase cluster preserveAcronyms=true) "::" (asUpperCamelCase command preserveAcronyms=true))
3737
"LegacyCommandsWithOnlyOptionalArguments")}}
38-
{{availability cluster command=command minimalRelease="Future"}}; {{! TODO: Use the right thing here when we know what it's called }}
38+
{{availability cluster command=command minimalRelease="Early 2024"}};
3939
{{else}}
4040
{{availability cluster command=command minimalRelease="First major API revamp"}};
4141
{{/if}}

src/darwin/Framework/CHIP/templates/availability.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -7803,8 +7803,12 @@
78037803
Feature:
78047804
DeadFrontBehavior: DeadFront
78057805

7806-
- release: "Future"
7807-
versions: "future"
7806+
- release: "Early 2024"
7807+
versions:
7808+
iOS: "17.4"
7809+
macOS: "14.4"
7810+
watchOS: "10.4"
7811+
tvOS: "17.4"
78087812
introduced:
78097813
clusters:
78107814
- RVCRunMode
@@ -8524,3 +8528,6 @@
85248528
# as the enum. The old enum name never had the new value name.
85258529
ContentLaunchStatusEnum:
85268530
- URLNotAvailable
8531+
8532+
- release: "Future"
8533+
versions: "future"

0 commit comments

Comments
 (0)