Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1693ba69 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Add logs for controls restore

Bug: 324565837
Test: build
Flag: NA
Change-Id: Ia73597c6f91b6992e5e111023f363ca6b78eb414
parent 9120c0f5
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.Environment
import android.os.ParcelFileDescriptor
import android.os.UserHandle
import android.util.Log
import com.android.app.tracing.traceSection
import com.android.systemui.controls.controller.AuxiliaryPersistenceWrapper
import com.android.systemui.controls.controller.ControlsFavoritePersistenceWrapper
import com.android.systemui.keyguard.domain.backup.KeyguardQuickAffordanceBackupHelper
@@ -119,15 +120,23 @@ open class BackupHelper : BackupAgentHelper() {
    ) : FileBackupHelper(context, *fileNamesAndPostProcess.keys.toTypedArray()) {

        override fun restoreEntity(data: BackupDataInputStream) {
            Log.d(TAG, "Starting restore for ${data.key} for user ${context.userId}")
            val file = Environment.buildPath(context.filesDir, data.key)
            if (file.exists()) {
                Log.w(TAG, "File " + data.key + " already exists. Skipping restore.")
                return
            }
            synchronized(lock) {
                traceSection("File restore: ${data.key}") {
                    super.restoreEntity(data)
                }
                Log.d(TAG, "Finishing restore for ${data.key} for user ${context.userId}. " +
                        "Starting postProcess.")
                traceSection("Postprocess: ${data.key}") {
                    fileNamesAndPostProcess.get(data.key)?.invoke()
                }
                Log.d(TAG, "Finishing postprocess for ${data.key} for user ${context.userId}.")
            }
        }

        override fun performBackup(