@@ -280,8 +280,6 @@ @implementation MTRDevice {
280
280
// _allNetworkFeatures is a bitwise or of the feature maps of all network commissioning clusters
281
281
// present on the device, or nil if there aren't any.
282
282
NSNumber * _Nullable _allNetworkFeatures;
283
- // Most recent entry in _mostRecentReportTimes, if any.
284
- NSDate * _Nullable _mostRecentReportTimeForDescription;
285
283
}
286
284
287
285
- (instancetype )initForSubclassesWithNodeID : (NSNumber *)nodeID controller : (MTRDeviceController *)controller
@@ -297,44 +295,6 @@ - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDe
297
295
return self;
298
296
}
299
297
300
- - (instancetype )initWithNodeID : (NSNumber *)nodeID controller : (MTRDeviceController *)controller
301
- {
302
- if (self = [super init ]) {
303
- _lock = OS_UNFAIR_LOCK_INIT;
304
- _descriptionLock = OS_UNFAIR_LOCK_INIT;
305
- _nodeID = [nodeID copy ];
306
- _fabricIndex = controller.fabricIndex ;
307
- _deviceController = controller;
308
- _queue
309
- = dispatch_queue_create (" org.csa-iot.matter.framework.device.workqueue" , DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL);
310
- _asyncWorkQueue = [[MTRAsyncWorkQueue alloc ] initWithContext: self ];
311
- _state = MTRDeviceStateUnknown;
312
- if (controller.controllerDataStore ) {
313
- _persistedClusterData = [[NSCache alloc ] init ];
314
- } else {
315
- _persistedClusterData = nil ;
316
- }
317
- _clusterDataToPersist = nil ;
318
- _persistedClusters = [NSMutableSet set ];
319
-
320
- // If there is a data store, make sure we have an observer to monitor system clock changes, so
321
- // NSDate-based write coalescing could be reset and not get into a bad state.
322
- if (_persistedClusterData) {
323
- mtr_weakify (self);
324
- _systemTimeChangeObserverToken = [[NSNotificationCenter defaultCenter ] addObserverForName: NSSystemClockDidChangeNotification object: nil queue: nil usingBlock: ^(NSNotification * _Nonnull notification) {
325
- mtr_strongify (self);
326
- std::lock_guard lock (self->_lock );
327
- [self _resetStorageBehaviorState ];
328
- }];
329
- }
330
-
331
- _delegates = [NSMutableSet set ];
332
-
333
- MTR_LOG_DEBUG (" %@ init with hex nodeID 0x%016llX" , self, _nodeID.unsignedLongLongValue );
334
- }
335
- return self;
336
- }
337
-
338
298
- (void )dealloc
339
299
{
340
300
[[NSNotificationCenter defaultCenter ] removeObserver: _systemTimeChangeObserverToken];
@@ -727,16 +687,6 @@ - (void)_persistClusterDataAsNeeded
727
687
_clusterDataPersistenceFirstScheduledTime = nil ;
728
688
}
729
689
730
- #ifdef DEBUG
731
- - (void )unitTestSetMostRecentReportTimes : (NSMutableArray <NSDate *> *)mostRecentReportTimes
732
- {
733
- _mostRecentReportTimes = mostRecentReportTimes;
734
-
735
- std::lock_guard lock (_descriptionLock);
736
- _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject ];
737
- }
738
- #endif
739
-
740
690
- (void )_scheduleClusterDataPersistence
741
691
{
742
692
os_unfair_lock_assert_owner (&self->_lock );
@@ -788,11 +738,6 @@ - (void)_scheduleClusterDataPersistence
788
738
}
789
739
[_mostRecentReportTimes addObject: [NSDate now ]];
790
740
791
- {
792
- std::lock_guard lock (_descriptionLock);
793
- _mostRecentReportTimeForDescription = [_mostRecentReportTimes lastObject ];
794
- }
795
-
796
741
// Calculate running average and update multiplier - need at least 2 items to calculate intervals
797
742
if (_mostRecentReportTimes.count > 2 ) {
798
743
NSTimeInterval cumulativeIntervals = 0 ;
@@ -858,10 +803,6 @@ - (void)_resetStorageBehaviorState
858
803
859
804
_clusterDataPersistenceFirstScheduledTime = nil ;
860
805
_mostRecentReportTimes = nil ;
861
- {
862
- std::lock_guard lock (_descriptionLock);
863
- _mostRecentReportTimeForDescription = nil ;
864
- }
865
806
_deviceReportingExcessivelyStartTime = nil ;
866
807
_reportToPersistenceDelayCurrentMultiplier = 1 ;
867
808
0 commit comments