Simplify keyguard notification count logic
The logic around NotificationStackSizeCalculator has been simplified by removing duplication of code between `computeMaxKeyguardNotifications` and `computeHeight`. Now `computeHeightPerNotificationLimit` returns a sequence where the "ith" element is the height of the shade when limited by "ith" notifications (and the remaining go into the shelf). Those values are used to compute the max notifications possible. `totalAvailableSpace` now also has to include the space for the shelf. This makes the logic to check if the shelf fits easier. (before, the code was manually checking. Tests have been modified to also include the shelf in the space available. + minor formatting fixes to kt files with ktfmt + improved debugging for keyguard available space for notifications, adding both top and bottom padding values. + Using real values from resources in dimentions test + writing more explicitly available space in each test Bug: 214504318 Bug: 227733494 Test: Manual + atest android.platform.test.scenario.sysui.notification Change-Id: Ibae96d0a01cc2698d2914efbf752a209636cfabc
Loading
Please register or sign in to comment