setAvrcpAbsoluteVolume is passed wrong unit parameter from AudioManager.
It cause maximize volume in Bluetooth speaker/device.
The volume expected by Bluetooth Avrcp should be from 0 to 15.
But the current volume parameter passed to Bluetooth Avrcp is from 0 to 150.
It is scaled by 10 times than the correct volume.
index = rescaleIndex(index * 10, streamType, streamTypeAlias);
Should divide the volume by 10 before pass to Bluetooth Avrcp.
bug:12495379
Change-Id: I4160588e92ee384e21a75d63036d8bd6ccb30621
(These CLs are already in master.)
Bug: 13246311
This cherry-picks 7 CLs:
-----------------------------------------------------------------------
Remove calls to deprecated SkBitmap::setIsOpaque()
setIsOpaque() has been removed from ToT Skia.
Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.
cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
-----------------------------------------------------------------------
Merge AssetStream with AssetStreamAdaptor.
Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.
The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.
cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56
-----------------------------------------------------------------------
Deprecate Android-specific SkPaint functions.
The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);
Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.
Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08
-----------------------------------------------------------------------
pass SkGlyphCache into updateGlyphCache()
Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.
Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89
-----------------------------------------------------------------------
Updates to the Skia API needed to merge the WebView m33 version of Skia.
cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3
Bugfix for screenshots (recent apps) due to incorrect rowBytes computation
bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714
-----------------------------------------------------------------------
Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.
cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5
-----------------------------------------------------------------------
Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
Keep track of how many clients are requesting scans and scan
continuously until all of them are gone then explicitly terminate the
scan instead of letting it time out as before.
Suspend wifi display scans while connecting or connected to a remote
display. This is handled by both the display manager and media router
since neither has complete information about what is happening.
Much of this code will no longer be needed once wifi display support
is integrated directly into the media router service.
Ensure that we don't attempt to scan or connect to wifi displays
while the wifi display feature is off.
Infer when a connection attempt fails and unselect the wifi display
route automatically so it doesn't appear to be connecting forever.
Fix issues around correctly canceling and retrying connection attempts.
Often we would cancel but not retry.
Improved connection reliability somewhat. It seems that discovery must
already be in progress in order for a connection attempt to succeed.
Ensure QuickSettings uses exactly the same logic as the MediaRouteButton
to determine when the remote display tile should be made visible.
Bug: 11717053
Change-Id: I18afc977b0e8c26204b8c96adaa79f05225f7b6e
Only allow the system ui and settings to connect to a remote display.
To do this, we essentially hide the remote displays from applications
by using the ROUTE_TYPE_REMOTE_DISPLAY then add permission checks
around the operations that connect to them.
As a bonus, this may actually save power on devices since applications
that use MediaRouter will not longer be performing discover on
remote display routes at all.
Bug: 11257292
Change-Id: I9ea8c568df4df5a0f0cf3d0f11b39c87e2110795
A regression was introduced when trying to limit the number of
internal synchronization generation IDs that caused RCC
information to be shown only for applications that requested
audio focus after media button receiver and RCC registration,
(such as Play Music), not for applications that requested focus
first (such as Play Movies).
The correct behavior is to always check and update the
RemoteControllers (seen by MediaFocusControl as RCD interfaces)
whenever a RemoteControlClient is registered (even if it's a
re-registration) when it is associated when an entry at the top
of the remote control stack.
Bug 11657655
Change-Id: I30716e2028f7f718a31e13401b191178735229ff
Hide disabled routes from the chooser.
Fix layout of chooser dialog when the settings button is visible and
the list is very long to prevent truncation of the settings button.
Fix an issue when we fake the route connecting status when a route
is selected. The route changed notification needs to be propagated
to apps. Fake it better.
Immediately disconnect from a route when the connection is lost or
a connection attempt fails. Added a few new test displays for this
case.
Bug: 11257292
Change-Id: I360ab5dc937ad60d97592eab54b19f034519645e
Fixed the Preference ordering code to consider the case where
two preferences might have the same order. In that case, it
falls back on the title to disambiguate. Previous behavior was
undefined (and technically not stable).
Expose the wifi display device address.
Perform wifi display scans every 10 seconds instead of every 15
to improve reponsiveness.
Make sure to define routes for wifi displays that we are connecting
to even if they are not yet paired. Simplified the logic for
adding and removing these routes to avoid possibly getting out
of sync and leaving stale routes behind.
Fix wifi display notification icon.
Bug: 11257292
Change-Id: I8ac15fb17d83758c0bdce80399e12723c367b83c
Port the new style UI back into the framework from the support library.
There are now two dialogs: a chooser and a controller. We use the
same dialogs for selecting routes within app and within quick settings.
Note that the new UI does not support any grouping features since they
are deprecated and unused.
Bug: 11257292
Change-Id: I64e936a18d25ab75f0c470cbc1e7085f67004863
This change adds a new media router service whose purpose is to track
global state information associated with media routes. This service
publishes routes to the media router instance in application processes
and handles requested state changes such as selecting or unselecting
global routes. The service also binds to remote display provider
services which can offer new remote display routes to the system.
Includes a test application for manually verifying certain aspects
of the operation of the media router service.
The remote display provider interface is essentially a stripped down
media route provider interface as defined in the support library
media router implementation. For now, it is designed to be used only
by first parties to publish remote display routes to the system so
it is not exposed as public API in the SDK. In the future, the remote
display provider interface will most likely be deprecated and replaced
with a more featureful media route provider interface for third
party integration, similar to what is in the support library today.
Further patch sets integrate these new capabilities into the System UI
and Settings for connecting remote displays.
Bug: 11257292
Change-Id: I31109f23f17b474d17534d0f5f4503e388b081c2
This interface allows applications to register services that offer
remote displays to the system. The system will then provide UI
to allow user to connect to these displays and enable mirroring.
Bug: 11257292
Change-Id: I34da5b9dfdaf71267bd3450c505bc1b7368d1b40
When A2DP absolute volume is enabled, the music stream
software volume is maxed out because the headset applies
the volume.
We must also max out other streams playing over A2DP otherwise
they are attenuated twice and are barely audible.
Bug: 11316102.
Change-Id: I7e58c74cb683ad1d6f3b68abb0ef967c817fbf4f
State only depends on events from the MediaPlayer (this includes
the pseudo-event from MTP recovery mechanism.)
Change-Id: Idd62a773d2386ad6bfbfe417412c2e2ff09b3600
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 11412881
At the beginning of each song, the Music app re-registers its
media button event and requests audio focus, which causes
the reevaluation of each corresponding stack of clients. Each
reevaluation is accompanied by the incrementation of the
RemoteControlClient generation ID, which causes RemoteController
to issue a notification that the client has changed. The lockscreen
correctly interprets this as a reason to dump the current
RemoteControlClient data (including the artwork) because it will
receive the new data if new one is available. This is what causes
the "flashing" of the wallpaper on the lockscreen: for an instant,
no client data is available.
The fix consists in not causing the client generation ID to be
incremented when registrations don't cause any change in the
RemoteControlClient stack. Even though Music re-registers everything,
nothing has changed: it still is the current media button receiver,
and it still has the same RemoteControlClient.
Bug 11307382
Change-Id: I4d2404b571e88aeedb0eca6bd19d39f7ec4fc8b1
Make sure that caches are cleared at the right times and views have
their data populated correctly. Also fix a caching issue in
RemoteController.
Bug 11218218
Change-Id: Ieb833b5dc440ccd1b82050f12eb7059a4e0a412f
When the user plays media remotely, and presses on the volume
keys with the screen off, verify whether not only local playback
is active, but also if remote playback is active to see if
the volume should be adjusted.
When adjusting the volume with screen off, adjust the remote
volume if applicable.
When controlling volume, give priority to local media playback.
Bug 11169862
Change-Id: I88a8c003969177d50d4c1569ec6cd2a7c153a341
In the RemoteController implementation, the inner class that
implements the IRemoteControlDisplay interface must have a weak
link to the RemoteController instance with which it is associated,
as MediaFocusControl and RemoteControlClient hold a strong
reference to this binder object in a different remote process.
Without a weak reference, any object referencing RemoteController
couldn't be independently garbage collected without a garbage
collection in the remote process.
Bug 8209392
Change-Id: I29e4274c45249b3cb0d3d89417c69e8fe8f62fc4
When a RemoteController listener is disabled: send its listener
"blank" information (no artist, "stopped state"...)
When a RemoteController listener is enabled: have the current
RemoteControlClient send the current information.
Bug 8209392
Change-Id: I375bf3c42a425ada94c61453b51669d7e819dde4
There are interface difference between managed and native side for some
metadata, like Face and JPEG format. we need override them when they are set/get
between native and managed sides.
Also fix some issues in the CameraMetadataTest.
Bug: 10406212
Change-Id: Ibd8be0415968445e711b3ea89f45e1edfa193ee2
Registration of a RemoteController may succeed only if:
- the caller has the MEDIA_CONTENT_CONTROL permission,
- or if the RemoteController.OnClientUpdateListener it
registers if one of the enabled notification listeners.
For using the "enabled notification listener" functionality,
the CL involved:
- making OnClientUpdateListener an interface so a 3rd-party
application may have its implementation extend
NotificationListenerService, which is required for a
listener to be enabled by the user.
- add the concept of "enabled" status in an
IRemoteControlDisplay, so a RemoteController (which
encapsulates the IRemoteControlDisplay implementation)
may be registered, but later temporarily disabled by
the user, as a result of a user action in the security
settings, or a user switch.
- making MediaFocusControl, the component tied to
AudioService, monitor changes in enabled notification
listeners, and act upon enable/disable changes.
Bug 8209392
Change-Id: Ia8dfa2156c65668b2b0d4ae92048005912652d84
DTMF stream must also be muted by silent mode when following ring
stream volume in order to be properly muted and unmuted when ringer
mode changes.
Also fix a problem in VolumeStreamState.setAllIndexes() when some
devices are not present in the stream state from which indexes
are copied.
Bug: 10932676.
Change-Id: I373d0fd1a475980786d97d97348d46a7e7421461
Switch KeyguardTransportControlView over to using RemoteController
instead of the internal API.
Guard transition animations behind a flag until we can work out some
intermittent issues.
Change-Id: Ie9f41339ce6e735c5d524db88437672f2c9859e2
- Rework camera callback binder interface
- Connect up idle, disconnect callbacks
- A few unit tests for shutter firing and idle use
Bug: 10549462
Change-Id: I8455a8a0561e366b7edeef6b101682be2ec44d79
When a wake lock is aquired while executing a binder call and released
in the message handler, AppOps complains about the uid mismatch.
Clear the binder identity before acquiring the wake lock.
Bug: 10627124.
Change-Id: Ibd5babc1ae699bffde1a659562089eb091879106