[ICD] Server side subscription persistence and resumption (#24361)

* [ICD] Server side subscription persistence and resumption

* restyled change

* Correct SimpleSubscriptionResumptionStorage TLV format documentation

* Fix ReadHandler resumption

* Correct state size estimate

* Replace %zu in log format

* Move TLV buffer off stack

* restyled

* Replaced vector with ScopedMemoryBufferWithSize and shim structs

* Fix struct member order

* Fix one more struct member order

* Fixed more stack buffer

* Fix copy/paste bug

* Moved SubscriptionList array to unique_ptr and dynamically allocated / off stack

* Moved SubscriptionIndex array to unique_ptr and dynamically allocated / off stack

* Fixed error condition checks

* Fixed array size check

* Addressed CI issues, and disabled subscription persistence and resumption for cc13x2_26x2 and CYW30739

* Addressed PR review comments, including:

 - ReadHandler constructor side effect moved to separate function
 - SubscriptionList and SubscriptionIndex member initialization moved to runtome
 - Improved error handling - remove stored info on error
 - Changed for loop indices to more descriptive names
 - Disabled feature by default except Linux and Darwin for CI testing
 - Added operator[] getter with index to access SubscriptionList and SubscriptionIndex elements

* Restyled and ReadHandler include

* ReadHandler Callback fix

* Fix ReadHandler Callback const argument

* Explicitly disable subscription persistence and address review comments

* Fixed priming reports on resumption

* Revamp subscription storage into flat structure and add unit test

* Fix unit test build warning and minor PR comment change

* Update src/app/SubscriptionResumptionStorage.h

Co-authored-by: Michael Sandstedt <michael.sandstedt@gmail.com>

* Minor changes to address PR comments

* Address PR review comments:

  Unit test structs constructed explicitly in place for clarity
  IM engine ResumeSubscriptions nullptr check and exit conditions fix

* Address PR comments:

  Nullptr checks
  Minor refactor
  Unit test fix

* Changed storage MaxCount mechanics to Init time clean up

* Clean up comments and unused commented-out old code

* Addressed PR comments:

  Removed AllocatedCount, and made AllocatedSize return count of elements

* Update src/app/SimpleSubscriptionResumptionStorage.cpp

Co-authored-by: Michael Sandstedt <michael.sandstedt@gmail.com>

* Update src/app/InteractionModelEngine.cpp

Co-authored-by: Michael Sandstedt <michael.sandstedt@gmail.com>

* Remove reference to previously removed variable for config that turns the feature off

* Addressed PR comments and enabled chip-tool for testing

  Added setters for SubscriptionInfo attribute and event paths
  Fixed wrong constant
  Enabled server interactions for chiptool

* Changed storage of attribute/event paths to proper List/Structure TLV

* Fixed attribute load

* Make Unit Test names more unique and tighten CHIP_CONFIG_PERSIST_SUBSCRIPTIONS usage

* Addressed PR comments and CI issues:

  Delete() error return clarification
  Comment doc cleanup
  Fix loop variable build warning
  Revert chip-tool server interactions enablement

Co-authored-by: Michael Sandstedt <michael.sandstedt@gmail.com>
diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn
index 83d6c7d..cef97a1 100644
--- a/src/app/BUILD.gn
+++ b/src/app/BUILD.gn
@@ -173,8 +173,11 @@
     "ReadHandler.cpp",
     "RequiredPrivilege.cpp",
     "RequiredPrivilege.h",
+    "SimpleSubscriptionResumptionStorage.cpp",
+    "SimpleSubscriptionResumptionStorage.h",
     "StatusResponse.cpp",
     "StatusResponse.h",
+    "SubscriptionResumptionStorage.h",
     "TimedHandler.cpp",
     "TimedHandler.h",
     "TimedRequest.cpp",