makeMeasureSpec (API 17 <), the implementation of the method is as follows:
public static int makeMeasureSpec(int size, int mode) { if (sUseBrokenMakeMeasureSpec) { return size + mode; } else { return (size & ~MODE_MASK) | (mode & MODE_MASK); } }
As you can see, the return value depends on the value of sUseBrokenMakeMeasureSpec , which is assigned a value in the constructor of the View class:
sUseBrokenMakeMeasureSpec = targetSdkVersion <= JELLY_BEAN_MR1;
Thus, only application behavior will determine behavior. Thus, the new system can maintain compatibility with an older application that accelerates old behavior.
source share