From ca36d4fdd816f26b69e7fd25a6c09ad0aedd86d2 Mon Sep 17 00:00:00 2001 From: pakutoma Date: Sun, 2 May 2021 00:49:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Android=2011=E3=81=A7=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E3=81=AB=E5=8B=95=E3=81=8B=E3=81=AA=E3=81=84=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../pakutoma/iijmiocouponwidget/widget/SwitchWidget.kt | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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) }