This seems like a bug in the documentation. If we look at the actual code that is used to calculate the screen size, we will see that a screen of 600x1024 with a resolution of 160 dpi will really be considered xlarge.
Do not take my word for it. The implementation is in WindowManagerService.computeNewConfigurationLocked () (warning for slow JavaScript). Interesting bits are as follows. The screen size in pixels scales depending on the density:
longSize = (int)(longSize/dm.density); shortSize = (int)(shortSize/dm.density);
For the mdpi screen (160 dpi), dm.density will be 1.0. For hdpi (240 dpi) it will be 1.5. In our case, we have an mdpi screen. So, after executing this code, longSize == 1024 and shortSize == 600 . Soon after, we get the following code:
// What size is this screen screen? if (longSize >= 800 && shortSize >= 600) { // SVGA or larger screens at medium density are the point // at which we consider it to be an extra large screen. mScreenLayout = Configuration.SCREENLAYOUT_SIZE_XLARGE; } else if ( // ...
which with our longSize and shortSize means that mScreenLayout will be assigned to Configuration.SCREENLAYOUT_SIZE_XLARGE , in other words, the screen will be considered "xlarge". It is interesting to note that if the screen were one pixel smaller on the short side, it could only be considered "large."
So, you are reading the documentation correctly, but as far as I can see, the documentation is incorrect, and your emulator is fine.
Martin Nordholts
source share