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

Commit 28cdb9e1 authored by Christopher Tate's avatar Christopher Tate
Browse files

Fix settings restore

Also correct the debug-mode logging of error locations in backup data.
Bug 4914182

Change-Id: Ie7dda0192afa819e42490b7ffd2d3db6f11968f6
parent 40e44467
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -285,7 +285,8 @@ BackupDataReader::ReadNextHeader(bool* done, int* type)
            break;
        }
        default:
            LOGD("Chunk header at %d has invalid type: 0x%08x", (int)m_pos, (int)m_header.type);
            LOGD("Chunk header at %d has invalid type: 0x%08x",
                    (int)(m_pos - sizeof(m_header)), (int)m_header.type);
            m_status = EINVAL;
    }
    
+6 −1
Original line number Diff line number Diff line
@@ -589,7 +589,12 @@ public class SettingsBackupAgent extends BackupAgentHelper {
    private void restoreWifiSupplicant(String filename, BackupDataInput data) {
        byte[] bytes = new byte[data.getDataSize()];
        if (bytes.length <= 0) return;
        try {
            data.readEntityData(bytes, 0, data.getDataSize());
            restoreWifiSupplicant(filename, bytes, bytes.length);
        } catch (IOException e) {
            Log.w(TAG, "Unable to read supplicant data");
        }
    }

    private void restoreWifiSupplicant(String filename, byte[] bytes, int size) {