Commit Graph

6781 Commits

Author SHA1 Message Date
Tomoharu Kasahara
a0d0c542b9 Enable phone apps to mute the BLUETOOTH_SCO stream
This change adds support for privileged apps with the MODIFY_PHONE_STATE
permission to mute the bluetooth sco stream using the adjustStreamVolume
method.
The change adds specific handling for BLUETOOTH_SCO as a mutable stream.

Bug: 111195322
Test: Mute works by AudioManager.adjustStreamVolume
 (STREAM_BLUETOOTH_SCO, ADJUST_MUTE, 0)

Change-Id: I932f9e152e9b6df93a749b083a7bcc7e08c2ad70
2019-01-23 09:04:42 +09:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Treehugger Robot
a32f898720 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Treehugger Robot
422fa22456 Merge "Remove ScopedBytes use" 2018-12-09 19:36:28 +00:00
Chong Zhang
317316fb2b Fix ExifInterface for .heic when meta is at the end
available() bytes is counted after the last read position,
after the seek to new position, size should be compared
with the avaliable directly (without adding position).

bug: 120086693
test: Open .heic files in Downloads/Photos that's either
very small (b/117625929, b/111897855), or with the meta
at the very end (b/120086693). There shouldn't be error
in ExifInterface.
Change-Id: I37ac57823b26f03bb0ba555ee6213cf999942d21
2018-11-30 15:37:03 -08:00
Orion Hodson
9b909c3b70 Remove ScopedBytes use
The libnativehelper ScopedBytes class is being deprecated. It's use in
android_media_AudioTrack.cpp is unnecessary because the JNI method
takes a direct buffer as an argument whereas ScopedBytes classes exist
to mask the difference between byte arrays and byte buffers.

Bug: 119840313
Test: m -j32
Change-Id: I2a6478dbaa861c5391cc298871df0f8cd1f1439c
2018-11-27 17:54:05 +00:00
mtk33169
03ae44a8ff The JE about "android.process.media" will pop up when you eject the
SD card after you set SD as internel phone storage

This JE is happening due to null pointer access in makeEntryFor() in
MediaScanner.Java.
Before accessing the cursor, check if cursor is available and not null.
It is a safe check.

Bug: 119392250
Test: manual, ran test 20 times and it passed every times.
Change-Id: I23039281b63a0a6a411860eb5989cf20a5663c8f
2018-11-12 10:49:55 +00:00
Daniel Bonnevier
56a9a6631a Add key for sample rate and bits per sample
Add new keys for sample rate and bits per sample.
This makes it possible to indicate the specification of
the music files on application.

Bug: 112986969
Test: Check if sample rate and bits per sample can be retrieved

Change-Id: Ie5a90800297a0a7c2dd6f3a2bdf9e88c9221bee1
2018-11-02 19:49:48 +09:00
Chong Zhang
6636b0227d Merge "Add keys to retrieve color aspects from metadata" 2018-10-25 02:04:48 +00:00
Toshikazu Saito
26b3de310f Add keys to retrieve color aspects from metadata
Add keys to retrieve color standard, color transfer and color range from
MediaMetadataRetriever.

Bug: 114329709
Test: put hdr/non-hdr contents and check media db

Change-Id: Ifa90f12a572b330f87acd6ef06e1e83ddceb8483
2018-10-23 23:37:31 +00:00
nobuhiko saitou
839cc00889 Color aspects keys information stored database
Add keys for color aspects to VideoColumns in MediaStore.
And standard, transfer and range is stored to database.

Bug: 114329709
Test: put hdr/non-hdr contents and check media db

Change-Id: Id4bf27a35720f5cf5a60f08eb3f30314e1a1a167
2018-10-23 22:03:30 +00:00
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
Treehugger Robot
31bbb473ce Merge "Fix data source for HEIF exif extractor" 2018-10-23 17:36:33 +00:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
Chong Zhang
f2b041dce0 Fix data source for HEIF exif extractor
Do not allow the source to read past available bytes, since
the underlying input stream may not be able to seek after that.

For input streams from files, the available bytes is usually the
file size, and we usually don't have problem when the file is
of decent size. But when the file is very small, some of the
extractors (other than mp4) would request bytes past the end
of the file, which goes over the available range. Once that
condition is hit, we can't reset to the offet needed for
mp4 extractor and heif parsing would fail.

bug: 111897855
bug: 117625929
test: open heic files of various sizes in Files (Downloads) app,
check that ExifInterface shouldn't encounter any exceptions.

Change-Id: I668ff900f4155dc310cb7ea8977bbe091791c5d7
2018-10-22 16:02:33 +00:00
Toshikazu Saito
a74c77991a Change caught exception in MediaScanner when ExifInterface is created
Some HEIF content happens RuntimeException in ExifInterface because
sniff is failed and MediaExtractor is not found. If exception happens,
scanning is aborted. So all contents may not be registered to database
correctly. To avoid that, this fix changes caught exception from
IOException to Exception for creating ExifInterface.

Bug: 117625929
Test: put some HEIF contents and check on photos

Change-Id: I6d32dec27c3be13993ec08f92d567b772d03ace9
2018-10-22 09:25:43 +00:00
weichinweng
c91b0fdfeb Merge "AudioService: Add Hearing Aid Switch Control"
am: f3b7821fbd

Change-Id: I6abbbc268a8c391e2d400e7a9811ea0e04362bfc
2018-10-18 14:18:06 -07:00
weichinweng
c30a3e8d1c AudioService: Add Hearing Aid Switch Control
1) Add setBluetoothHearingAidDeviceConnectionState interface to control
suppressNoisyIntent flag.
2) Add check to confirm the previous device is active or not when want
to clean it.

Bug: 112279820
Test: Build Pass, BT off/on when play A2DP, Switch active device
Change-Id: I73f1236d44213c6cf4a2708f3c96144416cfa67d
2018-10-18 07:28:39 +08:00
Jeff Sharkey
f8ad474935 Merge changes from topic "bugfix_content_path"
am: aa642187cd

Change-Id: Ice15a2cffcaf96a370f8e73ebe0a25bdea67f1c3
2018-10-01 11:25:38 -07:00
nobuhiko saitou
436b7b5634 Add OEM_SOUNDS_DIR variable
Add OEM_SOUNDS_DIR variable
And add judgment of OEM_SOUNDS_DIR in isSystemSoundWithMetadata.

Test: build and check sound like ringtone etc
Bug: 79123178

Change-Id: Ib432910c7a99695e73c88480b7028be1c9d04702
2018-09-20 16:05:54 +09:00
Tomoharu Kasahara
96b6adc014 Merge "Convert AudioAttribute to Stream correctly for TTS"
am: 874e10f4a6

Change-Id: I52a610027d11574ab51cd83683de64ff2dddadfe
2018-09-11 13:35:21 -07:00
Treehugger Robot
874e10f4a6 Merge "Convert AudioAttribute to Stream correctly for TTS" 2018-09-11 19:26:56 +00:00
Tomoharu Kasahara
be0103c0a5 Convert AudioAttribute to Stream correctly for TTS
Add FLAG_BEACON for STREAM_TTS then use it for
conversion from AudioAttribute to stream type.

Bug: 113303490
Test: Use AudioAttributes.toLegacyStreamType

Change-Id: I7fa2b3f095437f8077545d1fff795bb0d8fe6b89
2018-09-11 20:21:59 +09:00
Par-Gunnar Hjalmdahl
96e68bc2e6 Convert AudioAttribute to Stream correctly
When converting an AudioAttribute with FLAG_SCO set, it should
be converted to STREAM_BLUETOOTH_SCO. However, since getFlags()
returns only public flags, and FLAG_SCO isn't public,
the conversion will fail. Change to getAllFlags() to get right
flags.

Bug: 113314374
Test: Use AudioAttributes.toLegacyStreamType

Change-Id: Ic283f055d746d5c3df645dc310c92dac3c80827f
2018-08-28 20:34:01 +09:00
Dongwon Kang
e1b0d4a253 Fix a typo in javadoc.
Test: javadoc fix.
Bug: 112882126
Change-Id: I69f55aaa49103690a796ff394fcd1934891a52f2
2018-08-23 21:14:23 +00:00
Mathew Inwood
49e1c134af resolve merge conflicts of 2382108d01 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I28c80f9ecb1c04a09d1be78503a716d26f66aff4
Merged-In: I3bd40136d7fc948f66eca6b2d139c15e39c5a248
2018-08-20 11:29:16 +01:00
Mathew Inwood
473b9d5bfc Add @UnsupportedAppUsage annotations
For packages:
  android.media.tv
  android.media.soundtrigger
  android.media.session
  android.media.projection
  android.media.midi
  android.media.effect.effects
  android.media.effect
  android.media.browse
  android.media.audiopolicy
  android.media.audiofx
  android.media

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I9b58cb2d1e02d9156a7b0d19c1feff4bcd2c53a9
Merged-In: I3bd40136d7fc948f66eca6b2d139c15e39c5a248
2018-08-17 09:07:01 +01:00
Mathew Inwood
d9b640cbc2 Merge "Code reformatting for upcoming automated code changes."
am: 43f3f60ec0

Change-Id: Id11efe22dffc7edd46d5dc2244b7121f664fba4d
2018-08-16 16:56:06 -07:00
Treehugger Robot
43f3f60ec0 Merge "Code reformatting for upcoming automated code changes." 2018-08-16 07:45:35 +00:00
Mathew Inwood
3ef2a833ba Merge "Add @UnsupportedAppUsage annotations"
am: 9feefd2f5f

Change-Id: Id93bdaf74cf2e9077f3af8367189ae98e8a2f95a
2018-08-15 06:52:39 -07:00
Mathew Inwood
9feefd2f5f Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 11:37:37 +00:00
Gerry Fan
293800c9c9 Merge "Add Nullable to MediaHTTPService's mCookies."
am: 7955aec0ea

Change-Id: Ic2073e516495b37d6e22867180eb687afebaf7f8
2018-08-14 20:19:50 -07:00
gfan
73371d7503 Add Nullable to MediaHTTPService's mCookies.
Bug: 29321867
Test: manually tested with ndk sample native-audio
Change-Id: Ic30fe7c28db0111ee5bcb91b037b7c4536dcfd06
2018-08-14 15:10:49 -07:00
Mathew Inwood
f82c47fc72 Merge "Add @UnsupportedAppUsage annotations" am: 3610ca221d
am: 72667caaa6

Change-Id: Ie078503a741307be16ce19587b6b29cf6fa32d01
2018-08-10 08:29:10 -07:00
Mathew Inwood
d237a74ff4 Add @UnsupportedAppUsage annotations
For packages:
  android.service.wallpaper
  android.service.vr
  android.service.voice
  android.service.trust
  android.service.textservice
  android.service.restrictions
  android.service.resolver
  android.service.quicksettings
  android.service.power
  android.service.pm
  android.service.persistentdata
  android.service.oemlock
  android.service.notification
  android.service.media
  android.service.gatekeeper
  android.service.fingerprint
  android.service.euicc
  android.service.dreams
  android.service.diskstats
  android.service.chooser
  android.service.carrier
  android.service.battery
  android.service.autofill
  android.service.appwidget
  android.service

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I50fb66b55bbc82cc505b483c98f8bd09ae0b5020
Merged-In: I51645d8a8cdce3015749fc27e34830e822ef41ae
2018-08-10 09:58:47 +01:00
Mathew Inwood
c97c5c04f1 Add @UnsupportedAppUsage annotations
For packages:
  android.mtp

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I6af7c9405b0ac3c2d30307dd04d6d330cd22bda4
Merged-In: Id97d70dc1003cd7c6ed585d647bf0df0fd7a946a
2018-08-09 17:29:53 +01:00
Mathew Inwood
a44c098996 Code reformatting for upcoming automated code changes.
Adding annotations to individual fields cannot be easily done when there
are two fields defined in a single statement. Put each definition in a
statement of its own.

See go/UnsupportedAppUsage for more context.

Bug: 110868826
Test: m
Change-Id: I7c521973bd8856414b2d2e39573d887e426c69fc
2018-08-08 15:25:51 +01:00
Robert Shih
deb8dbad23 Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258 am: dccb62bcca am: 64cb4be887
am: c450d1401e

Change-Id: I7aba9ed971773ac2ea8cc7df5fe42ed9c022a5ab
2018-07-16 13:58:38 -07:00
Robert Shih
c450d1401e Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258 am: dccb62bcca
am: 64cb4be887

Change-Id: Id7d4599c5d7d7c803e86afa88be582773c80741f
2018-07-16 13:38:43 -07:00
Robert Shih
64cb4be887 Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258
am: dccb62bcca

Change-Id: I9e6762b25f001e31da7df0bb25984856989b9fd9
2018-07-16 13:13:13 -07:00
Robert Shih
dccb62bcca Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev
am: e43837e258

Change-Id: Ib0ef741f0188ff3e6edc52e20eae997e9dba56e4
2018-07-16 12:51:28 -07:00
Chong Zhang
741bcbee62 Merge "Fix broken javadoc link in MediaFormat" into pi-dev
am: 15ae72085f

Change-Id: Id7af6bea28f60e93ce1a1cce94f053b9484ceb37
2018-07-16 12:25:32 -07:00
Android Build Merger (Role)
7b414ce710 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7 am: 1bce1217ca am: 47c831e675 am: d6143e9307
Change-Id: I67d3d47cf3ba616d8b8d963d7092895621f63200
2018-07-13 06:57:21 +00:00
Android Build Merger (Role)
47c831e675 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7 am: 1bce1217ca
Change-Id: I29f00c9b6dca76c5b780d659d122e08a0d7e581c
2018-07-13 06:57:08 +00:00
Android Build Merger (Role)
1bce1217ca [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7
Change-Id: Ida72e9fed175aa9497af5c5f607640c07cb04cf5
2018-07-13 06:57:02 +00:00
Android Build Merger (Role)
00b57fc9b7 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc
Change-Id: I7ea941c8cffa147d2c6a46f0428899bf001a2672
2018-07-13 06:56:56 +00:00
Robert Shih
0d2dc943dc Fix TrackInfo parcel write
Bug: 77600398
Change-Id: Ia316f1c5dc4879f6851fdb78fe8b9039579be7bc
2018-07-12 23:56:38 -07:00
Chong Zhang
55135d5d5f Fix broken javadoc link in MediaFormat
bug: 74979696
Change-Id: I83965f3d1d395cb0953da9605b27861a1d84cde7
2018-07-09 11:39:35 -07:00