Loading android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,7 @@ class BluetoothOppNotification { private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private NotificationUpdateThread mUpdateNotificationThread; @VisibleForTesting NotificationUpdateThread mUpdateNotificationThread; private int mPendingUpdate = 0; private int mPendingUpdate = 0; Loading android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -135,7 +135,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti private BluetoothShareContentObserver mObserver; private BluetoothShareContentObserver mObserver; /** Class to handle Notification Manager updates */ /** Class to handle Notification Manager updates */ private BluetoothOppNotification mNotifier; @VisibleForTesting BluetoothOppNotification mNotifier; private boolean mPendingUpdate; private boolean mPendingUpdate; Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceCleanupTest.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class BluetoothOppServiceCleanupTest { @Test @Test @UiThreadTest @UiThreadTest public void testStopAndCleanup() { public void testStopAndCleanup() throws Exception { AdapterService adapterService = new AdapterService(mTargetContext); AdapterService adapterService = new AdapterService(mTargetContext); // Don't need to disable again since it will be handled in OppService.stop // Don't need to disable again since it will be handled in OppService.stop Loading @@ -58,8 +58,9 @@ public class BluetoothOppServiceCleanupTest { mTargetContext.getContentResolver().insert(BluetoothShare.CONTENT_URI, values); mTargetContext.getContentResolver().insert(BluetoothShare.CONTENT_URI, values); } } BluetoothOppService service = null; try { try { BluetoothOppService service = new BluetoothOppService(adapterService); service = new BluetoothOppService(adapterService); service.start(); service.start(); service.setAvailable(true); service.setAvailable(true); Loading @@ -67,6 +68,12 @@ public class BluetoothOppServiceCleanupTest { service.stop(); service.stop(); service.cleanup(); service.cleanup(); } finally { } finally { if (service != null) { Thread updateNotificationThread = service.mNotifier.mUpdateNotificationThread; if (updateNotificationThread != null) { updateNotificationThread.join(); } } mTargetContext.getContentResolver().delete(BluetoothShare.CONTENT_URI, null, null); mTargetContext.getContentResolver().delete(BluetoothShare.CONTENT_URI, null, null); } } } } Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceTest.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -107,6 +107,10 @@ public class BluetoothOppServiceTest { BluetoothOppService service = mService; BluetoothOppService service = mService; if (service != null) { if (service != null) { service.mUpdateThread = null; service.mUpdateThread = null; Thread updateNotificationThread = service.mNotifier.mUpdateNotificationThread; if (updateNotificationThread != null) { updateNotificationThread.join(); } } } BluetoothMethodProxy.setInstanceForTesting(null); BluetoothMethodProxy.setInstanceForTesting(null); Loading Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,7 @@ class BluetoothOppNotification { private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private NotificationUpdateThread mUpdateNotificationThread; @VisibleForTesting NotificationUpdateThread mUpdateNotificationThread; private int mPendingUpdate = 0; private int mPendingUpdate = 0; Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -135,7 +135,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti private BluetoothShareContentObserver mObserver; private BluetoothShareContentObserver mObserver; /** Class to handle Notification Manager updates */ /** Class to handle Notification Manager updates */ private BluetoothOppNotification mNotifier; @VisibleForTesting BluetoothOppNotification mNotifier; private boolean mPendingUpdate; private boolean mPendingUpdate; Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceCleanupTest.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class BluetoothOppServiceCleanupTest { @Test @Test @UiThreadTest @UiThreadTest public void testStopAndCleanup() { public void testStopAndCleanup() throws Exception { AdapterService adapterService = new AdapterService(mTargetContext); AdapterService adapterService = new AdapterService(mTargetContext); // Don't need to disable again since it will be handled in OppService.stop // Don't need to disable again since it will be handled in OppService.stop Loading @@ -58,8 +58,9 @@ public class BluetoothOppServiceCleanupTest { mTargetContext.getContentResolver().insert(BluetoothShare.CONTENT_URI, values); mTargetContext.getContentResolver().insert(BluetoothShare.CONTENT_URI, values); } } BluetoothOppService service = null; try { try { BluetoothOppService service = new BluetoothOppService(adapterService); service = new BluetoothOppService(adapterService); service.start(); service.start(); service.setAvailable(true); service.setAvailable(true); Loading @@ -67,6 +68,12 @@ public class BluetoothOppServiceCleanupTest { service.stop(); service.stop(); service.cleanup(); service.cleanup(); } finally { } finally { if (service != null) { Thread updateNotificationThread = service.mNotifier.mUpdateNotificationThread; if (updateNotificationThread != null) { updateNotificationThread.join(); } } mTargetContext.getContentResolver().delete(BluetoothShare.CONTENT_URI, null, null); mTargetContext.getContentResolver().delete(BluetoothShare.CONTENT_URI, null, null); } } } } Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppServiceTest.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -107,6 +107,10 @@ public class BluetoothOppServiceTest { BluetoothOppService service = mService; BluetoothOppService service = mService; if (service != null) { if (service != null) { service.mUpdateThread = null; service.mUpdateThread = null; Thread updateNotificationThread = service.mNotifier.mUpdateNotificationThread; if (updateNotificationThread != null) { updateNotificationThread.join(); } } } BluetoothMethodProxy.setInstanceForTesting(null); BluetoothMethodProxy.setInstanceForTesting(null); Loading