diff options
author | Clark Scheff <clark@cyngn.com> | 2014-09-12 14:57:11 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2014-09-16 15:06:50 +0000 |
commit | a7c42f3a475f76965bf604f62354d076ef06d318 (patch) | |
tree | e1a29ed5b5b468f5fb6529dec048c9593ee48168 /src | |
parent | 6cef2db2268f2f48ac017554e099380e1cba3136 (diff) | |
download | packages_apps_ThemeChooser-a7c42f3a475f76965bf604f62354d076ef06d318.zip packages_apps_ThemeChooser-a7c42f3a475f76965bf604f62354d076ef06d318.tar.gz packages_apps_ThemeChooser-a7c42f3a475f76965bf604f62354d076ef06d318.tar.bz2 |
Clear out notification on resume
Change-Id: Ibfc42bec92116ffd0569280647cfe887ed508520
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyngn/theme/chooser/AppReceiver.java | 2 | ||||
-rw-r--r-- | src/com/cyngn/theme/chooser/ChooserActivity.java | 6 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/NotificationHelper.java | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/com/cyngn/theme/chooser/AppReceiver.java b/src/com/cyngn/theme/chooser/AppReceiver.java index cddac16..2ef37e1 100644 --- a/src/com/cyngn/theme/chooser/AppReceiver.java +++ b/src/com/cyngn/theme/chooser/AppReceiver.java @@ -35,7 +35,7 @@ public class AppReceiver extends BroadcastReceiver { } } catch (NameNotFoundException e) { } - NotificationHelper.cancelNotificationForPackage(context, pkgName); + NotificationHelper.cancelNotifications(context); } else if (Intent.ACTION_PACKAGE_REPLACED.equals(action)) { try { if (isTheme(context, pkgName)) { diff --git a/src/com/cyngn/theme/chooser/ChooserActivity.java b/src/com/cyngn/theme/chooser/ChooserActivity.java index c89a9d7..0a8e225 100644 --- a/src/com/cyngn/theme/chooser/ChooserActivity.java +++ b/src/com/cyngn/theme/chooser/ChooserActivity.java @@ -52,6 +52,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; +import com.cyngn.theme.util.NotificationHelper; import com.cyngn.theme.util.PreferenceUtils; import com.cyngn.theme.util.TypefaceHelperCache; import com.cyngn.theme.util.Utils; @@ -486,6 +487,8 @@ public class ChooserActivity extends FragmentActivity protected void onResume() { super.onResume(); setCustomBackground(mCustomBackground, mAnimateContentIn); + // clear out any notifications that are being displayed. + NotificationHelper.cancelNotifications(this); mThemeChanging = false; @@ -498,9 +501,6 @@ public class ChooserActivity extends FragmentActivity IntentFilter filter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED); registerReceiver(mWallpaperChangeReceiver, filter); - // clear out the newly installed themes count - PreferenceUtils.setNewlyInstalledThemeCount(this, 0); - // register content observer for changes in installed themes mThemesObserver = new ThemesObserver(new Handler()); getContentResolver().registerContentObserver(ThemesColumns.CONTENT_URI, true, diff --git a/src/com/cyngn/theme/util/NotificationHelper.java b/src/com/cyngn/theme/util/NotificationHelper.java index 1b95e7a..d49a430 100644 --- a/src/com/cyngn/theme/util/NotificationHelper.java +++ b/src/com/cyngn/theme/util/NotificationHelper.java @@ -77,9 +77,10 @@ public class NotificationHelper { PreferenceUtils.setNewlyInstalledThemeCount(context, themeCount); } - public static void cancelNotificationForPackage(Context context, String pkgName) { + public static void cancelNotifications(Context context) { NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - nm.cancel(pkgName.hashCode()); + nm.cancel(NOTIFICATION_ID); + PreferenceUtils.setNewlyInstalledThemeCount(context, 0); } } |