搜索

232

主题

273

帖子

1916

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1916
发表于 2020-8-4 15:01:28 4621 浏览 0 回复

61,62,65默认所有app横屏显示

N:\K721_65\frameworks\base\services\core\java\com\android\server\wm\WindowManagerService.java

    boolean updateOrientationFromAppTokensLocked(int displayId, boolean forceUpdate) {
        long ident = Binder.clearCallingIdentity();
        try {
            final DisplayContent dc = mRoot.getDisplayContent(displayId);
                        //modify by lzg
            //int req = getOrientationLocked();
                        int req = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
                        //end lzg
            if (req != dc.getLastOrientation() || forceUpdate) {
                if (DEBUG_ORIENTATION) {
                    Slog.v(TAG, "updateOrientation: req= " + req + ", mLastOrientation= "
                        + dc.getLastOrientation(), new Throwable("updateOrientation"));
                }
                dc.setLastOrientation(req);
                //send a message to Policy indicating orientation change to take
                //action like disabling/enabling sensors etc.,
                // TODO(multi-display): Implement policy for secondary displays.
                if (dc.isDefaultDisplay) {
                    mPolicy.setCurrentOrientationLw(req);
                }
                return dc.updateRotationUnchecked(forceUpdate);
            }
            return false;
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

回复

使用道具 举报

返回列表
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


登录或注册
快速回复 返回顶部 返回列表