Merge "Stop invoking secdiscard when deleting password data" into pi-dev
am: 8fa420c261
Change-Id: I73db72842b5b561980aa7ba7c56253c17bec00c5
This commit is contained in:
@@ -185,7 +185,6 @@ interface IStorageManager {
|
|||||||
long getCacheSizeBytes(String volumeUuid, int uid) = 76;
|
long getCacheSizeBytes(String volumeUuid, int uid) = 76;
|
||||||
long getAllocatableBytes(String volumeUuid, int flags, String callingPackage) = 77;
|
long getAllocatableBytes(String volumeUuid, int flags, String callingPackage) = 77;
|
||||||
void allocateBytes(String volumeUuid, long bytes, int flags, String callingPackage) = 78;
|
void allocateBytes(String volumeUuid, long bytes, int flags, String callingPackage) = 78;
|
||||||
void secdiscard(in String path) = 79;
|
void runIdleMaintenance() = 79;
|
||||||
void runIdleMaintenance() = 80;
|
void abortIdleMaintenance() = 80;
|
||||||
void abortIdleMaintenance() = 81;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ import android.os.RemoteException;
|
|||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.ServiceManager.ServiceNotFoundException;
|
import android.os.ServiceManager.ServiceNotFoundException;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
import android.system.Os;
|
import android.system.Os;
|
||||||
@@ -1322,15 +1321,6 @@ public class StorageManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
|
||||||
public void secdiscard(String path) {
|
|
||||||
try {
|
|
||||||
mStorageManager.secdiscard(path);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
throw e.rethrowFromSystemServer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
public static boolean isUserKeyUnlocked(int userId) {
|
public static boolean isUserKeyUnlocked(int userId) {
|
||||||
if (sStorageManager == null) {
|
if (sStorageManager == null) {
|
||||||
|
|||||||
@@ -2583,17 +2583,6 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void secdiscard(String path) {
|
|
||||||
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
|
|
||||||
|
|
||||||
try {
|
|
||||||
mVold.secdiscard(path);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Slog.wtf(TAG, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AppFuseMountScope extends AppFuseBridge.MountScope {
|
class AppFuseMountScope extends AppFuseBridge.MountScope {
|
||||||
boolean opened = false;
|
boolean opened = false;
|
||||||
|
|
||||||
|
|||||||
@@ -495,10 +495,11 @@ class LockSettingsStorage {
|
|||||||
String path = getSynthenticPasswordStateFilePathForUser(userId, handle, name);
|
String path = getSynthenticPasswordStateFilePathForUser(userId, handle, name);
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try (RandomAccessFile raf = new RandomAccessFile(path, "rws")) {
|
||||||
mContext.getSystemService(StorageManager.class).secdiscard(file.getAbsolutePath());
|
final int fileSize = (int) raf.length();
|
||||||
|
raf.write(new byte[fileSize]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Slog.w(TAG, "Failed to secdiscard " + path, e);
|
Slog.w(TAG, "Failed to zeroize " + path, e);
|
||||||
} finally {
|
} finally {
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user