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

Commit ce8ae99c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not initialize the weaver service at boot"

parents e5d8196a 61bd5961
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -852,7 +852,6 @@ public class LockSettingsService extends ILockSettings.Stub {
                .hasSystemFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN);
        migrateOldData();
        getGateKeeperService();
        mSpManager.initWeaverService();
        getAuthSecretHal();
        mDeviceProvisionedObserver.onSystemReady();

+9 −14
Original line number Diff line number Diff line
@@ -510,40 +510,35 @@ class SyntheticPasswordManager {
        return null;
    }

    public synchronized void initWeaverService() {
    private synchronized boolean isWeaverAvailable() {
        if (mWeaver != null) {
            return;
            return true;
        }

        // Re-initialize weaver in case there was a transient error preventing access to it.
        IWeaver weaver = getWeaverService();
        if (weaver == null) {
            return;
            return false;
        }

        // Get the config
        WeaverConfig weaverConfig = null;
        final WeaverConfig weaverConfig;
        try {
            weaverConfig = weaver.getConfig();
        } catch (RemoteException | ServiceSpecificException e) {
            Slog.e(TAG, "Failed to get weaver config", e);
            return false;
        }
        if (weaverConfig == null || weaverConfig.slots <= 0) {
            Slog.e(TAG, "Failed to initialize weaver config");
            return;
            Slog.e(TAG, "Invalid weaver config");
            return false;
        }

        mWeaver = weaver;
        mWeaverConfig = weaverConfig;
        mPasswordSlotManager.refreshActiveSlots(getUsedWeaverSlots());
        Slog.i(TAG, "Weaver service initialized");
    }

    private synchronized boolean isWeaverAvailable() {
        if (mWeaver == null) {
            //Re-initializing weaver in case there was a transient error preventing access to it.
            initWeaverService();
        }
        return mWeaver != null && mWeaverConfig.slots > 0;
        return true;
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -119,6 +119,5 @@ public class MockSyntheticPasswordManager extends SyntheticPasswordManager {

    public void enableWeaver() {
        mWeaverService = new MockWeaverService();
        initWeaverService();
    }
}