In the case the gird migration goes to a taller grid keep the grid configuration

For example going from 4x5 to 4x6 it will keep the 4x5 configuration
which fits in the 4x6 grid.

Also, it fixes GridMigrationTest which was flaky because of
how it sorted arrays.

Bug: 325286145
Flag: ACONFIG grid_migration_fix disabled
Test: NA
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2eaf15c37a051fd17c18c4443a8bd19d39057bf0)
Merged-In: I6063e3c303320096f7429a3b1d909e107d2ef2a0
Change-Id: I6063e3c303320096f7429a3b1d909e107d2ef2a0
4 files changed