Loading android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +7 −5 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class BluetoothOppNotification { private Context mContext; private HashMap<String, NotificationItem> mNotifications; private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private NotificationUpdateThread mUpdateNotificationThread; Loading Loading @@ -179,7 +179,6 @@ class BluetoothOppNotification { NotificationManager.IMPORTANCE_HIGH); mNotificationMgr.createNotificationChannel(mNotificationChannel); mNotifications = new HashMap<String, NotificationItem>(); // Get Content Resolver object one time mContentResolver = mContext.getContentResolver(); } Loading Loading @@ -704,9 +703,12 @@ class BluetoothOppNotification { cursor.close(); } void cancelNotifications() { Log.v(TAG, "cancelNotifications "); void cancelOppNotifications() { Log.v(TAG, "cancelOppNotifications "); mHandler.removeCallbacksAndMessages(null); mNotificationMgr.cancelAll(); mNotificationMgr.cancel(NOTIFICATION_ID_PROGRESS); mNotificationMgr.cancel(NOTIFICATION_ID_OUTBOUND_COMPLETE); mNotificationMgr.cancel(NOTIFICATION_ID_INBOUND_COMPLETE); mNotificationMgr.cancel(NOTIFICATION_ID_COMPLETE_SUMMARY); } } android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +2 −2 Original line number Diff line number Diff line Loading @@ -266,7 +266,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti mObserver = new BluetoothShareContentObserver(); getContentResolver().registerContentObserver(BluetoothShare.CONTENT_URI, true, mObserver); mNotifier = new BluetoothOppNotification(this); mNotifier.mNotificationMgr.cancelAll(); mNotifier.cancelOppNotifications(); updateFromProvider(); setBluetoothOppService(this); } Loading Loading @@ -618,7 +618,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti } if (mNotifier != null) { mNotifier.cancelNotifications(); mNotifier.cancelOppNotifications(); } } Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +1 −1 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect } else { Log.d(TAG, "Notification Not Required."); if (sNotificationManager != null) { sNotificationManager.cancelAll(); sNotificationManager.cancel(android.R.drawable.stat_sys_data_bluetooth); } } } Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppNotificationTest.java +2 −4 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public class BluetoothOppNotificationTest { mReceiverName, COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP); // clear all OPP notifications before each test mOppNotification.cancelNotifications(); mOppNotification.cancelOppNotifications(); } @After Loading @@ -117,7 +117,7 @@ public class BluetoothOppNotificationTest { mReceiverName, mPreviousState, DONT_KILL_APP); // clear all OPP notifications after each test mOppNotification.cancelNotifications(); mOppNotification.cancelOppNotifications(); } @Ignore("b/288660228") Loading Loading @@ -164,8 +164,6 @@ public class BluetoothOppNotificationTest { device.wait(Until.hasObject(By.text(titleString)), TIMEOUT_MS); UiObject2 title = device.findObject(By.text(titleString)); assertThat(title).isNotNull(); mOppNotification.cancelNotifications(); } @Test Loading Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +7 −5 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class BluetoothOppNotification { private Context mContext; private HashMap<String, NotificationItem> mNotifications; private final HashMap<String, NotificationItem> mNotifications = new HashMap<>(); private NotificationUpdateThread mUpdateNotificationThread; Loading Loading @@ -179,7 +179,6 @@ class BluetoothOppNotification { NotificationManager.IMPORTANCE_HIGH); mNotificationMgr.createNotificationChannel(mNotificationChannel); mNotifications = new HashMap<String, NotificationItem>(); // Get Content Resolver object one time mContentResolver = mContext.getContentResolver(); } Loading Loading @@ -704,9 +703,12 @@ class BluetoothOppNotification { cursor.close(); } void cancelNotifications() { Log.v(TAG, "cancelNotifications "); void cancelOppNotifications() { Log.v(TAG, "cancelOppNotifications "); mHandler.removeCallbacksAndMessages(null); mNotificationMgr.cancelAll(); mNotificationMgr.cancel(NOTIFICATION_ID_PROGRESS); mNotificationMgr.cancel(NOTIFICATION_ID_OUTBOUND_COMPLETE); mNotificationMgr.cancel(NOTIFICATION_ID_INBOUND_COMPLETE); mNotificationMgr.cancel(NOTIFICATION_ID_COMPLETE_SUMMARY); } }
android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +2 −2 Original line number Diff line number Diff line Loading @@ -266,7 +266,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti mObserver = new BluetoothShareContentObserver(); getContentResolver().registerContentObserver(BluetoothShare.CONTENT_URI, true, mObserver); mNotifier = new BluetoothOppNotification(this); mNotifier.mNotificationMgr.cancelAll(); mNotifier.cancelOppNotifications(); updateFromProvider(); setBluetoothOppService(this); } Loading Loading @@ -618,7 +618,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti } if (mNotifier != null) { mNotifier.cancelNotifications(); mNotifier.cancelOppNotifications(); } } Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +1 −1 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect } else { Log.d(TAG, "Notification Not Required."); if (sNotificationManager != null) { sNotificationManager.cancelAll(); sNotificationManager.cancel(android.R.drawable.stat_sys_data_bluetooth); } } } Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppNotificationTest.java +2 −4 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public class BluetoothOppNotificationTest { mReceiverName, COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP); // clear all OPP notifications before each test mOppNotification.cancelNotifications(); mOppNotification.cancelOppNotifications(); } @After Loading @@ -117,7 +117,7 @@ public class BluetoothOppNotificationTest { mReceiverName, mPreviousState, DONT_KILL_APP); // clear all OPP notifications after each test mOppNotification.cancelNotifications(); mOppNotification.cancelOppNotifications(); } @Ignore("b/288660228") Loading Loading @@ -164,8 +164,6 @@ public class BluetoothOppNotificationTest { device.wait(Until.hasObject(By.text(titleString)), TIMEOUT_MS); UiObject2 title = device.findObject(By.text(titleString)); assertThat(title).isNotNull(); mOppNotification.cancelNotifications(); } @Test Loading