From 1a9f86dc9d21041f5782e1053f60a0ebe8fced14 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 5 Oct 2012 18:11:36 +0100 Subject: [PATCH] Add broadcast receiver for package installation/removal --- AndroidManifest.xml | 12 +++++++- src/org/fdroid/fdroid/PackageReceiver.java | 32 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/org/fdroid/fdroid/PackageReceiver.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 8d6e789a2..77d4fbfcb 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -77,7 +77,17 @@ + + + + + + + + + + - + \ No newline at end of file diff --git a/src/org/fdroid/fdroid/PackageReceiver.java b/src/org/fdroid/fdroid/PackageReceiver.java new file mode 100644 index 000000000..a7d487715 --- /dev/null +++ b/src/org/fdroid/fdroid/PackageReceiver.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 Ciaran Gultnieks, ciaran@ciarang.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.fdroid.fdroid; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class PackageReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context ctx, Intent intent) { + ((FDroidApp) ctx.getApplicationContext()).invalidateApps(); + } + +}