Skip to content

Commit 5e3e27f

Browse files
committed
Simplify notification permission check, drop redundant restorePurchases at bind
hasNotificationPermission() already handles pre-T via short-circuit. onBillingSetupFinished already calls queryExistingPurchases() once the client is ready.
1 parent 373f031 commit 5e3e27f

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

presentation/src/main/java/org/cryptomator/presentation/CryptomatorApp.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class CryptomatorApp : MultiDexApplication(), HasComponent<ApplicationComponent>
133133
Timber.tag("App").i("IAP Billing service connected")
134134
iapBillingServiceBinder = service as IapBillingService.Binder
135135
iapBillingServiceBinder?.init(Companion.applicationContext)
136-
iapBillingServiceBinder?.restorePurchases()
137136
drainPendingProductDetailsCallbacks()
138137
}
139138

presentation/src/main/java/org/cryptomator/presentation/ui/activity/WelcomeActivity.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,7 @@ class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>(ActivityWelcomeBind
197197
if (!this::pagerAdapter.isInitialized) {
198198
return
199199
}
200-
val granted = grantedOverride ?: if (needsNotificationPermission()) {
201-
hasNotificationPermission()
202-
} else {
203-
true
204-
}
200+
val granted = grantedOverride ?: hasNotificationPermission()
205201
pagerAdapter.notificationsFragment?.updatePermissionState(granted)
206202
}
207203

0 commit comments

Comments
 (0)