diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-02-15 14:39:54 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-02-15 14:40:30 -0800 |
commit | c29de857807680bf72ebd386cbec716b33d64780 (patch) | |
tree | 739b76edee64ed08d7e2da46a603a7ca12e2b500 /src/com/android/launcher3/model | |
parent | a59402f98c0d3f85a45344657baa9b208e9eea32 (diff) | |
download | android_packages_apps_Trebuchet-c29de857807680bf72ebd386cbec716b33d64780.tar.gz android_packages_apps_Trebuchet-c29de857807680bf72ebd386cbec716b33d64780.tar.bz2 android_packages_apps_Trebuchet-c29de857807680bf72ebd386cbec716b33d64780.zip |
Adding some logging around launcher grid when device profile changes
Bug: 35349518
Change-Id: Ia71504cd37749f8eaa5e038ac2867bcd9749a4bb
Diffstat (limited to 'src/com/android/launcher3/model')
-rw-r--r-- | src/com/android/launcher3/model/GridSizeMigrationTask.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/launcher3/model/GridSizeMigrationTask.java b/src/com/android/launcher3/model/GridSizeMigrationTask.java index bbc7ae461..01808c5ca 100644 --- a/src/com/android/launcher3/model/GridSizeMigrationTask.java +++ b/src/com/android/launcher3/model/GridSizeMigrationTask.java @@ -27,6 +27,7 @@ import com.android.launcher3.Workspace; import com.android.launcher3.compat.AppWidgetManagerCompat; import com.android.launcher3.compat.PackageInstallerCompat; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.logging.FileLog; import com.android.launcher3.util.GridOccupancy; import com.android.launcher3.util.LongArrayMap; @@ -889,6 +890,23 @@ public class GridSizeMigrationTask { .apply(); } + public static void logDeviceProfileIfChanged(InvariantDeviceProfile idp, Context context) { + SharedPreferences prefs = Utilities.getPrefs(context); + String gridSizeString = getPointString(idp.numColumns, idp.numRows); + + int oldHotseatCount = prefs.getInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, idp.numHotseatIcons); + String oldSize = prefs.getString(KEY_MIGRATION_SRC_WORKSPACE_SIZE, gridSizeString); + if (gridSizeString.equals(oldSize) && idp.numHotseatIcons == oldHotseatCount) { + // Skip if workspace and hotseat sizes have not changed. + return; + } + + FileLog.e(TAG, "Grid size changed" + gridSizeString); + FileLog.e(TAG, " oldSize: " + oldSize + " , hotseat: " + oldHotseatCount); + FileLog.e(TAG, " newSize: " + gridSizeString + " , hotseat: " + idp.numHotseatIcons); + idp.dumpDisplayInfo(context); + } + /** * Migrates the workspace and hotseat in case their sizes changed. * @return false if the migration failed. |