专题探索网站开发教学模式的结构,深圳做网站建设比较好的公司,wordpress软件最低要求,太原网站制作定制开发由于Android4.4系统上去掉了ro.sf.hwrotation属性的支持#xff0c;因为不能使用之前的方法进行屏幕旋转了。暂时没有找到相应的属性和后门#xff0c;于是自己写了一个屏幕旋转的临时代码#xff0c;后面找到更好的方法后再替换。具体代码如下#xff1a;~/framework/nati…由于Android4.4系统上去掉了ro.sf.hwrotation属性的支持因为不能使用之前的方法进行屏幕旋转了。暂时没有找到相应的属性和后门于是自己写了一个屏幕旋转的临时代码后面找到更好的方法后再替换。具体代码如下~/framework/native/services/surfaceflinger/DisplayDevice.cppuint32_t DisplayDevice::getOrientationTransform() const {...if (property_get(persist.sys.hwrotation, property, NULL) 0) {switch (atoi(property)) {case 90:transform Transform::ROT_90;break;case 270:transform Transform::ROT_270;break;}}return transform;}status_t DisplayDevice::orientationToTransfrom(int orientation, int w, int h, Transform* tr){...if (property_get(persist.sys.hwrotation, property, NULL) 0) {switch (atoi(property)) {case 90:flags Transform::ROT_90;break;case 270:flags Transform::ROT_270;break;}}tr-set(flags, w, h);return NO_ERROR;}void DisplayDevice::setProjection(int orientation,const Rect newViewport, const Rect newFrame) {...if (!frame.isValid()) {if (property_get(persist.sys.hwrotation, property, NULL) 0) {switch (atoi(property)) {case 90:case 270:frame Rect(h, w);break;default:frame Rect(w, h);break;}} elseframe Rect(w, h);} else {...}}~/framework/base/services/input/InputReader.cppvoid TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {...if (property_get(persist.sys.hwrotation, property, NULL) 0) {switch (atoi(property)) {case 90:mSurfaceOrientation DISPLAY_ORIENTATION_90;break;case 270:mSurfaceOrientation DISPLAY_ORIENTATION_270;break;}}switch (mSurfaceOrientation) {case DISPLAY_ORIENTATION_90:case DISPLAY_ORIENTATION_270:}~/framework/native/services/surfaceflinger/SurfaceFlinger.cppstatus_t SurfaceFlinger::getDisplayInfo(const sp display, DisplayInfo* info) {...info-w hwc.getWidth(type);info-h hwc.getHeight(type);if (property_get(persist.sys.hwrotation, property, NULL) 0) {switch (atoi(property)) {case 90:case 270:if (type ! DisplayDevice::DISPLAY_EXTERNAL) {info-w hwc.getHeight(type);info-h hwc.getWidth(type);}break;default:break;}}info-xdpi xdpi;info-ydpi ydpi;info-fps float(1e9 / hwc.getRefreshPeriod(type));...}void SurfaceFlinger::onInitializeDisplays() {...d.orientation DisplayState::eOrientationDefault;char property[PROPERTY_VALUE_MAX];if (property_get(persist.sys.hwrotation, property, NULL) 0){switch (atoi(property)) {case 0:d.orientation DisplayState::eOrientationDefault;break;case 90:d.orientation DisplayState::eOrientation90;break;case 180:d.orientation DisplayState::eOrientation180;break;case 270:d.orientation DisplayState::eOrientation270;break;default:d.orientation DisplayState::eOrientationDefault;break;}} else {d.orientation DisplayState::eOrientationDefault;}d.frame.makeInvalid();d.viewport.makeInvalid();}~/framework/base/services/java/com/android/server/wm/WindowManagerService.javaboolean updateOrientationFromAppTokensLocked(boolean inTransaction) {...if (req ! mForcedAppOrientation) {if (0.equals(SystemProperties.get(persist.sys.hwrotation, 0)))req ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;else if (90.equals(SystemProperties.get(persist.sys.hwrotation, 0)))req ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;else if (180.equals(SystemProperties.get(persist.sys.hwrotation, 0)))req ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;else if (270.equals(SystemProperties.get(persist.sys.hwrotation, 0)))req ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;elsereq ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;}...}