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

Commit a9f35462 authored by Paul Crowley's avatar Paul Crowley
Browse files

Create String before bundling AsyncTask

We must create the string right away; if we wait then the binary array
might be zeroed out.

Bug: 133215398
Test: per bug, on Crosshatch modified to use FDE.
Change-Id: I7681e5a474d5f32d9a7eb472cecbe6503621d0ef
parent fb9843f8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -886,13 +886,13 @@ public class LockPatternUtils {
            return;
        }

        // TODO(b/120484642): This is a location where we still use a String for vold
        String passwordString = password != null ? new String(password) : null;
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... dummy) {
                IStorageManager storageManager = IStorageManager.Stub.asInterface(service);
                try {
                    // TODO(b/120484642): This is a location where we still use a String for vold
                    String passwordString = password != null ? new String(password) : null;
                    storageManager.changeEncryptionPassword(type, passwordString);
                } catch (RemoteException e) {
                    Log.e(TAG, "Error changing encryption password", e);