Simplifying some ActivityContext and StateManager methods

> Merging asContext and getContext meethod
> Simplifying some generic declaration in StateManager

Bug: 393703968
Flag: EXEMPT refactor
Test: Compilation
Change-Id: I679ac83e39b2a17f510698db15335aae8f735aad
24 files changed