Loading src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceController.java +6 −10 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class PreUpgradePreferenceController extends BasePreferenceController { @Override public int getAvailabilityStatus() { if (mNm.isNotificationListenerAccessGranted(mCn)) { mNlf = mNm.getListenerFilter(mCn, mUserId); if (mTargetSdk > Build.VERSION_CODES.S) { Loading @@ -69,8 +68,5 @@ public class PreUpgradePreferenceController extends BasePreferenceController { return CONDITIONALLY_UNAVAILABLE; } return AVAILABLE; } else { return CONDITIONALLY_UNAVAILABLE; } } } No newline at end of file tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceControllerTest.java +0 −11 Original line number Diff line number Diff line Loading @@ -62,17 +62,8 @@ public class PreUpgradePreferenceControllerTest { mController.setUserId(0); } @Test public void testAvailable_notGranted() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false); mController.setTargetSdk(Build.VERSION_CODES.S); assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE); } @Test public void testAvailable_lowTargetSdk_noCustomizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.S); when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); Loading @@ -81,7 +72,6 @@ public class PreUpgradePreferenceControllerTest { @Test public void testAvailable_lowTargetSdk_customizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.S); NotificationListenerFilter nlf = new NotificationListenerFilter(); nlf.setTypes(FLAG_FILTER_TYPE_CONVERSATIONS); Loading @@ -92,7 +82,6 @@ public class PreUpgradePreferenceControllerTest { @Test public void testAvailable_highTargetSdk_noCustomizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1); when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); Loading Loading
src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceController.java +6 −10 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class PreUpgradePreferenceController extends BasePreferenceController { @Override public int getAvailabilityStatus() { if (mNm.isNotificationListenerAccessGranted(mCn)) { mNlf = mNm.getListenerFilter(mCn, mUserId); if (mTargetSdk > Build.VERSION_CODES.S) { Loading @@ -69,8 +68,5 @@ public class PreUpgradePreferenceController extends BasePreferenceController { return CONDITIONALLY_UNAVAILABLE; } return AVAILABLE; } else { return CONDITIONALLY_UNAVAILABLE; } } } No newline at end of file
tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceControllerTest.java +0 −11 Original line number Diff line number Diff line Loading @@ -62,17 +62,8 @@ public class PreUpgradePreferenceControllerTest { mController.setUserId(0); } @Test public void testAvailable_notGranted() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false); mController.setTargetSdk(Build.VERSION_CODES.S); assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE); } @Test public void testAvailable_lowTargetSdk_noCustomizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.S); when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); Loading @@ -81,7 +72,6 @@ public class PreUpgradePreferenceControllerTest { @Test public void testAvailable_lowTargetSdk_customizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.S); NotificationListenerFilter nlf = new NotificationListenerFilter(); nlf.setTypes(FLAG_FILTER_TYPE_CONVERSATIONS); Loading @@ -92,7 +82,6 @@ public class PreUpgradePreferenceControllerTest { @Test public void testAvailable_highTargetSdk_noCustomizations() { when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1); when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); Loading