UnarchivePackageReceiver: Don't check authdata validity
DownloadWorker can now refresh authdata if expired Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -43,12 +43,12 @@ class UnarchivePackageReceiver: BroadcastReceiver() {
|
||||
Log.i(TAG, "Received request to unarchive $packageName")
|
||||
|
||||
AuroraApp.scope.launch(Dispatchers.IO) {
|
||||
if (!authProvider.isSavedAuthDataValid() || !AccountProvider.isLoggedIn(context)) {
|
||||
if (!AccountProvider.isLoggedIn(context)) {
|
||||
Log.e(TAG, "Failed to authenticate user!")
|
||||
with(context.getSystemService<NotificationManager>()!!) {
|
||||
notify(
|
||||
packageName.hashCode(),
|
||||
NotificationUtil.getAuthDataExpiredNotification(context, packageName)
|
||||
NotificationUtil.getUnarchiveAuthNotification(context, packageName)
|
||||
)
|
||||
}
|
||||
return@launch
|
||||
|
||||
@@ -273,7 +273,7 @@ object NotificationUtil {
|
||||
.build()
|
||||
}
|
||||
|
||||
fun getAuthDataExpiredNotification(context: Context, packageName: String): Notification {
|
||||
fun getUnarchiveAuthNotification(context: Context, packageName: String): Notification {
|
||||
return NotificationCompat.Builder(context, Constants.NOTIFICATION_CHANNEL_ACCOUNT)
|
||||
.setSmallIcon(R.drawable.ic_account)
|
||||
.setContentTitle(context.getString(R.string.authentication_required_title))
|
||||
|
||||
Reference in New Issue
Block a user