diff --git a/app/build.gradle b/app/build.gradle index 2fc66c3..c07d295 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { applicationId "pakutoma.iijmiocouponwidget" minSdkVersion 21 - versionCode 8 - versionName "2.3 Hotfix 1" + versionCode 9 + versionName "2.3 Hotfix 2" targetSdkVersion 30 } buildTypes { diff --git a/app/src/main/java/pakutoma/iijmiocouponwidget/widget/SwitchWidget.kt b/app/src/main/java/pakutoma/iijmiocouponwidget/widget/SwitchWidget.kt index e62c868..cbf7f6e 100644 --- a/app/src/main/java/pakutoma/iijmiocouponwidget/widget/SwitchWidget.kt +++ b/app/src/main/java/pakutoma/iijmiocouponwidget/widget/SwitchWidget.kt @@ -37,23 +37,25 @@ class SwitchWidget : AppWidgetProvider() { override fun onReceive(context: Context, intent: Intent) { super.onReceive(context, intent) if (intent.action == Intent.ACTION_BOOT_COMPLETED) { + registerNotificationChannel(context) startFetchRemainsService(context) } if(intent.action == Intent.ACTION_MY_PACKAGE_REPLACED) { - registerFetchRemainsJobService(context) registerNotificationChannel(context) + registerFetchRemainsJobService(context) startFetchRemainsService(context) } } override fun onEnabled(context: Context) { super.onEnabled(context) - registerFetchRemainsJobService(context) registerNotificationChannel(context) + registerFetchRemainsJobService(context) } override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { super.onUpdate(context, appWidgetManager, appWidgetIds) + registerNotificationChannel(context) startFetchRemainsService(context) } @@ -71,7 +73,7 @@ class SwitchWidget : AppWidgetProvider() { val channel = NotificationChannel( NOTIFICATION_CHANNEL_ID, context.getString(R.string.switch_service), - NotificationManager.IMPORTANCE_MIN + NotificationManager.IMPORTANCE_LOW ) manager.createNotificationChannel(channel) }