Merge "Don't reset channel field when loading the app" into pi-dev am: 7ae4b0bbdc
am: a7aee6eea5
Change-Id: Ib6804e0fa325d04360b620aa36f043c6c707db1b
This commit is contained in:
@@ -103,8 +103,10 @@ public class BlockPreferenceController extends NotificationPreferenceController
|
|||||||
saveChannel();
|
saveChannel();
|
||||||
}
|
}
|
||||||
if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid)) {
|
if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid)) {
|
||||||
mAppRow.banned = blocked;
|
if (mAppRow.banned != blocked) {
|
||||||
mBackend.setNotificationsEnabledForPackage(mAppRow.pkg, mAppRow.uid, !blocked);
|
mAppRow.banned = blocked;
|
||||||
|
mBackend.setNotificationsEnabledForPackage(mAppRow.pkg, mAppRow.uid, !blocked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (mChannelGroup != null) {
|
} else if (mChannelGroup != null) {
|
||||||
mChannelGroup.setBlocked(blocked);
|
mChannelGroup.setBlocked(blocked);
|
||||||
|
@@ -250,8 +250,7 @@ public class BlockPreferenceControllerTest {
|
|||||||
|
|
||||||
verify(mBackend, times(2)).updateChannel(any(), anyInt(), any());
|
verify(mBackend, times(2)).updateChannel(any(), anyInt(), any());
|
||||||
|
|
||||||
// 2 calls for onSwitchChanged + once when calling updateState originally
|
verify(mBackend, times(2)).setNotificationsEnabledForPackage(
|
||||||
verify(mBackend, times(3)).setNotificationsEnabledForPackage(
|
|
||||||
anyString(), anyInt(), anyBoolean());
|
anyString(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user