Loading core/java/android/provider/Settings.java +2 −10 Original line number Diff line number Diff line Loading @@ -3419,16 +3419,8 @@ public final class Settings { */ public static final String FONT_SCALE = "font_scale"; private static final Validator FONT_SCALE_VALIDATOR = new Validator() { @Override public boolean validate(@Nullable String value) { try { return Float.parseFloat(value) >= 0; } catch (NumberFormatException | NullPointerException e) { return false; } } }; private static final Validator FONT_SCALE_VALIDATOR = new SettingsValidators.InclusiveFloatRangeValidator(0.85f, 1.3f); /** * The serialized system locale value. Loading core/java/com/android/internal/app/ResolverActivity.java +0 −19 Original line number Diff line number Diff line Loading @@ -1098,25 +1098,6 @@ public class ResolverActivity extends Activity { if (TextUtils.isEmpty(packageName)) { pm.setDefaultBrowserPackageNameAsUser(ri.activityInfo.packageName, userId); } } else { // Update Domain Verification status ComponentName cn = intent.getComponent(); String packageName = cn.getPackageName(); String dataScheme = (data != null) ? data.getScheme() : null; boolean isHttpOrHttps = (dataScheme != null) && (dataScheme.equals(IntentFilter.SCHEME_HTTP) || dataScheme.equals(IntentFilter.SCHEME_HTTPS)); boolean isViewAction = (action != null) && action.equals(Intent.ACTION_VIEW); boolean hasCategoryBrowsable = (categories != null) && categories.contains(Intent.CATEGORY_BROWSABLE); if (isHttpOrHttps && isViewAction && hasCategoryBrowsable) { pm.updateIntentVerificationStatusAsUser(packageName, PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS, userId); } } } else { try { Loading core/java/com/android/internal/content/FileSystemProvider.java +11 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,14 @@ public abstract class FileSystemProvider extends DocumentsProvider { // Default is no-op } /** * Callback indicating that the given document has been deleted or moved. This gives * the provider a hook to revoke the uri permissions. */ protected void onDocIdDeleted(String docId) { // Default is no-op } @Override public boolean onCreate() { throw new UnsupportedOperationException( Loading Loading @@ -278,6 +286,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { final String afterDocId = getDocIdForFile(after); onDocIdChanged(docId); onDocIdDeleted(docId); onDocIdChanged(afterDocId); final File afterVisibleFile = getFileForDocId(afterDocId, true); Loading Loading @@ -307,6 +316,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { final String docId = getDocIdForFile(after); onDocIdChanged(sourceDocumentId); onDocIdDeleted(sourceDocumentId); onDocIdChanged(docId); moveInMediaStore(visibleFileBefore, getFileForDocId(docId, true)); Loading Loading @@ -336,6 +346,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { } onDocIdChanged(docId); onDocIdDeleted(docId); removeFromMediaStore(visibleFile, isDirectory); } Loading packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +6 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,12 @@ public class ExternalStorageProvider extends FileSystemProvider { } } @Override protected void onDocIdDeleted(String docId) { Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, docId); getContext().revokeUriPermission(uri, ~0); } @Override public Cursor queryRoots(String[] projection) throws FileNotFoundException { final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); Loading services/core/java/com/android/server/am/ActivityManagerService.java +59 −58 Original line number Diff line number Diff line Loading @@ -6819,13 +6819,12 @@ public class ActivityManagerService extends IActivityManager.Stub "getContentProviderImpl: after checkContentProviderPermission"); final long origId = Binder.clearCallingIdentity(); try { checkTime(startTime, "getContentProviderImpl: incProviderCountLocked"); // In this case the provider instance already exists, so we can // return it right away. conn = incProviderCountLocked(r, cpr, token, callingUid, callingPackage, callingTag, stable); // Return the provider instance right away since it already exists. conn = incProviderCountLocked(r, cpr, token, callingUid, callingPackage, callingTag, stable); if (conn != null && (conn.stableCount+conn.unstableCount) == 1) { if (cpr.proc != null && r.setAdj <= ProcessList.PERCEPTIBLE_LOW_APP_ADJ) { // If this is a perceptible app accessing the provider, Loading @@ -6847,7 +6846,8 @@ public class ActivityManagerService extends IActivityManager.Stub // it, we will check whether the process still exists. Note that this doesn't // completely get rid of races with LMK killing the process, but should make // them much smaller. if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) { if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) { success = false; } maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name); Loading Loading @@ -6878,9 +6878,10 @@ public class ActivityManagerService extends IActivityManager.Stub } else { cpr.proc.verifiedAdj = cpr.proc.setAdj; } } finally { Binder.restoreCallingIdentity(origId); } } if (!providerRunning) { try { Loading Loading
core/java/android/provider/Settings.java +2 −10 Original line number Diff line number Diff line Loading @@ -3419,16 +3419,8 @@ public final class Settings { */ public static final String FONT_SCALE = "font_scale"; private static final Validator FONT_SCALE_VALIDATOR = new Validator() { @Override public boolean validate(@Nullable String value) { try { return Float.parseFloat(value) >= 0; } catch (NumberFormatException | NullPointerException e) { return false; } } }; private static final Validator FONT_SCALE_VALIDATOR = new SettingsValidators.InclusiveFloatRangeValidator(0.85f, 1.3f); /** * The serialized system locale value. Loading
core/java/com/android/internal/app/ResolverActivity.java +0 −19 Original line number Diff line number Diff line Loading @@ -1098,25 +1098,6 @@ public class ResolverActivity extends Activity { if (TextUtils.isEmpty(packageName)) { pm.setDefaultBrowserPackageNameAsUser(ri.activityInfo.packageName, userId); } } else { // Update Domain Verification status ComponentName cn = intent.getComponent(); String packageName = cn.getPackageName(); String dataScheme = (data != null) ? data.getScheme() : null; boolean isHttpOrHttps = (dataScheme != null) && (dataScheme.equals(IntentFilter.SCHEME_HTTP) || dataScheme.equals(IntentFilter.SCHEME_HTTPS)); boolean isViewAction = (action != null) && action.equals(Intent.ACTION_VIEW); boolean hasCategoryBrowsable = (categories != null) && categories.contains(Intent.CATEGORY_BROWSABLE); if (isHttpOrHttps && isViewAction && hasCategoryBrowsable) { pm.updateIntentVerificationStatusAsUser(packageName, PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS, userId); } } } else { try { Loading
core/java/com/android/internal/content/FileSystemProvider.java +11 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,14 @@ public abstract class FileSystemProvider extends DocumentsProvider { // Default is no-op } /** * Callback indicating that the given document has been deleted or moved. This gives * the provider a hook to revoke the uri permissions. */ protected void onDocIdDeleted(String docId) { // Default is no-op } @Override public boolean onCreate() { throw new UnsupportedOperationException( Loading Loading @@ -278,6 +286,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { final String afterDocId = getDocIdForFile(after); onDocIdChanged(docId); onDocIdDeleted(docId); onDocIdChanged(afterDocId); final File afterVisibleFile = getFileForDocId(afterDocId, true); Loading Loading @@ -307,6 +316,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { final String docId = getDocIdForFile(after); onDocIdChanged(sourceDocumentId); onDocIdDeleted(sourceDocumentId); onDocIdChanged(docId); moveInMediaStore(visibleFileBefore, getFileForDocId(docId, true)); Loading Loading @@ -336,6 +346,7 @@ public abstract class FileSystemProvider extends DocumentsProvider { } onDocIdChanged(docId); onDocIdDeleted(docId); removeFromMediaStore(visibleFile, isDirectory); } Loading
packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +6 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,12 @@ public class ExternalStorageProvider extends FileSystemProvider { } } @Override protected void onDocIdDeleted(String docId) { Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, docId); getContext().revokeUriPermission(uri, ~0); } @Override public Cursor queryRoots(String[] projection) throws FileNotFoundException { final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); Loading
services/core/java/com/android/server/am/ActivityManagerService.java +59 −58 Original line number Diff line number Diff line Loading @@ -6819,13 +6819,12 @@ public class ActivityManagerService extends IActivityManager.Stub "getContentProviderImpl: after checkContentProviderPermission"); final long origId = Binder.clearCallingIdentity(); try { checkTime(startTime, "getContentProviderImpl: incProviderCountLocked"); // In this case the provider instance already exists, so we can // return it right away. conn = incProviderCountLocked(r, cpr, token, callingUid, callingPackage, callingTag, stable); // Return the provider instance right away since it already exists. conn = incProviderCountLocked(r, cpr, token, callingUid, callingPackage, callingTag, stable); if (conn != null && (conn.stableCount+conn.unstableCount) == 1) { if (cpr.proc != null && r.setAdj <= ProcessList.PERCEPTIBLE_LOW_APP_ADJ) { // If this is a perceptible app accessing the provider, Loading @@ -6847,7 +6846,8 @@ public class ActivityManagerService extends IActivityManager.Stub // it, we will check whether the process still exists. Note that this doesn't // completely get rid of races with LMK killing the process, but should make // them much smaller. if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) { if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) { success = false; } maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name); Loading Loading @@ -6878,9 +6878,10 @@ public class ActivityManagerService extends IActivityManager.Stub } else { cpr.proc.verifiedAdj = cpr.proc.setAdj; } } finally { Binder.restoreCallingIdentity(origId); } } if (!providerRunning) { try { Loading