Merge "Don't create external storage dirs for apps with PROPERTY_NO_APP_DATA_STORAGE" into tm-dev
This commit is contained in:
@@ -3742,6 +3742,16 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
Context.APP_OPS_SERVICE);
|
Context.APP_OPS_SERVICE);
|
||||||
appOps.checkPackage(callingUid, callingPkg);
|
appOps.checkPackage(callingUid, callingPkg);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final PackageManager.Property noAppStorageProp = mContext.getPackageManager()
|
||||||
|
.getProperty(PackageManager.PROPERTY_NO_APP_DATA_STORAGE, callingPkg);
|
||||||
|
if (noAppStorageProp != null && noAppStorageProp.getBoolean()) {
|
||||||
|
throw new SecurityException(callingPkg + " should not have " + appPath);
|
||||||
|
}
|
||||||
|
} catch (PackageManager.NameNotFoundException ignore) {
|
||||||
|
// Property not found
|
||||||
|
}
|
||||||
|
|
||||||
File appFile = null;
|
File appFile = null;
|
||||||
try {
|
try {
|
||||||
appFile = new File(appPath).getCanonicalFile();
|
appFile = new File(appPath).getCanonicalFile();
|
||||||
|
|||||||
Reference in New Issue
Block a user