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

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

Merge "Fingerprint data is now stored in one of two ways depending on the"

parents 2a5a43d6 7fe2053a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -291,6 +291,16 @@ public class Environment {
        return buildPath(getDataDirectory(), "misc", "profiles", "cur", String.valueOf(userId));
    }

    /** {@hide} */
    public static File getDataVendorCeDirectory(int userId) {
        return buildPath(getDataDirectory(), "vendor_ce", String.valueOf(userId));
    }

    /** {@hide} */
    public static File getDataVendorDeDirectory(int userId) {
        return buildPath(getDataDirectory(), "vendor_de", String.valueOf(userId));
    }

    /** {@hide} */
    public static File getProfileSnapshotPath(String packageName, String codePath) {
        return buildPath(buildPath(getDataDirectory(), "misc", "profiles", "ref", packageName,
+14 −2
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.hardware.fingerprint.IFingerprintService;
import android.hardware.fingerprint.IFingerprintServiceLockoutResetCallback;
import android.hardware.fingerprint.IFingerprintServiceReceiver;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.Environment;
@@ -58,6 +59,7 @@ import android.os.RemoteException;
import android.os.SELinux;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.security.KeyStore;
@@ -1419,8 +1421,17 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
            try {
                userId = getUserOrWorkProfileId(clientPackage, userId);
                if (userId != mCurrentUserId) {
                    final File systemDir = Environment.getUserSystemDirectory(userId);
                    final File fpDir = new File(systemDir, FP_DATA_DIR);
                    File baseDir;
                    if (Build.VERSION.FIRST_SDK_INT <= Build.VERSION_CODES.O_MR1
                            && !SystemProperties.getBoolean(
                                "ro.treble.supports_vendor_data", false)) {
                        // TODO(b/72405644) remove the override when possible.
                        baseDir = Environment.getUserSystemDirectory(userId);
                    } else {
                        baseDir = Environment.getDataVendorDeDirectory(userId);
                    }

                    File fpDir = new File(baseDir, FP_DATA_DIR);
                    if (!fpDir.exists()) {
                        if (!fpDir.mkdir()) {
                            Slog.v(TAG, "Cannot make directory: " + fpDir.getAbsolutePath());
@@ -1434,6 +1445,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
                            return;
                        }
                    }

                    daemon.setActiveGroup(userId, fpDir.getAbsolutePath());
                    mCurrentUserId = userId;
                }