Loading android/app/AndroidManifest.xml +26 −24 Original line number Diff line number Diff line Loading @@ -269,6 +269,31 @@ </intent-filter> </service> <!-- Message Access Profile (MAP) server Profile Service and owned Provider and Activiie --> <service android:process="@string/process" android:name="com.android.bluetooth.map.BluetoothMapService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothMap"/> <action android:name="android.btmap.intent.action.SHOW_MAPS_SETTINGS"/> <action android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT"/> </intent-filter> </service> <activity android:name="com.android.bluetooth.map.BluetoothMapSettings" android:process="@string/process" android:label="@string/bluetooth_map_settings_title" android:excludeFromRecents="true" android:configChanges="orientation|keyboardHidden" android:enabled="false"> </activity> <provider android:name="com.android.bluetooth.map.MmsFileProvider" android:authorities="com.android.bluetooth.map.MmsFileProvider" android:enabled="false" android:grantUriPermissions="true" android:exported="false"> </provider> <!-- Media Control Profile (MCP) server Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.mcp.McpService" Loading Loading @@ -454,30 +479,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.map.BluetoothMapService" android:enabled="@bool/profile_supported_map" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothMap"/> <action android:name="android.btmap.intent.action.SHOW_MAPS_SETTINGS"/> <action android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT"/> </intent-filter> </service> <activity android:name="com.android.bluetooth.map.BluetoothMapSettings" android:process="@string/process" android:label="@string/bluetooth_map_settings_title" android:excludeFromRecents="true" android:configChanges="orientation|keyboardHidden" android:enabled="@bool/profile_supported_map"> </activity> <provider android:name="com.android.bluetooth.map.MmsFileProvider" android:authorities="com.android.bluetooth.map.MmsFileProvider" android:enabled="true" android:grantUriPermissions="true" android:exported="false"> </provider> <service android:process="@string/process" android:name="com.android.bluetooth.mapclient.MapClientService" android:name=".mapclient.MapClientService" android:enabled="@bool/profile_supported_mapmce" android:exported="true"> <intent-filter> Loading android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ <bool name="profile_supported_pbap">true</bool> <bool name="pbap_include_photos_in_vcard">true</bool> <bool name="pbap_use_profile_for_owner_vcard">true</bool> <bool name="profile_supported_map">true</bool> <bool name="profile_supported_sap">false</bool> <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_mapmce">false</bool> Loading android/app/src/com/android/bluetooth/map/BluetoothMapService.java +18 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.IBluetoothMap; import android.bluetooth.SdpMnsRecord; import android.content.AttributionSource; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -42,6 +43,7 @@ import android.os.Message; import android.os.ParcelUuid; import android.os.PowerManager; import android.os.RemoteException; import android.sysprop.BluetoothProperties; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -77,6 +79,13 @@ public class BluetoothMapService extends ProfileService { public static final boolean VERBOSE = false; /** * The component names for the owned provider and activity */ private static final String MAP_SETTINGS_ACTIVITY = BluetoothMapSettings.class.getCanonicalName(); private static final String MAP_FILE_PROVIDER = MmsFileProvider.class.getCanonicalName(); /** * Intent indicating timeout for user confirmation, which is sent to * BluetoothMapActivity Loading Loading @@ -151,6 +160,10 @@ public class BluetoothMapService extends ProfileService { BluetoothUuid.MAP, BluetoothUuid.MNS, }; public static boolean isEnabled() { return BluetoothProperties.isProfileMapServerEnabled().orElse(false); } public BluetoothMapService() { mState = BluetoothMap.STATE_DISCONNECTED; } Loading Loading @@ -656,6 +669,9 @@ public class BluetoothMapService extends ProfileService { mDatabaseManager = Objects.requireNonNull(AdapterService.getAdapterService().getDatabase(), "DatabaseManager cannot be null when MapService starts"); setComponentAvailable(MAP_SETTINGS_ACTIVITY, true); setComponentAvailable(MAP_FILE_PROVIDER, true); HandlerThread thread = new HandlerThread("BluetoothMapHandler"); thread.start(); Looper looper = thread.getLooper(); Loading Loading @@ -876,6 +892,8 @@ public class BluetoothMapService extends ProfileService { mAppObserver.shutdown(); } sendShutdownMessage(); setComponentAvailable(MAP_SETTINGS_ACTIVITY, false); setComponentAvailable(MAP_FILE_PROVIDER, false); return true; } Loading android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public class BluetoothMapContentObserverTest { public void setUp() { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when BluetoothMapService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)); BluetoothMapService.isEnabled()); } @Test Loading android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class BluetoothMapServiceTest { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when BluetoothMapService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)); BluetoothMapService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading @@ -72,7 +72,7 @@ public class BluetoothMapServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)) { if (!BluetoothMapService.isEnabled()) { return; } TestUtils.stopService(mServiceRule, BluetoothMapService.class); Loading Loading
android/app/AndroidManifest.xml +26 −24 Original line number Diff line number Diff line Loading @@ -269,6 +269,31 @@ </intent-filter> </service> <!-- Message Access Profile (MAP) server Profile Service and owned Provider and Activiie --> <service android:process="@string/process" android:name="com.android.bluetooth.map.BluetoothMapService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothMap"/> <action android:name="android.btmap.intent.action.SHOW_MAPS_SETTINGS"/> <action android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT"/> </intent-filter> </service> <activity android:name="com.android.bluetooth.map.BluetoothMapSettings" android:process="@string/process" android:label="@string/bluetooth_map_settings_title" android:excludeFromRecents="true" android:configChanges="orientation|keyboardHidden" android:enabled="false"> </activity> <provider android:name="com.android.bluetooth.map.MmsFileProvider" android:authorities="com.android.bluetooth.map.MmsFileProvider" android:enabled="false" android:grantUriPermissions="true" android:exported="false"> </provider> <!-- Media Control Profile (MCP) server Profile Service --> <service android:process="@string/process" android:name="com.android.bluetooth.mcp.McpService" Loading Loading @@ -454,30 +479,7 @@ </intent-filter> </service> <service android:process="@string/process" android:name="com.android.bluetooth.map.BluetoothMapService" android:enabled="@bool/profile_supported_map" android:exported="true"> <intent-filter> <action android:name="android.bluetooth.IBluetoothMap"/> <action android:name="android.btmap.intent.action.SHOW_MAPS_SETTINGS"/> <action android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT"/> </intent-filter> </service> <activity android:name="com.android.bluetooth.map.BluetoothMapSettings" android:process="@string/process" android:label="@string/bluetooth_map_settings_title" android:excludeFromRecents="true" android:configChanges="orientation|keyboardHidden" android:enabled="@bool/profile_supported_map"> </activity> <provider android:name="com.android.bluetooth.map.MmsFileProvider" android:authorities="com.android.bluetooth.map.MmsFileProvider" android:enabled="true" android:grantUriPermissions="true" android:exported="false"> </provider> <service android:process="@string/process" android:name="com.android.bluetooth.mapclient.MapClientService" android:name=".mapclient.MapClientService" android:enabled="@bool/profile_supported_mapmce" android:exported="true"> <intent-filter> Loading
android/app/res/values/config.xml +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ <bool name="profile_supported_pbap">true</bool> <bool name="pbap_include_photos_in_vcard">true</bool> <bool name="pbap_use_profile_for_owner_vcard">true</bool> <bool name="profile_supported_map">true</bool> <bool name="profile_supported_sap">false</bool> <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_mapmce">false</bool> Loading
android/app/src/com/android/bluetooth/map/BluetoothMapService.java +18 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.bluetooth.IBluetoothMap; import android.bluetooth.SdpMnsRecord; import android.content.AttributionSource; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -42,6 +43,7 @@ import android.os.Message; import android.os.ParcelUuid; import android.os.PowerManager; import android.os.RemoteException; import android.sysprop.BluetoothProperties; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -77,6 +79,13 @@ public class BluetoothMapService extends ProfileService { public static final boolean VERBOSE = false; /** * The component names for the owned provider and activity */ private static final String MAP_SETTINGS_ACTIVITY = BluetoothMapSettings.class.getCanonicalName(); private static final String MAP_FILE_PROVIDER = MmsFileProvider.class.getCanonicalName(); /** * Intent indicating timeout for user confirmation, which is sent to * BluetoothMapActivity Loading Loading @@ -151,6 +160,10 @@ public class BluetoothMapService extends ProfileService { BluetoothUuid.MAP, BluetoothUuid.MNS, }; public static boolean isEnabled() { return BluetoothProperties.isProfileMapServerEnabled().orElse(false); } public BluetoothMapService() { mState = BluetoothMap.STATE_DISCONNECTED; } Loading Loading @@ -656,6 +669,9 @@ public class BluetoothMapService extends ProfileService { mDatabaseManager = Objects.requireNonNull(AdapterService.getAdapterService().getDatabase(), "DatabaseManager cannot be null when MapService starts"); setComponentAvailable(MAP_SETTINGS_ACTIVITY, true); setComponentAvailable(MAP_FILE_PROVIDER, true); HandlerThread thread = new HandlerThread("BluetoothMapHandler"); thread.start(); Looper looper = thread.getLooper(); Loading Loading @@ -876,6 +892,8 @@ public class BluetoothMapService extends ProfileService { mAppObserver.shutdown(); } sendShutdownMessage(); setComponentAvailable(MAP_SETTINGS_ACTIVITY, false); setComponentAvailable(MAP_FILE_PROVIDER, false); return true; } Loading
android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public class BluetoothMapContentObserverTest { public void setUp() { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when BluetoothMapService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)); BluetoothMapService.isEnabled()); } @Test Loading
android/app/tests/unit/src/com/android/bluetooth/map/BluetoothMapServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class BluetoothMapServiceTest { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when BluetoothMapService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)); BluetoothMapService.isEnabled()); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading @@ -72,7 +72,7 @@ public class BluetoothMapServiceTest { @After public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_map)) { if (!BluetoothMapService.isEnabled()) { return; } TestUtils.stopService(mServiceRule, BluetoothMapService.class); Loading