Workaround a bug that causes multiple activity instances are created

If Intent A contains both package and component, while Intent B
contains the exact component but without the package, AMS thinks that
they are different and not reusing the existing activity.

Launcher starts app in current user by using startActivity(intent without
package), while CrossProfileAppsService does not.

This bug is tracked in b/64108432. And let's workaround it for now.
There is no harm to not setting package anyway given that the component
is set explicitly.

Fix: 71983351

Test: Manual
1. Start app that integrates with CrossProfileApps API in user 0
2. Start the work profile instance by consuming CrossProfileApps APIs
3. Switch back to user 0 by consuming CrossProfileApps APIs
4. Observe that the same activity instance in #1 is brought up.

Change-Id: I4da6737ed3df589a0acd86ace1a7add3783d4449
2 files changed