Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9dd0c5628b
@@ -8396,6 +8396,7 @@ public class PackageParser {
|
||||
PackageInfo pi = generatePackageInfo(p, EmptyArray.INT, flags, 0, 0,
|
||||
Collections.emptySet(), state);
|
||||
pi.applicationInfo.sourceDir = apexFile.getPath();
|
||||
pi.applicationInfo.publicSourceDir = apexFile.getPath();
|
||||
if (apexInfo.isFactory) {
|
||||
pi.applicationInfo.flags |= ApplicationInfo.FLAG_SYSTEM;
|
||||
} else {
|
||||
|
||||
@@ -1032,11 +1032,13 @@ public class UriGrantsManagerService extends IUriGrantsManager.Stub {
|
||||
// must always grant permissions on behalf of someone explicit.
|
||||
final int callingAppId = UserHandle.getAppId(callingUid);
|
||||
if ((callingAppId == SYSTEM_UID) || (callingAppId == ROOT_UID)) {
|
||||
if ("com.android.settings.files".equals(grantUri.uri.getAuthority())) {
|
||||
if ("com.android.settings.files".equals(grantUri.uri.getAuthority())
|
||||
|| "com.android.settings.module_licenses".equals(grantUri.uri.getAuthority())) {
|
||||
// Exempted authority for
|
||||
// 1. cropping user photos and sharing a generated license html
|
||||
// file in Settings app
|
||||
// 2. sharing a generated license html file in TvSettings app
|
||||
// 3. Sharing module license files from Settings app
|
||||
} else {
|
||||
Slog.w(TAG, "For security reasons, the system cannot issue a Uri permission"
|
||||
+ " grant to " + grantUri + "; use startActivityAsCaller() instead");
|
||||
|
||||
Reference in New Issue
Block a user