diff --git a/res/values/strings.xml b/res/values/strings.xml index bd9ae3b3283..432900e03ac 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4057,8 +4057,6 @@ Archived %1$s Restoring failed - - Restored %1$s Restoring %1$s diff --git a/src/com/android/settings/spa/app/appinfo/AppRestoreButton.kt b/src/com/android/settings/spa/app/appinfo/AppRestoreButton.kt index c47fdac7630..6596529812b 100644 --- a/src/com/android/settings/spa/app/appinfo/AppRestoreButton.kt +++ b/src/com/android/settings/spa/app/appinfo/AppRestoreButton.kt @@ -73,12 +73,6 @@ class AppRestoreButton(packageInfoPresenter: PackageInfoPresenter) { ) try { packageInstaller.requestUnarchive(app.packageName, pendingIntent.intentSender) - val appLabel = userPackageManager.getApplicationLabel(app) - Toast.makeText( - context, - context.getString(R.string.restoring_in_progress, appLabel), - Toast.LENGTH_SHORT - ).show() } catch (e: Exception) { Log.e(LOG_TAG, "Request unarchive failed", e) Toast.makeText( @@ -92,23 +86,11 @@ class AppRestoreButton(packageInfoPresenter: PackageInfoPresenter) { private fun onReceive(intent: Intent, app: ApplicationInfo) { when (val unarchiveStatus = intent.getIntExtra(PackageInstaller.EXTRA_UNARCHIVE_STATUS, Int.MIN_VALUE)) { - PackageInstaller.STATUS_PENDING_USER_ACTION -> { - Log.e( - LOG_TAG, - "Request unarchiving failed for $packageName with code $unarchiveStatus" - ) - Toast.makeText( - context, - context.getString(R.string.restoring_failed), - Toast.LENGTH_SHORT - ).show() - } - - PackageInstaller.STATUS_SUCCESS -> { + PackageInstaller.UNARCHIVAL_OK -> { val appLabel = userPackageManager.getApplicationLabel(app) Toast.makeText( context, - context.getString(R.string.restoring_succeeded, appLabel), + context.getString(R.string.restoring_in_progress, appLabel), Toast.LENGTH_SHORT ).show() }