The USB data transfer is disabled we should not allow access MTP devices (e.g.
usb sticks). We have two ways of accessing them: Either by mounting them
or by creating a MTPDevice in an app.
Of course an app could implement implement their own MTPDevice
implementation. In this case we cannot enforce the policy without
completely suppressing all MTP USB devices which would be too
restrictive.
Note: When the policy is set we do _not_ disconnect already connected
MTP devices
Fixes: 31472955
Change-Id: I6080c48c49657102774b2b3b4d89ff030245a266
Always scan notification, ringtones and alarm files under /system
when the build fingerprint has changed since the last scan,
because the dates on those files is not set correctly
(by design), and hence cannot be trusted in the date-based
scanning logic.
Remove some dead code
Bug 30476971
Change-Id: I638c787dc177f7f5fb17c1c2a576be190c1c85f9
FileDescriptor can be natively marshaled, and can be used with both
Java and native code, whereas PFD can not.
Bug: 25945784
Change-Id: I5299f0a1555d3531f7dcf1e23c027fb420dc3569
This method (currently @hide) discards all cached buffers for
the ImageReader, which can be useful to free up memory at the
cost of reallocation time if more buffers are needed later.
It has no effect on acquired Images, filled Images waiting to be
acquired, or buffers being actively used by the source rendering to the
Surface.
Bug: 28695173
Change-Id: I427a8ba4ad73a267083f843dbf228bfc53a730d9
ZenModeHelper was only considering a subset of all notification usage
types. The code was also iterating over the usage values, expecting
them to be contiguous, which will break with the addition of new
usage values.
The update consists in:
- defining in AudioAttributes an array of expected usage types
- defining the suppression behavior for each usage type
- have ZenModeHelper query the behavior for each usage in
order to apply the corresponding muting behavior.
Bug 29009099
Change-Id: If884dda6297f125c60c5775c757df4f782e22e53
This patch adds releasing of MediaScannerConnection in ClientProxy
after disconnecting and releasing of ClientProxy and
IMediaScannerService in disconnection sequence in
MediaScannerConnection.
Bug: 30150344
Change-Id: I1e162e4c9a0b7a741ace20480bcf06f3151a93bf
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.
Bug: 30936376
Change-Id: I115a42601c774062485974042464abb0d65c35e9
(cherry picked from commit a8f9a075b14c526a0de75c2ade81ebc4e05e4ef8)
When the implementation of MediaBrowserService returns null,
ItemCallback.onError was called, but the JavaDoc is saying that
ItemCallback.onItemLoaded can be called with a null result.
This CL makes ItemCallback.onItemLoaded be able to take a null result,
and ItemCallback.onError be called when the implementation doesn't override
the onLoadItem method or when the returned object is not MediaItem.
Bug: 27808084
Change-Id: I97cfd83786f8f857dc9551e5b0a358962f98e4a2
Prevent apps reading the title of null ringtones from getting "Unknown
ringtone" as the title for a silent ringtone
Bug: 31084929
Change-Id: Ie9f84bd279633f065722dbde1fbd66289eaca07b