Fix retrieval of instant app cookies from cache

The in-memory cache stores cookies by user-id and package so that
pending persistence can be easily canceled. CTS tests that do "set
cooke -> uninstall pkg -> install pkg -> get cookie" fail on devices
that are fast enough to complete the install within 1 second. This is
because the cache lookup used the package object, which would be
regenerated on install and no longer equal to the old package object.

Changing the look up to package name instead fixes this issue since package
names are stable across installs.

BUG: 110379319
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t
android.appsecurity.cts.InstantCookieHostTest (Reproduced the failed tests before the change, and ensured they now pass).

Change-Id: Ie0138399c715e7a69bea2421fad013559ba75ae3
1 file changed