Loading include/utils/ResourceTypes.h +28 −3 Original line number Original line Diff line number Diff line Loading @@ -933,6 +933,7 @@ struct ResTable_config SCREENSIZE_SMALL = 0x01, SCREENSIZE_SMALL = 0x01, SCREENSIZE_NORMAL = 0x02, SCREENSIZE_NORMAL = 0x02, SCREENSIZE_LARGE = 0x03, SCREENSIZE_LARGE = 0x03, SCREENSIZE_XLARGE = 0x04, // screenLayout bits for wide/long screen variation. // screenLayout bits for wide/long screen variation. MASK_SCREENLONG = 0x30, MASK_SCREENLONG = 0x30, Loading Loading @@ -1208,7 +1209,28 @@ struct ResTable_config if (screenLayout || o.screenLayout) { if (screenLayout || o.screenLayout) { if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0 if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0 && (requested->screenLayout & MASK_SCREENSIZE)) { && (requested->screenLayout & MASK_SCREENSIZE)) { return (screenLayout & MASK_SCREENSIZE); // A little backwards compatibility here: undefined is // considered equivalent to normal. But only if the // requested size is at least normal; otherwise, small // is better than the default. int mySL = (screenLayout & MASK_SCREENSIZE); int oSL = (o.screenLayout & MASK_SCREENSIZE); int fixedMySL = mySL; int fixedOSL = oSL; if ((requested->screenLayout & MASK_SCREENSIZE) >= SCREENSIZE_NORMAL) { if (fixedMySL == 0) fixedMySL = SCREENSIZE_NORMAL; if (fixedOSL == 0) fixedOSL = SCREENSIZE_NORMAL; } // For screen size, the best match is the one that is // closest to the requested screen size, but not over // (the not over part is dealt with in match() below). if (fixedMySL == fixedOSL) { // If the two are the same, but 'this' is actually // undefined, then the other is really a better match. if (mySL == 0) return false; return true; } return fixedMySL >= fixedOSL; } } if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0 if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0 && (requested->screenLayout & MASK_SCREENLONG)) { && (requested->screenLayout & MASK_SCREENLONG)) { Loading Loading @@ -1370,8 +1392,11 @@ struct ResTable_config if (screenConfig != 0) { if (screenConfig != 0) { const int screenSize = screenLayout&MASK_SCREENSIZE; const int screenSize = screenLayout&MASK_SCREENSIZE; const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE; const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE; if (setScreenSize != 0 && screenSize != 0 // Any screen sizes for larger screens than the setting do not && screenSize != setScreenSize) { // match. if ((setScreenSize != 0 && screenSize != 0 && screenSize > setScreenSize) || (setScreenSize == 0 && screenSize != 0)) { return false; return false; } } Loading libs/utils/ResourceTypes.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -4178,6 +4178,9 @@ void ResTable::print(bool inclValues) const case ResTable_config::SCREENSIZE_LARGE: case ResTable_config::SCREENSIZE_LARGE: printf(" (large)"); printf(" (large)"); break; break; case ResTable_config::SCREENSIZE_XLARGE: printf(" (xlarge)"); break; } } printf(" lng=%d", printf(" lng=%d", type->config.screenLayout&ResTable_config::MASK_SCREENLONG); type->config.screenLayout&ResTable_config::MASK_SCREENLONG); Loading Loading
include/utils/ResourceTypes.h +28 −3 Original line number Original line Diff line number Diff line Loading @@ -933,6 +933,7 @@ struct ResTable_config SCREENSIZE_SMALL = 0x01, SCREENSIZE_SMALL = 0x01, SCREENSIZE_NORMAL = 0x02, SCREENSIZE_NORMAL = 0x02, SCREENSIZE_LARGE = 0x03, SCREENSIZE_LARGE = 0x03, SCREENSIZE_XLARGE = 0x04, // screenLayout bits for wide/long screen variation. // screenLayout bits for wide/long screen variation. MASK_SCREENLONG = 0x30, MASK_SCREENLONG = 0x30, Loading Loading @@ -1208,7 +1209,28 @@ struct ResTable_config if (screenLayout || o.screenLayout) { if (screenLayout || o.screenLayout) { if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0 if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0 && (requested->screenLayout & MASK_SCREENSIZE)) { && (requested->screenLayout & MASK_SCREENSIZE)) { return (screenLayout & MASK_SCREENSIZE); // A little backwards compatibility here: undefined is // considered equivalent to normal. But only if the // requested size is at least normal; otherwise, small // is better than the default. int mySL = (screenLayout & MASK_SCREENSIZE); int oSL = (o.screenLayout & MASK_SCREENSIZE); int fixedMySL = mySL; int fixedOSL = oSL; if ((requested->screenLayout & MASK_SCREENSIZE) >= SCREENSIZE_NORMAL) { if (fixedMySL == 0) fixedMySL = SCREENSIZE_NORMAL; if (fixedOSL == 0) fixedOSL = SCREENSIZE_NORMAL; } // For screen size, the best match is the one that is // closest to the requested screen size, but not over // (the not over part is dealt with in match() below). if (fixedMySL == fixedOSL) { // If the two are the same, but 'this' is actually // undefined, then the other is really a better match. if (mySL == 0) return false; return true; } return fixedMySL >= fixedOSL; } } if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0 if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0 && (requested->screenLayout & MASK_SCREENLONG)) { && (requested->screenLayout & MASK_SCREENLONG)) { Loading Loading @@ -1370,8 +1392,11 @@ struct ResTable_config if (screenConfig != 0) { if (screenConfig != 0) { const int screenSize = screenLayout&MASK_SCREENSIZE; const int screenSize = screenLayout&MASK_SCREENSIZE; const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE; const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE; if (setScreenSize != 0 && screenSize != 0 // Any screen sizes for larger screens than the setting do not && screenSize != setScreenSize) { // match. if ((setScreenSize != 0 && screenSize != 0 && screenSize > setScreenSize) || (setScreenSize == 0 && screenSize != 0)) { return false; return false; } } Loading
libs/utils/ResourceTypes.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -4178,6 +4178,9 @@ void ResTable::print(bool inclValues) const case ResTable_config::SCREENSIZE_LARGE: case ResTable_config::SCREENSIZE_LARGE: printf(" (large)"); printf(" (large)"); break; break; case ResTable_config::SCREENSIZE_XLARGE: printf(" (xlarge)"); break; } } printf(" lng=%d", printf(" lng=%d", type->config.screenLayout&ResTable_config::MASK_SCREENLONG); type->config.screenLayout&ResTable_config::MASK_SCREENLONG); Loading