Loading services/core/java/com/android/server/locksettings/LockSettingsStorage.java +10 −4 Original line number Original line Diff line number Diff line Loading @@ -484,6 +484,7 @@ class LockSettingsStorage { } } public void writeSyntheticPasswordState(int userId, long handle, String name, byte[] data) { public void writeSyntheticPasswordState(int userId, long handle, String name, byte[] data) { ensureSyntheticPasswordDirectoryForUser(userId); writeFile(getSynthenticPasswordStateFilePathForUser(userId, handle, name), data); writeFile(getSynthenticPasswordStateFilePathForUser(userId, handle, name), data); } } Loading Loading @@ -541,14 +542,19 @@ class LockSettingsStorage { return new File(Environment.getDataSystemDeDirectory(userId) ,SYNTHETIC_PASSWORD_DIRECTORY); return new File(Environment.getDataSystemDeDirectory(userId) ,SYNTHETIC_PASSWORD_DIRECTORY); } } @VisibleForTesting /** Ensure per-user directory for synthetic password state exists */ protected String getSynthenticPasswordStateFilePathForUser(int userId, long handle, private void ensureSyntheticPasswordDirectoryForUser(int userId) { String name) { File baseDir = getSyntheticPasswordDirectoryForUser(userId); File baseDir = getSyntheticPasswordDirectoryForUser(userId); String baseName = String.format("%016x.%s", handle, name); if (!baseDir.exists()) { if (!baseDir.exists()) { baseDir.mkdir(); baseDir.mkdir(); } } } @VisibleForTesting protected String getSynthenticPasswordStateFilePathForUser(int userId, long handle, String name) { final File baseDir = getSyntheticPasswordDirectoryForUser(userId); final String baseName = String.format("%016x.%s", handle, name); return new File(baseDir, baseName).getAbsolutePath(); return new File(baseDir, baseName).getAbsolutePath(); } } Loading Loading
services/core/java/com/android/server/locksettings/LockSettingsStorage.java +10 −4 Original line number Original line Diff line number Diff line Loading @@ -484,6 +484,7 @@ class LockSettingsStorage { } } public void writeSyntheticPasswordState(int userId, long handle, String name, byte[] data) { public void writeSyntheticPasswordState(int userId, long handle, String name, byte[] data) { ensureSyntheticPasswordDirectoryForUser(userId); writeFile(getSynthenticPasswordStateFilePathForUser(userId, handle, name), data); writeFile(getSynthenticPasswordStateFilePathForUser(userId, handle, name), data); } } Loading Loading @@ -541,14 +542,19 @@ class LockSettingsStorage { return new File(Environment.getDataSystemDeDirectory(userId) ,SYNTHETIC_PASSWORD_DIRECTORY); return new File(Environment.getDataSystemDeDirectory(userId) ,SYNTHETIC_PASSWORD_DIRECTORY); } } @VisibleForTesting /** Ensure per-user directory for synthetic password state exists */ protected String getSynthenticPasswordStateFilePathForUser(int userId, long handle, private void ensureSyntheticPasswordDirectoryForUser(int userId) { String name) { File baseDir = getSyntheticPasswordDirectoryForUser(userId); File baseDir = getSyntheticPasswordDirectoryForUser(userId); String baseName = String.format("%016x.%s", handle, name); if (!baseDir.exists()) { if (!baseDir.exists()) { baseDir.mkdir(); baseDir.mkdir(); } } } @VisibleForTesting protected String getSynthenticPasswordStateFilePathForUser(int userId, long handle, String name) { final File baseDir = getSyntheticPasswordDirectoryForUser(userId); final String baseName = String.format("%016x.%s", handle, name); return new File(baseDir, baseName).getAbsolutePath(); return new File(baseDir, baseName).getAbsolutePath(); } } Loading