当前位置: 首页 > wzjs >正文

专业建站制作网络营销方式有哪些

专业建站制作,网络营销方式有哪些,wordpress管理员插件,微信公众号网页版入口一、前言 有时候需要系统的某个应用强制衡平显示,不管他是如何配置的。我们只需要简单的拿到top的Task下面的ActivityRecord,并判断包名来强制实现。 二、调整wms com.android.server.wm.DisplayRotation /*** Given an orientation constant, return…

一、前言

有时候需要系统的某个应用强制衡平显示,不管他是如何配置的。我们只需要简单的拿到top的Task下面的ActivityRecord,并判断包名来强制实现。

二、调整wms

com.android.server.wm.DisplayRotation

 /*** Given an orientation constant, returns the appropriate surface rotation, taking into account* sensors, docking mode, rotation lock, and other factors.** @param orientation  An orientation constant, such as*                     {@link ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.* @param lastRotation The most recently used rotation.* @return The surface rotation to use.*/@Surface.Rotationint rotationForOrientation(@ScreenOrientation int orientation,@Surface.Rotation int lastRotation) {ProtoLog.v(WM_DEBUG_ORIENTATION,"rotationForOrientation(orient=%s (%d), last=%s (%d)); user=%s (%d) %s",ActivityInfo.screenOrientationToString(orientation), orientation,Surface.rotationToString(lastRotation), lastRotation,Surface.rotationToString(mUserRotation), mUserRotation,mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED? "USER_ROTATION_LOCKED" : "");if (isFixedToUserRotation()) {return mUserRotation;}+    if(isTopActivityIsMyPackage()){+       return Surface.ROTATION_90;+    }@Surface.Rotationint sensorRotation = mOrientationListener != null? mOrientationListener.getProposedRotation() // may be -1: -1;if (mFoldController != null && mFoldController.shouldIgnoreSensorRotation()) {sensorRotation = -1;}if (mDeviceStateController.shouldReverseRotationDirectionAroundZAxis(mDisplayContent)) {sensorRotation = RotationUtils.reverseRotationDirectionAroundZAxis(sensorRotation);}mLastSensorRotation = sensorRotation;if (sensorRotation < 0) {sensorRotation = lastRotation;}final int lidState = mDisplayPolicy.getLidState();final int dockMode = mDisplayPolicy.getDockMode();final boolean hdmiPlugged = mDisplayPolicy.isHdmiPlugged();final boolean carDockEnablesAccelerometer =mDisplayPolicy.isCarDockEnablesAccelerometer();final boolean deskDockEnablesAccelerometer =mDisplayPolicy.isDeskDockEnablesAccelerometer();@Surface.Rotationfinal int preferredRotation;if (!isDefaultDisplay) {// For secondary displays we ignore things like displays sensors, docking mode and// rotation lock, and always prefer user rotation.preferredRotation = mUserRotation;} else if (lidState == LID_OPEN && mLidOpenRotation >= 0) {// Ignore sensor when lid switch is open and rotation is forced.preferredRotation = mLidOpenRotation;} else if (dockMode == Intent.EXTRA_DOCK_STATE_CAR&& (carDockEnablesAccelerometer || mCarDockRotation >= 0)) {// Ignore sensor when in car dock unless explicitly enabled.// This case can override the behavior of NOSENSOR, and can also// enable 180 degree rotation while docked.preferredRotation = carDockEnablesAccelerometer ? sensorRotation : mCarDockRotation;} else if ((dockMode == Intent.EXTRA_DOCK_STATE_DESK|| dockMode == Intent.EXTRA_DOCK_STATE_LE_DESK|| dockMode == Intent.EXTRA_DOCK_STATE_HE_DESK)&& (deskDockEnablesAccelerometer || mDeskDockRotation >= 0)&& !(orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED|| orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR)) {// Ignore sensor when in desk dock unless explicitly enabled.// This case can enable 180 degree rotation while docked.preferredRotation = deskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation;} else if (hdmiPlugged && mDemoHdmiRotationLock) {// Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled.// Note that the dock orientation overrides the HDMI orientation.preferredRotation = mDemoHdmiRotation;} else if (hdmiPlugged && dockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED&& mUndockedHdmiRotation >= 0) {// Ignore sensor when plugged into HDMI and an undocked orientation has// been specified in the configuration (only for legacy devices without// full multi-display support).// Note that the dock orientation overrides the HDMI orientation.preferredRotation = mUndockedHdmiRotation;} else if (mDemoRotationLock) {// Ignore sensor when demo rotation lock is enabled.// Note that the dock orientation and HDMI rotation lock override this.preferredRotation = mDemoRotation;} else if (mDisplayPolicy.isPersistentVrModeEnabled()) {// While in VR, apps always prefer a portrait rotation. This does not change// any apps that explicitly set landscape, but does cause sensors be ignored,// and ignored any orientation lock that the user has set (this conditional// should remain above the ORIENTATION_LOCKED conditional below).preferredRotation = mPortraitRotation;} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED) {// Application just wants to remain locked in the last rotation.preferredRotation = lastRotation;} else if (!mSupportAutoRotation) {if (mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION) {preferredRotation = mUserRotation;} else {// If we don't support auto-rotation then bail out here and ignore// the sensor and any rotation lock settings.preferredRotation = -1;}} else if (((mUserRotationMode == WindowManagerPolicy.USER_ROTATION_FREE|| isTabletopAutoRotateOverrideEnabled())&& (orientation == ActivityInfo.SCREEN_ORIENTATION_USER|| orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED|| orientation == ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE|| orientation == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT|| orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER))|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR|| orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {// Otherwise, use sensor only if requested by the application or enabled// by default for USER or UNSPECIFIED modes.  Does not apply to NOSENSOR.boolean allowed = true;if (orientation != ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR&& orientation != ActivityInfo.SCREEN_ORIENTATION_FULL_USER) {allowed = RotationPolicy.isRotationAllowed(sensorRotation, mUserRotationAngles,getAllowAllRotations() != ALLOW_ALL_ROTATIONS_DISABLED);}if (allowed) {preferredRotation = sensorRotation;} else {preferredRotation = lastRotation;}} else if (mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED&& orientation != ActivityInfo.SCREEN_ORIENTATION_NOSENSOR&& orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE&& orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT&& orientation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE&& orientation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {// Apply rotation lock. Does not apply to NOSENSOR or specific rotations.// The idea is that the user rotation expresses a weak preference for the direction// of gravity and as NOSENSOR is never affected by gravity, then neither should// NOSENSOR be affected by rotation lock (although it will be affected by docks).// Also avoid setting user rotation when app has preference over one particular rotation// to avoid leaving the rotation to the reverse of it which has the compatible// orientation, but isn't what app wants, when the user rotation is the reverse of the// preferred rotation.preferredRotation = mUserRotation;} else {// No overriding preference.// We will do exactly what the application asked us to do.preferredRotation = -1;}switch (orientation) {case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:// Return portrait unless overridden.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}return mPortraitRotation;case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:// Return landscape unless overridden.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}return mLandscapeRotation;case ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT:// Return reverse portrait unless overridden.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}return mUpsideDownRotation;case ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE:// Return seascape unless overridden.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}return mSeascapeRotation;case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE:case ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE:// Return either landscape rotation.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}if (isLandscapeOrSeascape(lastRotation)) {return lastRotation;}return mLandscapeRotation;case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT:case ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT:// Return either portrait rotation.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}if (isAnyPortrait(lastRotation)) {return lastRotation;}return mPortraitRotation;default:// For USER, UNSPECIFIED, NOSENSOR, SENSOR and FULL_SENSOR,// just return the preferred orientation we already calculated.if (preferredRotation >= 0) {return preferredRotation;}return Surface.ROTATION_0;}}

这里是传入一个配置的选装方法和当前的方法,来判断后面要进行旋转的操作,我们Activity没有配置横竖屏的时候传入的
orientation都是SCREEN_ORIENTATION_UNSPECIFIED(-1),不过我们强制横屏可以不考虑这么多,加一个方法判断即可。

 boolean isTopActivityIsMyPackage(){try {Task rootTask = mDisplayContent.getTopRootTask();if(rootTask!=null&&rootTask.hasChild()&&rootTask.getChildAt(0) instanceof ActivityRecord){return  ((ActivityRecord) rootTask.getChildAt(0)).packageName.equals("com.example.cloudclient");}}catch (Exception e){return false;}return false;}

这里的包名换成自己的就行,然后编译打包重启

make -j12 services
adb push lineageos/out/target/product/blueline/system/framework/services.jar /system/framework/services.jar

在这里插入图片描述


文章转载自:

http://qSniheyF.tqqhm.cn
http://PgQZVsST.tqqhm.cn
http://hbt80sau.tqqhm.cn
http://U7YBsrB8.tqqhm.cn
http://okgKrLgh.tqqhm.cn
http://rpvTJ650.tqqhm.cn
http://FaTh8mqJ.tqqhm.cn
http://IcVv6e1r.tqqhm.cn
http://M1VzAnyF.tqqhm.cn
http://DRXAChcl.tqqhm.cn
http://wNAjN2qf.tqqhm.cn
http://R325mEpo.tqqhm.cn
http://qbgxszmK.tqqhm.cn
http://46991Azr.tqqhm.cn
http://DhnLD2Oc.tqqhm.cn
http://wQdxhNXq.tqqhm.cn
http://HQsNfx6C.tqqhm.cn
http://d6qVx6j0.tqqhm.cn
http://KAlaLpu8.tqqhm.cn
http://ym2qcMgK.tqqhm.cn
http://rk8pdjcx.tqqhm.cn
http://6DaA9Io7.tqqhm.cn
http://BPS4QVCO.tqqhm.cn
http://gKlLRZ0i.tqqhm.cn
http://9YUmQanl.tqqhm.cn
http://IjxakiUl.tqqhm.cn
http://2fuwzq2F.tqqhm.cn
http://P24RVwZb.tqqhm.cn
http://yzCIJ9db.tqqhm.cn
http://y8ARFFpF.tqqhm.cn
http://www.dtcms.com/wzjs/777692.html

相关文章:

  • 自己做网站怎么赢利娃哈哈软文推广
  • 网站域名到期后不续费会怎样o2o电子商务平台有哪些
  • 门户网站做吗seo自然排名关键词来源的优缺点
  • wordpress网址改错了做360网站优化快速排
  • 股票网站怎么做动态表格创业网项目招商
  • 华星建设集团网站国外私人网站
  • 网站广告条效果做网站用什么语
  • 青岛网站建设eoe做游戏模型素材 网站
  • 药材网技术网站建设前端小说
  • 网站建设基本流程产品推广的网站怎么做
  • 网站开发移动端环保网站建设方案
  • 做赚钱的网站有哪些丹东手机网站
  • dede网站地图位置音乐网站开发与需求
  • 无限成都成都市广播电视台官方网站wordpress无法编辑
  • 买了个网站后怎么做下列哪个不是网络营销成熟阶段出现的网络营销方式
  • 网站建设单词长春网站建设吉网传媒实力牜
  • 用wordpress做外贸网站做淘宝网站的
  • 销售网站建设方案怎么注册国外域名
  • 网站建设需要什么样的内容网络营销师培训费用是多少
  • 国际网站建设与维护企业管理培训免费课程
  • wcm 可以做网站吗手机免制作app软件下载
  • html个人网站策划书网站开发还找到工作吗
  • 网站开发主菜单和子菜单东莞哪家公司做网站比较好
  • wordpress子页面怎么修改徐州关键字优化资讯
  • 网站建设问题整改报告wordpress 主题详情
  • 嘉兴seo网站建设费用信阳网站网站建设
  • 丹阳建设工程管理处网站台州网站公司那里好
  • 网站界面版式网站的建设好处
  • 网站内容图片怎么做安徽建设人才网官网
  • 北京网站建设那家好广州最新封闭封控区域