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

Remove various un-necessary code from MTRDevice. #36132

Merged
merged 2 commits into from
Oct 18, 2024

Commits on Oct 18, 2024

  1. Remove various un-necessary code from MTRDevice.

    The _deviceInternalStateChanged declaration was duplicated in
    MTRDevice_Concrete and only needed there.
    
    MTRDeviceClusterData implementation can move into its own file.
    
    setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its
    declaration can move to MTRDevice_Concrete and the unused implementation in
    MTRDevice can be removed.
    
    setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its
    declaration can move to MTRDevice_Concrete and the unused implementation in
    MTRDevice can be removed.
    
    Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData
    on MTRDevice are unused and can be removed.
    
    At this point, _informationalVendorID, _informationalProductID,
    _networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all
    unused on MTRDevice and can be removed.
    
    Now _informationalNumberAtAttributePath is unused on MTRDevice and can be
    removed.
    
    _endpointList is also unused on MTRDevice and can be removed.
    
    deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete,
    so the implementation on MTRDevice can be removed.
    
    unitTestGetClusterDataForPath, unitTestGetPersistedClusters,
    unitTestClusterHasBeenPersisted, unitTestResetSubscription,
    unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData,
    unitTestInjectEventReport, unitTestInjectAttributeReport, and
    unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate
    implementations on MTRDevice can be removed.
    
    At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be
    removed.
    
    Now _getCachedDataVersions is unused on MTRDevice and can be removed.
    
    deviceUsesThread is only used by MTRDeviceController_Concrete on
    MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely.
    Then _deviceUsesThread becomes unused on MTRDevice and can be removed.
    
    Then _clusterDataForPath is unused on MTRDevice and can be removed.
    
    Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be
    removed.
    
    Also, _knownClusters is unused on MTRDevice and can be removed.
    
    setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete
    (which has an MTRDevice_Concrete) and from unit tests (which have an
    MTRDevice_Concrete, though they don't know it), so it can be removed from
    MTRDevice.  Then _resetStorageBehaviorState also becomes unused and can be
    removed.
    
    At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can
    be removed.  This makes _persistClusterDataAsNeeded and _deviceCachePrimed
    unused, and they can also be removed.
    
    At this point, _persistClusterData, _deviceIsReportingExcessively,
    _reportToPersistenceDelayTimeAfterMutiplier,
    _reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and
    _clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be
    removed.
    
    Now _dataStoreExists, _clusterDataToPersistSnapshot,
    _storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier,
    _deviceReportingExcessivelyStartTime, and _persistedClusters are unused on
    MTRDevice and can be removed.
    
    At this point _clusterDataToPersist and _persistedClusterData are unused on
    MTRDevice and can be removed.
    
    _systemTimeChangeObserverToken was never actually used on MTRDevice (it's only
    used on MTRDevice_Concrete) and can be removed.
    
    The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be
    removed.
    
    kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and
    ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed.
    
    assertChipStackLockedByCurrentThread is not used in MTRDevice, so the
    LockTracker.h include can be removed.
    
    MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke,
    MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload,
    are all unused in MTRDevice, so the imports of the corresponding headers can be
    removed.
    
    arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed.
    
    The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete
    and can be removed on both.
    
    _dataValueWithoutDataVersion is unused on MTRDevice and can be removed.
    bzbarsky-apple authored and woody-apple committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    54a3468 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f29ed3 View commit details
    Browse the repository at this point in the history