OSDN Git Service

Revert "Adding some logging around launcher grid when device profile changes"
authorSunny Goyal <sunnygoyal@google.com>
Mon, 20 Mar 2017 23:07:10 +0000 (23:07 +0000)
committerSunny Goyal <sunnygoyal@google.com>
Mon, 20 Mar 2017 23:08:17 +0000 (16:08 -0700)
Bug: 35425060
This reverts commit c29de857807680bf72ebd386cbec716b33d64780.

Change-Id: I4320be3473f914289f88c8cbb376a68af006d7de

src/com/android/launcher3/InvariantDeviceProfile.java
src/com/android/launcher3/LauncherAppState.java
src/com/android/launcher3/model/GridSizeMigrationTask.java

index 2dd3198..9e214d1 100644 (file)
@@ -29,7 +29,6 @@ import android.view.WindowManager;
 
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.config.ProviderConfig;
-import com.android.launcher3.logging.FileLog;
 import com.android.launcher3.util.Thunk;
 
 import org.xmlpull.v1.XmlPullParser;
@@ -188,23 +187,6 @@ public class InvariantDeviceProfile {
         }
     }
 
-    public void dumpDisplayInfo(Context context) {
-        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
-        Display display = wm.getDefaultDisplay();
-        DisplayMetrics dm = new DisplayMetrics();
-        display.getMetrics(dm);
-
-        Point smallestSize = new Point();
-        Point largestSize = new Point();
-        display.getCurrentSizeRange(smallestSize, largestSize);
-
-        FileLog.e("DisplayInfo", "Default Density: " + DisplayMetrics.DENSITY_DEFAULT);
-        FileLog.e("DisplayInfo", "Density: " + dm.densityDpi);
-        FileLog.e("DisplayInfo", "Smallest size: " + smallestSize);
-        FileLog.e("DisplayInfo", "Largest size: " + largestSize);
-        FileLog.e("DisplayInfo", "minWidth/Height DPS: " + minWidthDps + ", " + minHeightDps);
-    }
-
     ArrayList<InvariantDeviceProfile> getPredefinedDeviceProfiles(Context context) {
         ArrayList<InvariantDeviceProfile> profiles = new ArrayList<>();
         try (XmlResourceParser parser = context.getResources().getXml(R.xml.device_profiles)) {
index 2e75579..180c202 100644 (file)
@@ -28,7 +28,6 @@ import com.android.launcher3.compat.PackageInstallerCompat;
 import com.android.launcher3.compat.UserManagerCompat;
 import com.android.launcher3.config.ProviderConfig;
 import com.android.launcher3.dynamicui.ExtractionUtils;
-import com.android.launcher3.model.GridSizeMigrationTask;
 import com.android.launcher3.util.ConfigMonitor;
 import com.android.launcher3.util.Preconditions;
 import com.android.launcher3.util.TestingUtils;
@@ -54,8 +53,6 @@ public class LauncherAppState {
         if (INSTANCE == null) {
             if (Looper.myLooper() == Looper.getMainLooper()) {
                 INSTANCE = new LauncherAppState(context.getApplicationContext());
-                GridSizeMigrationTask.logDeviceProfileIfChanged(
-                        INSTANCE.getInvariantDeviceProfile(), context);
             } else {
                 try {
                     return new MainThreadExecutor().submit(new Callable<LauncherAppState>() {
index e50b912..221798b 100644 (file)
@@ -27,7 +27,6 @@ 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;
 
@@ -890,23 +889,6 @@ 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.