Skip to content

Commit

Permalink
fix: Android 11で正常に動かない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
pakutoma committed May 1, 2021
1 parent 0d801c5 commit ca36d4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
}
Expand Down

0 comments on commit ca36d4f

Please sign in to comment.