Add BIND_INCLUDE_CAPABILITIES flag when binding to the service.

This allows headless media applications to access the location if they
have the permission and is needed for AAOS apps in particular.

Bug: 169242810
Bug: 156904507
Test: manual with AAOS Media app
Change-Id: I1196718638fba336a815809578f643814545baf4
This commit is contained in:
Arnaud Berry
2020-09-22 09:45:05 -07:00
parent 8b9d40586b
commit 76724683e3

View File

@@ -185,7 +185,7 @@ public final class MediaBrowser {
boolean bound = false;
try {
bound = mContext.bindService(intent, mServiceConnection,
Context.BIND_AUTO_CREATE);
Context.BIND_AUTO_CREATE | Context.BIND_INCLUDE_CAPABILITIES);
} catch (Exception ex) {
Log.e(TAG, "Failed binding to service " + mServiceComponent);
}