When MediaProvider db gets recreated, all the media content ids
get renumbered. It's possible that when DownloadProvider is
trying to delete an entry, it is holding onto a invalid mediastore
uri. So, don't use linked mediastore uris in DownloadProvider
operations. Also, revoke any prior uri grants of media content from
DownloadStorageProvider.
Bug: 132087334
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
Change-Id: I4885f5a0ae0b3ab660426605a8a43b8c1d66a4c7
- If we do full file decoding, we should not handle orientation by
ourselves.
- If we decode the thumbnail from ExifInterface.getThumbnailBytes()
or MediaMetadataRetriever, we should handle the orientation.
Change-Id: I632b0b0ed41710401192dfb12f407eaf74c480ba
Fix: 130446058
Test: manual
Now that we have LocalCallingIdentity, we can start caching it in
very narrow cases. We must be careful to not cache too long, since
any changes to granted permissions for the UID mean we need to
re-evaluate any cached answers.
The best middle-ground for this in the Q release is to use an active
camera session as a proxy for when we should create a cache object
and then later invalidate it. (It's very unlikely that a user
changes permissions while actively using the camera, and this is
a strong signal that the caller is sensitive to performance.)
Many other sprinkled optimizations to avoid extra binder calls into
the OS, such as aggressively caching VolumeInfo related details.
Track IDs that are owned by each LocalCallingIdentity, to speed up
all future security checks.
Dispatch all change notifications asynchronously, and delay them by
several seconds while the camera is being actively used, to give
more important foreground work a fighting chance. Invalidate
thumbnails asynchronously.
Optimizations to ModernMediaScanner where it's safe to skip the
"reconcile" and "clean" steps when we're focused on a single file
that we successfully scanned.
Local tests show this CL improves performance of a test app that
takes 100 rapid shots by 45%. (All the collective optimizations
done so far this week add up to a 70% improvement.)
Bug: 130758409
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: trivial manifest change
Change-Id: I38cc826af47d41219ef44eae6fbd293caa0c01d5
Also stream known file directly into place instead of doing a lossy
and expensive transcode.
Bug: 131710636
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Icbfe4f79725c705a1197296f1fd4518c0179a9c1
Currently only for the ContextImpl.enforcePermission code paths and only
when 'secure debug_package_permission_check' is set.
This feature is disabled on user-builds.
Test: Enabled permission checking for my app and
- checked runtime permision denial
- permission denial because app is instant
Bug: 111075456
Change-Id: Ib85777db69ee490608e9dac32a3b97971c0ba215
This CL makes it so that UIModeManager will not allow dark mode
to be changed prior to initial setup wizard being completed.
Additionally, it makes it so that when UIModeManager starts it
will try to start in light mode prior to setup wizard completing
regardless of what the backed up value is. We also register for
an observer if when we start UIModeManager we notice that setup
wizard has not run and defer updating dark mode to the true value
until we see that setup wizard completes.
Test: Manual
Bug: 119666724
Change-Id: Ie9cf36c8483d9cdd9e7aadd3aae4cc0ef15e8d45
Re-enables reading settings from device_config.
See: I6b7ab56e4015448ee068deb49e7f6fa133fea53c
Updates tests.
Updates documentation.
Bug: 129934185
Test: atest android.view.textclassifier
Test: (Performance) Test: frameworks/base/apct-tests/perftests/textclassifier/run.sh
Compare performance results with ConfigParser.ENABLE_DEVICE_CONFIG
set to true vs false. Trivial regression recorded i.e. 1.03x.
Test: (Manual) Change flags and see them reflected. e.g.
adb shell cmd device_config put textclassifier system_textclassifier_enabled false
Verify that app no longer uses the OEM TCS but the AOSP TC.
Change-Id: I4c6ff781c97fc2e3d3da55dc49123fa1d759670a
TimeController and QuotaController flags don't have to be changed
atomically with other JobScheduler constants, so it's best to have them
be separate. I think it's best to have the QuotaController constant
change be atomic, which is why the flag is set up as a key/value pair.
Bug: 120793892
Test: atest android.provider.SettingsBackupTest
Test: atest com.android.server.job.controllers.ConnectivityControllerTest
Test: atest com.android.server.job.controllers.QuotaControllerTest
Test: atest com.android.server.job.controllers.StateControllerTest
Test: atest com.android.server.job.controllers.TimeControllerTest
Test: atest CtsJobSchedulerTestCases
Change-Id: I5bf20c37ea87a58bbcf4326f8e81cd6bea0a7c08
As per API feedback in b/126727563, move LOCATION_MODE_ON to SystemApi
instead of deprecated. This is safe as this constant is not used
anywhere yet.
Test: manual
Bug: 126727563
Change-Id: Iddbea546d1585cb8677c4adb97e465d5ac7a76a4
Merged-In: Iddbea546d1585cb8677c4adb97e465d5ac7a76a4
(cherry picked from commit 7449108978)
- When MediaMetadataRetriever can't create the thumbnail of some
HEIF files, attempt decoding it from ExifInterface.
- ImageDecoder can't create the thumbnail with getThumbnailBytes
from ExifInterface in some cases. It will occur DecodeException:
Failed to create image decoder with message 'unimplemented'Input
contained an error. Attempt to decoding the full image in these
cases.
- Use orientation from ExifInterface to transform the thumbnail to
right orientation.
Test: manual
Test: atest ThumbnailUtilsTest
Bug: 130775874
Fix: 130446058
Change-Id: Icd0726ec49fe85651150736199c3caa184fa1a3f
-- Update behavior of DownloadManager.setDestinationUri(),
DownloadManager.setDestinationInExternalPublicDir() and
DownloadManager.addCompletedDownload() based on the latest
storage re-design. Essentially, going forward these APIs
will only allow downloading files into package owned dirs
or the top-level Download dir.
-- Allow some system components to specify
MediaColumns.OWNER_PACKAGE_NAME when inserting items into
MediaProvider.
-- Don't copy DownloadManager.COLUMN_TITLE to MediaProvider.
DownloadProvider and MediaProvider have different constraints
around "title" and there isn't really a need to keep these
in sync.
-- Sanity check file download paths hinted by apps.
-- Remove sandbox related logic in DownloadProvider.
Bug: 120879208
Bug: 128630262
Bug: 130797842
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: If48bc9ecf9ed94412c6c62ce4e5e6a55fff9b789
Adds a small delay to avoid turning off the device if the user
hits the power button right after the device wakes up via a gesture.
Bug: 126560003
Test: Manual
Change-Id: I3116ce98f244e5660573d5fa764a77083aee7fc5
The definitions reference of these constants are moved from
Settings to DeviceConfig. These definitions are @hide and the
usage in the Settings are removed. Thus, remove the definitions
from API level.
Bug: 123167629
Test: make system-api-stubs-docs-update-current-api \
test-api-stubs-docs-update-current-api
Test: atest NetworkStackTests
Change-Id: I28c4bf2c0b72e154cea91d11007a9497c7f21570
This moves everything over to using a shared data class
for Estimates in SettingsLib which will facilitate a cl
that will help ensure greater consistency across
surfaces where battery estimates are shown.
Test: Tests pass
Bug: 124030091
Change-Id: I0b7f1f3a806255ff4804a00e6d90a7846c484484
- Added a new value for config_longPressOnPowerBehavior:
"5" means "launch assist intent"
- Added global settings for power key longpress and "very
long press" (3.5 sec), allowing these functions to be
tweaked at runtime by privileged code
Bug: 130415373
Test: adb shell settings put global power_long_press 5
# ^ set longpress to assist
adb shell settings put global power_very_long_press 1
# ^ set vlongpress to globalactions (so you can still
# power off the device)
Test: atest frameworks/base/core/tests/coretests
Change-Id: Ic611b2850dc98fddd7662d32b0a60ca1e8231efb