In my Android app, I'm catching the PACKAGE_ADDED broadcast:
<receiver android:name=".OnAppInstall">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
My app is only concerned with installation of a specific companion app. The data string in the intent goes: package:com.acme.myapp
. The intent data Uri is an instance of OpaqueUri
; getHost()
, getPath()
, and getQuery()
all return nulls.
Can I somehow make an intent filter that only allows intents for one specific package ID?