Switch from PACKAGE_REPLACED to MY_PACKAGE_REPLACED

As part of the Oreo 'no more implicit intents' thing
This commit is contained in:
Moxie Marlinspike 2017-11-26 20:21:29 -08:00
parent c8104a91a4
commit d5cb804f90
2 changed files with 2 additions and 2 deletions

View File

@ -563,7 +563,7 @@
<receiver android:name=".ExperienceUpgradeActivity$AppUpgradeReceiver"> <receiver android:name=".ExperienceUpgradeActivity$AppUpgradeReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"/> <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<data android:scheme="package" /> <data android:scheme="package" />
</intent-filter> </intent-filter>

View File

@ -222,7 +222,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
public static class AppUpgradeReceiver extends BroadcastReceiver { public static class AppUpgradeReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction()) && if (Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction()) &&
intent.getData().getSchemeSpecificPart().equals(context.getPackageName())) intent.getData().getSchemeSpecificPart().equals(context.getPackageName()))
{ {
Optional<ExperienceUpgrade> experienceUpgrade = getExperienceUpgrade(context); Optional<ExperienceUpgrade> experienceUpgrade = getExperienceUpgrade(context);