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

新网站内部优化怎么做在哪个网站可以做车年检

新网站内部优化怎么做,在哪个网站可以做车年检,湖南建设人力资源网是正规网站吗,可以做设计兼职的网站有哪些Android在外接物理键盘时#xff0c;如何强制调用系统软键盘#xff1f;第一次写#xff0c;写的不好请见谅参考:物理键盘映射过程#xff1a;手机/system/usr/keylayout/*.kl #xff1a;内核将keyCode映射成有含义的字符串KeycodeLabels.h #xff1a; framework 将字符…Android在外接物理键盘时如何强制调用系统软键盘第一次写写的不好请见谅参考:物理键盘映射过程手机/system/usr/keylayout/*.kl 内核将keyCode映射成有含义的字符串KeycodeLabels.h framework 将字符串映射成keyEvent的keyCodeframeworks/…/res/values/attrs.xml一、问题描述当平板连接上蓝牙扫描枪(外接物理键盘)时候不能弹出软键盘输入需要打开系统的输入法选择界面关闭硬件物理键盘后才能调用弹出系统软键盘理想效果在平板连接上蓝牙扫描枪后仍可以调用系统软键盘输入将系统的物理键盘默认设置为关闭状态或不需要开启关闭物理键盘1.首先:你要知道AndroidManifest.xml文件。这里这里有的信息对于理解程序又很大的意义。2.学会使用grep命令。修改系统的源代码时候这个很重要3.当想修改一个程序时先找到这个程序的位置大部分只要修改framework 和package 两个文件夹下的内容4.关键字例如要修改statuBars。先使用hierarchyviewer查看statuBar属于那个部分。5.根据图标使用grep在framework中查找对应的位置。6.然后就是修改程序了。frameworks/base/services/Java/com/android/server/wm/WindowManagerService.java关键代码行6618 computeScreenConfigurationLocked()方法中[java] view plaincopy在CODE上查看代码片派生到我的代码片boolean hardKeyboardAvailable config.keyboard! Configuration.KEYBOARD_NOKEYS;if (hardKeyboardAvailable ! mHardKeyboardAvailable) {                  mHardKeyboardAvailable hardKeyboardAvailable;mHardKeyboardEnabled !hardKeyboardAvailable;mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);}              if (!mHardKeyboardEnabled) {                  config.keyboard Configuration.KEYBOARD_NOKEYS;}将mHardKeyboardEnabled直接改成false这样改软键盘是能用但是物理键盘是用不了的最后研究代码frameworks\base\services\core\java\com\android\server\wm\WindowManagerService.java如果把updateShowImeWithHardKeyboard方法中的showImeWithHardKeyboard变量直接置为true则可以实现软键盘与物理键盘的同时使用但此举修改影响范围很大不推荐。publicvoidupdateShowImeWithHardKeyboard() {//modified by Janning for enble the HardKeyboard startfinalbooleanshowImeWithHardKeyboard Settings.Secure.getIntForUser(                mContext.getContentResolver(), Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,0,                mCurrentUserId) 1;//final boolean showImeWithHardKeyboard true;//modified by Janning for enble the HardKeyboard endsynchronized(mWindowMap) {if(mShowImeWithHardKeyboard ! showImeWithHardKeyboard) {                mShowImeWithHardKeyboard showImeWithHardKeyboard;                mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);            }        }    }后续继续研究代码发现在WindowManagerService.java的computeScreenConfigurationLocked方法中有通过判断当前物理键盘类型来控制是否同时启用软件盘的处理逻辑boolean computeScreenConfigurationLocked(Configuration config) {        if (!mDisplayReady) {            return false;}        // TODO(multidisplay): For now, apply Configuration to main screen only.        final DisplayContent displayContent getDefaultDisplayContentLocked();// Use the effectivevisualdimensions based on current rotation        final boolean rotated (mRotation Surface.ROTATION_90                || mRotation Surface.ROTATION_270);final int realdw rotated ?                displayContent.mBaseDisplayHeight: displayContent.mBaseDisplayWidth;final int realdh rotated ?                displayContent.mBaseDisplayWidth: displayContent.mBaseDisplayHeight;int dw realdw;int dh realdh;if (mAltOrientation) {            if (realdw realdh) {                // Turn landscape into portrait.                int maxw (int)(realdh/1.3f);if (maxw realdw) {                    dw maxw;}            } else {                // Turn portrait into landscape.                int maxh (int)(realdw/1.3f);if (maxh realdh) {                    dh maxh;}            }        }        if (config ! null) {            config.orientation (dw dh) ? Configuration.ORIENTATION_PORTRAIT :                    Configuration.ORIENTATION_LANDSCAPE;}        // Update application display metrics.        final int appWidth mPolicy.getNonDecorDisplayWidth(dw, dh, mRotation);final int appHeight mPolicy.getNonDecorDisplayHeight(dw, dh, mRotation);final DisplayInfo displayInfo displayContent.getDisplayInfo();synchronized(displayContent.mDisplaySizeLock) {            displayInfo.rotation mRotation;displayInfo.logicalWidth dw;displayInfo.logicalHeight dh;displayInfo.logicalDensityDpi displayContent.mBaseDisplayDensity;displayInfo.appWidth appWidth;displayInfo.appHeight appHeight;displayInfo.getLogicalMetrics(mRealDisplayMetrics,                    CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO, null);displayInfo.getAppMetrics(mDisplayMetrics);mDisplayManagerInternal.setDisplayInfoOverrideFromWindowManager(                    displayContent.getDisplayId(), displayInfo);}        if (false) {            Slog.i(TAG,Set app display size: appWidth x appHeight);}        final DisplayMetrics dm mDisplayMetrics;mCompatibleScreenScale CompatibilityInfo.computeCompatibleScaling(dm,                mCompatDisplayMetrics);if (config ! null) {            config.screenWidthDp (int)(mPolicy.getConfigDisplayWidth(dw, dh, mRotation)                    / dm.density);config.screenHeightDp (int)(mPolicy.getConfigDisplayHeight(dw, dh, mRotation)                    / dm.density);computeSizeRangesAndScreenLayout(displayInfo, rotated, dw, dh, dm.density, config);config.compatScreenWidthDp (int)(config.screenWidthDp/ mCompatibleScreenScale);config.compatScreenHeightDp (int)(config.screenHeightDp/ mCompatibleScreenScale);config.compatSmallestScreenWidthDp computeCompatSmallestWidth(rotated, dm, dw, dh);config.densityDpi displayContent.mBaseDisplayDensity;// Update the configuration based on available input devices, lid switch,            //andplatform configuration.            config.touchscreen Configuration.TOUCHSCREEN_NOTOUCH;config.keyboard Configuration.KEYBOARD_NOKEYS;config.navigation Configuration.NAVIGATION_NONAV;int keyboardPresence 0;int navigationPresence 0;final InputDevice[] devices mInputManager.getInputDevices();final int len devices.length;for (int i 0; i len; i) {InputDevice device devices[i];if (!device.isVirtual()) {                    final int sources device.getSources();final int presenceFlag device.isExternal() ?                            WindowManagerPolicy.PRESENCE_EXTERNAL :                                    WindowManagerPolicy.PRESENCE_INTERNAL;if (mIsTouchDevice) {                        if ((sources InputDevice.SOURCE_TOUCHSCREEN)                                 InputDevice.SOURCE_TOUCHSCREEN) {                            config.touchscreen Configuration.TOUCHSCREEN_FINGER;}                    } else {                        config.touchscreen Configuration.TOUCHSCREEN_NOTOUCH;}                    if ((sources InputDevice.SOURCE_TRACKBALL) InputDevice.SOURCE_TRACKBALL) {                        config.navigation Configuration.NAVIGATION_TRACKBALL;navigationPresence | presenceFlag;} else if ((sources InputDevice.SOURCE_DPAD) InputDevice.SOURCE_DPAD                            config.navigation Configuration.NAVIGATION_NONAV) {                        config.navigation Configuration.NAVIGATION_DPAD;navigationPresence | presenceFlag;}                    // 判断该物理设备的类型 InputDevice.KEYBOARD_TYPE_ALPHABETIC 是表示物理键盘设备                    if (device.getKeyboardType() InputDevice.KEYBOARD_TYPE_ALPHABETIC) {                        config.keyboard Configuration.KEYBOARD_QWERTY;keyboardPresence | presenceFlag;}                    // 获取物理设备名称判断是否是指定的名称如果是则把 config.keyboard// 的属性置为 Configuration.KEYBOARD_NOKEYS 如此则可以同时兼容软键盘                    // 物理键盘与软键盘可以同时启用                    //Addby Janning start                    // for show IME with HardKeyboard                    if (device.getName().equals(XXX-vinput-keypad)) {                        Slog.w(SLCODE,the hard device name is: device.getName());config.keyboard Configuration.KEYBOARD_NOKEYS;}                    //Addby Janning end                }            }            if (config.navigation Configuration.NAVIGATION_NONAV mHasPermanentDpad) {                config.navigation Configuration.NAVIGATION_DPAD;navigationPresence | WindowManagerPolicy.PRESENCE_INTERNAL;}            // Determine whether a hard keyboard is availableandenabled.            boolean hardKeyboardAvailable config.keyboard! Configuration.KEYBOARD_NOKEYS;if (hardKeyboardAvailable ! mHardKeyboardAvailable) {                mHardKeyboardAvailable hardKeyboardAvailable;mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);}            if (mShowImeWithHardKeyboard) {                config.keyboard Configuration.KEYBOARD_NOKEYS;}            // Let the policy update hidden states.            config.keyboardHidden Configuration.KEYBOARDHIDDEN_NO;config.hardKeyboardHidden Configuration.HARDKEYBOARDHIDDEN_NO;config.navigationHidden Configuration.NAVIGATIONHIDDEN_NO;mPolicy.adjustConfigurationLw(config, keyboardPresence, navigationPresence);}        return true;}    public boolean isHardKeyboardAvailable() {        synchronized (mWindowMap) {            return mHardKeyboardAvailable;}    }    public void updateShowImeWithHardKeyboard() {        // 此处修改也可以实现物理键盘与软键盘的同时启用即把showImeWithHardKeyboard 直接置为 true        // 但此方法影响太大不推荐该方案建议根据设备名称判断 修改config.keyboard属性值(代码见上文)        //changed by Janning start        //modified by Janning for enble the HardKeyboard start        final boolean showImeWithHardKeyboard Settings.Secure.getIntForUser(                mContext.getContentResolver(), Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,0,                mCurrentUserId) 1;//final boolean showImeWithHardKeyboard true;//modified by Janning for enble the HardKeyboard end        //changed by Janning end        synchronized (mWindowMap) {            if (mShowImeWithHardKeyboard ! showImeWithHardKeyboard) {                mShowImeWithHardKeyboard showImeWithHardKeyboard;mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);}        }    }当插入物理键盘后通知栏会弹出相应的选择键盘布局通知对于该通知可以选择隐藏根据字符串查找到是在 frameworks\base\services\core\java\com\android\server\input\InputManagerService.java 中调用显示该通知的进一步分析代码发现是在 deliverInputDevicesChanged 方法中控制通知的显示。InputManagerService.javaprivatevoiddeliverInputDevicesChanged(InputDevice[] oldInputDevices) {        。。。。。。。。。。。。。。。。if(missingLayoutForExternalKeyboard) {if(missingLayoutForExternalKeyboardAdded) {if(multipleMissingLayoutsForExternalKeyboardsAdded) {// We have more than one keyboard missing a layout, so drop the// user at the generic input methods page so they can pick which// one to set.showMissingKeyboardLayoutNotification(null);                    }else{// 如果只插入了一个物理键盘则判断该物理键盘的名称是否是指定的如果是则不让其显示键盘布局的通知// Modify by Janning beginif(keyboardMissingLayout !null !keyboardMissingLayout.getName().equals(XXXX-vinput-keypad)) {                            showMissingKeyboardLayoutNotification(keyboardMissingLayout);                        }// Modify by Janning end}                }            }elseif(mKeyboardLayoutNotificationShown) {                hideMissingKeyboardLayoutNotification();            }        }        mTempFullKeyboards.clear();    }操作步骤(不具体说明)1.下载好ubuntu系统之后。2.在找到sdk位置(就是你的SDK 找到你用的那个系统在到ubuntu修改)。………………………..(做起来不是这么简单)3.再用ub系统上生成.jar再放在SDK里面有问题
http://www.pierceye.com/news/897188/

相关文章:

  • 网站是如何制作的工厂 电商网站建设
  • 展览设计网站有哪些南海网站智能推广
  • 贵阳做网站需要多少钱凡科网站建设完成下载下载器
  • 虚拟机上做钓鱼网站照片网站怎么做
  • 建网页和建网站编程猫少儿编程app下载
  • 网站首页介绍cms系统架构
  • 建设厅的工程造价网站东莞网站优化方式
  • 微信网站模板源码wordpress如何编辑
  • 做网站p图工具公司网站建设教程
  • 网站 选项卡 图标苏州网站网页设计
  • 柳州网站建设优化推广wordpress 不显示菜单
  • 网站死循环网站备案和域名备案区别
  • 做网站要学会什么语言装修公司网站模板下载
  • 门户网站建设自查报告网站关键词快速排名技术
  • 如何建网站费用多少全国工商企业查询平台
  • 兰州新区建站什么是网络营销取得成功的基础
  • 南昌 网站 公司wordpress迁移后媒体库丢失
  • 做移动网站点击软件cnzz网站建设
  • 高质量网站外链建设大揭秘做网站之前需要准备什么条件
  • 睢宁做网站百度一下做网站
  • 做国外购物网站国家高职示范校建设网站
  • 网站建设福州公司山西省大同市网站建设公司
  • 浙江网站建设推荐wordpress 增加小工具
  • 个人网站是商业的吗北京网站建设设计
  • 手机网站收费怎么停止网站
  • 网站建设 金疙瘩计划杭州小程序制作公司排行榜
  • 德泰诺网站建设软件著作权登记证书
  • 商标设计网页seo外包公司兴田德润官方地址
  • 网站开发人员岗位成功营销案例分享
  • 赤峰做网站的公司湘潭哪里做网站