The previous implementation used `pingBinder()` to check the liveness of the PackageManager service on every call to `getPm()`. This polling approach introduces an unnecessary IPC round-trip overhead for every access.
This commit refactors the logic to use the canonical, event-driven pattern for handling remote service death by implementing `linkToDeath`.
A `DeathRecipient` is now registered with the binder upon the first connection. If the service process (`system_server`) dies for any reason, the `binderDied()` callback is automatically invoked by the system. This callback proactively clears the cached service instance, ensuring that the next call to `getPm()` will transparently re-establish a valid connection.