Added a receiver to listen to app uninstalls
This commit is contained in:
@@ -110,6 +110,13 @@
|
||||
<action android:name="org.torproject.android.intent.action.STATUS"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!-- broadcast receiver for listening to package uninstalls -->
|
||||
<receiver android:name=".remote.PackageUninstallReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
|
||||
<data android:scheme="package"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!-- singleTop for NFC dispatch, see SecurityTokenOperationActivity -->
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.sufficientlysecure.keychain.remote;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||
|
||||
public class PackageUninstallReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String packageName = intent.getData().getEncodedSchemeSpecificPart();
|
||||
Uri appUri = KeychainContract.ApiApps.buildByPackageNameUri(packageName);
|
||||
context.getContentResolver().delete(appUri, null, null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user