高通平台源代码更改

diff --git a/frameworks/base/packages/SystemUI/res/values/config.xml b/frameworks/base/packages/SystemUI/res/values/config.xml
index 22180dc..7e6c813 100644
--- a/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -381,7 +381,7 @@
     </string-array>
 
     <!-- Nav bar button default ordering/layout -->
-    <string name="config_navBarLayout" translatable="false">left[.5W],back[1WC];home;recent[1WC],right[.5W]</string>
+    <string name="config_navBarLayout" translatable="false">left[.5W],back[1WC];home,recent;hide[1WC],right[.5W]</string>
     <string name="config_navBarLayoutQuickstep" translatable="false">back[1.7WC];home;contextual[1.7WC]</string>
 
     <bool name="quick_settings_show_full_alarm">false</bool>
diff --git a/frameworks/base/packages/SystemUI/res/values/strings.xml b/frameworks/base/packages/SystemUI/res/values/strings.xml
index 79eeaac..bad63a4 100644
--- a/frameworks/base/packages/SystemUI/res/values/strings.xml
+++ b/frameworks/base/packages/SystemUI/res/values/strings.xml
@@ -220,6 +220,7 @@
     <string name="accessibility_home">Home</string>
     <!-- Content description of the menu button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
     <string name="accessibility_menu">Menu</string>
+    <string name="accessibility_hide">Hide</string>
     <!-- Content description of the accessibility button in the navigation bar (not shown on the screen). [CHAR LIMIT=NONE] -->
     <string name="accessibility_accessibility_button">Accessibility</string>
     <!-- Content description of the rotate button in the navigation bar (not shown on the screen). [CHAR LIMIT=NONE] -->
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
index e6f2c33..74c7ada 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
@@ -69,6 +69,7 @@ public class NavigationBarInflaterView extends FrameLayout
     public static final String LEFT = "left";
     public static final String RIGHT = "right";
     public static final String CONTEXTUAL = "contextual";
+    public static final String HIDE = "hide";
 
     public static final String GRAVITY_SEPARATOR = ";";
     public static final String BUTTON_SEPARATOR = ",";
@@ -256,7 +257,7 @@ public class NavigationBarInflaterView extends FrameLayout
         if (newLayout == null) {
             newLayout = getDefaultLayout();
         }
-        String[] sets = newLayout.split(GRAVITY_SEPARATOR, 3);
+        String[] sets = newLayout.split(GRAVITY_SEPARATOR, 3);
         if (sets.length != 3) {
             Log.d(TAG, "Invalid layout.");
             newLayout = getDefaultLayout();
@@ -269,16 +270,17 @@ public class NavigationBarInflaterView extends FrameLayout
         inflateButtons(start, mRot0.findViewById(R.id.ends_group), isRot0Landscape, true);
         inflateButtons(start, mRot90.findViewById(R.id.ends_group), !isRot0Landscape, true);
 
-        inflateButtons(center, mRot0.findViewById(R.id.center_group), isRot0Landscape, false);
-        inflateButtons(center, mRot90.findViewById(R.id.center_group), !isRot0Landscape, false);
+        inflateButtons(center, mRot0.findViewById(R.id.ends_group), isRot0Landscape, false);
+        inflateButtons(center, mRot90.findViewById(R.id.ends_group), !isRot0Landscape, false);
 
-        addGravitySpacer(mRot0.findViewById(R.id.ends_group));
-        addGravitySpacer(mRot90.findViewById(R.id.ends_group));
+        //addGravitySpacer(mRot0.findViewById(R.id.ends_group));
+        //addGravitySpacer(mRot90.findViewById(R.id.ends_group));
 
         inflateButtons(end, mRot0.findViewById(R.id.ends_group), isRot0Landscape, false);
         inflateButtons(end, mRot90.findViewById(R.id.ends_group), !isRot0Landscape, false);
 
         updateButtonDispatchersCurrentView();
+
     }
 
     private void addGravitySpacer(LinearLayout layout) {
@@ -393,7 +395,9 @@ public class NavigationBarInflaterView extends FrameLayout
             v = inflater.inflate(R.layout.clipboard, parent, false);
         } else if (CONTEXTUAL.equals(button)) {
             v = inflater.inflate(R.layout.contextual, parent, false);
-        } else if (button.startsWith(KEY)) {
+         }else if (HIDE.equals(button)) {
+            v = inflater.inflate(R.layout.hide, parent, false);
+        } else if (button.startsWith(KEY)) {
             String uri = extractImage(button);
             int code = extractKeycode(button);
             v = inflater.inflate(R.layout.custom_key, parent, false);
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 2a1f92f..e7928f5 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -124,6 +124,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
     private KeyButtonDrawable mBackAltCarModeIcon, mBackAltLandCarModeIcon;
     private KeyButtonDrawable mHomeDefaultIcon, mHomeCarModeIcon;
     private KeyButtonDrawable mRecentIcon;
+    private KeyButtonDrawable mHideIcon;
     private KeyButtonDrawable mDockedIcon;
     private KeyButtonDrawable mImeIcon;
     private KeyButtonDrawable mMenuIcon;
@@ -215,6 +216,14 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                     .showInputMethodPicker(true /* showAuxiliarySubtypes */);
         }
     };
+    
+    private final OnClickListener mHideClickListener = new OnClickListener() {
+        @Override
+        public void onClick(View view) {
+            //
+        }
+    };
+
 
     private class H extends Handler {
         public void handleMessage(Message m) {
@@ -291,6 +300,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
         mButtonDispatchers.put(R.id.back, new ButtonDispatcher(R.id.back));
         mButtonDispatchers.put(R.id.home, new ButtonDispatcher(R.id.home));
         mButtonDispatchers.put(R.id.recent_apps, new ButtonDispatcher(R.id.recent_apps));
+        mButtonDispatchers.put(R.id.hide,new ButtonDispatcher(R.id.hide));
         mButtonDispatchers.put(R.id.menu, new ButtonDispatcher(R.id.menu));
         mButtonDispatchers.put(R.id.ime_switcher, new ButtonDispatcher(R.id.ime_switcher));
         mButtonDispatchers.put(R.id.accessibility_button,
@@ -419,6 +429,10 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
     public ButtonDispatcher getImeSwitchButton() {
         return mButtonDispatchers.get(R.id.ime_switcher);
     }
+    
+    public ButtonDispatcher getHideButton() {
+        return mButtonDispatchers.get(R.id.hide);
+    }
 
     public ButtonDispatcher getAccessibilityButton() {
         return mButtonDispatchers.get(R.id.accessibility_button);
@@ -485,6 +499,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                 || oldConfig.getLayoutDirection() != newConfig.getLayoutDirection()) {
             mBackIcon = getBackDrawable(lightContext, darkContext);
             mRecentIcon = getDrawable(lightContext, darkContext, R.drawable.ic_sysbar_recent);
+            mHideIcon = getDrawable(lightContext, darkContext, R.drawable.ic_sysbar_hide);
             mMenuIcon = getDrawable(lightContext, darkContext, R.drawable.ic_sysbar_menu);
 
             mAccessibilityIcon = getDrawable(lightContext, darkContext,
@@ -636,6 +651,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                         ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_IME_SHOWN) != 0);
         getImeSwitchButton().setVisibility(showImeButton ? View.VISIBLE : View.INVISIBLE);
         getImeSwitchButton().setImageDrawable(mImeIcon);
+        getHideButton().setImageDrawable(mHideIcon);
 
         // Update menu button, visibility logic in method
         setMenuVisibility(mShowMenu, true);
@@ -903,6 +919,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
         mNavigationInflaterView.setButtonDispatchers(mButtonDispatchers);
 
         getImeSwitchButton().setOnClickListener(mImeSwitcherClickListener);
+        getHideButton().setOnClickListener(mHideClickListener);
 
         DockedStackExistsListener.register(mDockedListener);
         updateRotatedViews();
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 7bdeab0..4fe256f 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -525,6 +525,22 @@ public class StatusBar extends SystemUI implements DemoMode,
             mScrimController.setWallpaperSupportsAmbientMode(supportsAmbientMode);
         }
     };
+    
+    private BroadcastReceiver mOemHideNavigationReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            //int requested = mSystemUiVisibility | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+            //    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+            //if (mSystemUiVisibility != requested) {
+            //    notifyUiVisibilityChanged(requested);
+            //}
+            if (mNavigationBarView != null) {
+                removeNavigationBar();
+            }else{
+                createNavigationBar();
+            }
+        }
+    };
 
     private Runnable mLaunchTransitionEndRunnable;
     protected boolean mLaunchTransitionFadingAway;
@@ -713,6 +729,9 @@ public class StatusBar extends SystemUI implements DemoMode,
         IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
         mContext.registerReceiver(mWallpaperChangedReceiver, wallpaperChangedFilter);
         mWallpaperChangedReceiver.onReceive(mContext, null);
+        
+        IntentFilter oemIntentFilter = new IntentFilter("com.oem.hide_navigation");
+        mContext.registerReceiver(mOemHideNavigationReceiver, oemIntentFilter);
 
         mLockscreenUserManager.setUpWithPresenter(this, mEntryManager);
         mCommandQueue.disable(switches[0], switches[6], false /* animate */);
@@ -1075,6 +1094,13 @@ public class StatusBar extends SystemUI implements DemoMode,
             mNavigationBar.setCurrentSysuiVisibility(mSystemUiVisibility);
         });
     }
+    
+    protected void removeNavigationBar() {
+        if (mNavigationBarView != null) {
+            mWindowManager.removeViewImmediate(mNavigationBarView);
+            mNavigationBarView = null;
+        }
+    }
 
     /**
      * Returns the {@link android.view.View.OnTouchListener} that will be invoked when the
diff --git a/frameworks/base/packages/SystemUI/tests/Android.mk b/frameworks/base/packages/SystemUI/tests/Android.mk
deleted file mode 100644
index 6868688..0000000
--- a/frameworks/base/packages/SystemUI/tests/Android.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_USE_AAPT2 := true
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JACK_FLAGS := --multi-dex native
-LOCAL_DX_FLAGS := --multi-dex
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/..
-LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors
-
-LOCAL_PACKAGE_NAME := SystemUITests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := device-tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-Iaidl-files-under, src) \
-    $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
-    frameworks/base/packages/SystemUI/res \
-    frameworks/base/packages/SystemUI/res-keyguard \
-
-LOCAL_STATIC_ANDROID_LIBRARIES := \
-    SystemUIPluginLib \
-    SystemUISharedLib \
-    android-support-car \
-    android-support-v4 \
-    android-support-v7-recyclerview \
-    android-support-v7-preference \
-    android-support-v7-appcompat \
-    android-support-v7-mediarouter \
-    android-support-v7-palette \
-    android-support-v14-preference \
-    android-support-v17-leanback \
-    android-slices-core \
-    android-slices-view \
-    android-slices-builders \
-    android-arch-core-runtime \
-    android-arch-lifecycle-extensions \
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    metrics-helper-lib \
-    android-support-test \
-    mockito-target-inline-minus-junit4 \
-    SystemUI-proto \
-    SystemUI-tags \
-    testables \
-    truth-prebuilt \
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libdexmakerjvmtiagent \
-    libmultiplejvmtiagentsinterferenceagent
-
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner \
-    telephony-common \
-    android.test.base \
-    android.car \
-    ims-common
-
-LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard
-
-# sign this with platform cert, so this test is allowed to inject key events into
-# UI it doesn't own. This is necessary to allow screenshots to be taken
-LOCAL_CERTIFICATE := platform
-
-# Provide jack a list of classes to exclude from code coverage.
-# This is needed because the SystemUITests compile SystemUI source directly, rather than using
-# LOCAL_INSTRUMENTATION_FOR := SystemUI.
-#
-# We want to exclude the test classes from code coverage measurements, but they share the same
-# package as the rest of SystemUI so they can't be easily filtered by package name.
-#
-# Generate a comma separated list of patterns based on the test source files under src/
-# SystemUI classes are in ../src/ so they won't be excluded.
-# Example:
-#   Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java
-#   Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest*
-
-# Filter all src files under src/ to just java files
-local_java_files := $(filter %.java,$(call all-java-files-under, src))
-# Transform java file names into full class names.
-# This only works if the class name matches the file name and the directory structure
-# matches the package.
-local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
-local_comma := ,
-local_empty :=
-local_space := $(local_empty) $(local_empty)
-# Convert class name list to jacoco exclude list
-# This appends a * to all classes and replace the space separators with commas.
-jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
-
-LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*
-LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude)
-
-include frameworks/base/packages/SettingsLib/common.mk
-
-ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
-    include $(BUILD_PACKAGE)
-endif
-
-# Reset variables
-local_java_files :=
-local_classes :=
-local_comma :=
-local_space :=
-jacoco_exclude :=
diff --git a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
index a58c2c6..cc6f4dc 100644
--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -2244,9 +2244,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     }
                     @Override
                     public void onSwipeFromBottom() {
-                        if (mNavigationBar != null && mNavigationBarPosition == NAV_BAR_BOTTOM) {
-                            requestTransientBars(mNavigationBar);
-                        }
+                        if (mNavigationBar == null && mNavigationBarPosition == NAV_BAR_BOTTOM) {
+                            //requestTransientBars(mNavigationBar);
+                            Intent oemIntent = new Intent("com.oem.hide_navigation");
+                            oemIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
+                            oemIntent.setPackage("com.android.systemui");
+                            mContext.sendOrderedBroadcastAsUser(oemIntent, UserHandle.CURRENT_OR_SELF, null, null, null, Activity.RESULT_OK, null, null);
+                        }
                     }
                     @Override
                     public void onSwipeFromRight() {
@@ -3710,6 +3714,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 return -1;
             }
         }
+        
+        if (keyCode == KeyEvent.KEYCODE_F3) {
+            if(down){
+                Intent oemIntent = new Intent("com.oem.hide_navigation");
+                oemIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
+                oemIntent.setPackage("com.android.systemui");
+                mContext.sendOrderedBroadcastAsUser(oemIntent, UserHandle.CURRENT_OR_SELF, null, null, null, Activity.RESULT_OK, null, null);
+            }
+        }
 
         if(keyCode == KeyEvent.KEYCODE_F11 || keyCode == KeyEvent.KEYCODE_F12){

删除/frameworks/base/packages/SystemUI/tests/Android.mk

编译指令:mmm frameworks/base/packages/SystemUI/

参考

https://blog.csdn.net/cuckoochun/article/details/84109895

https://blog.csdn.net/kuaiguixs/article/details/78291695

Android 8/9高通平台客制化虚拟导航按键隐藏相关推荐

  1. android 7.0平台客制化虚拟导航按键(隐藏NavigationBar,上滑显示NavigationBar)

    如图,需求是增加一个按钮可以隐藏NavigationBar,上滑显示NavigationBar. 参考文章: Android 8.1平台客制化虚拟导航按键 Android 7.0 虚拟按键(Navig ...

  2. Android 8.1平台客制化虚拟导航按键

    文章目录 @[toc] 需求 运行截图 代码修改步骤 欢迎关注公众号,给你更多技术干货: 需求 基于MTK8163 8.1平台定制导航栏部分,在左边增加音量减,右边增加音量加 运行截图 代码修改步骤 ...

  3. android 高通平台有前途吗,华为鸿蒙计划要适配高通平台了,可以告别安卓搭载鸿蒙OS了?...

    鸿蒙走出这一步是可以想象到的,看来华为打造这个系统希望的结果是万物皆可盘呀,所以一开始就提出了开源,也就意味着这次是高通,下次就可以是联发科,甚至更多的手机品牌也完全就可以搭载!早期我们一直在说国产手 ...

  4. Android高通平台调试Camera驱动全纪录

    项目比较紧,3周内把一个带有外置ISP,MIPI数据通信,800万像素的camera从无驱动到实现客户全部需求. 1日 搭平台,建环境,编译内核,烧写代码. 我是一直在Window下搭个虚拟机登服务器 ...

  5. Android系统高通平台新增lunch选项

    Android系统高通平台新增lunch选项 创建xxx目录 device/qcom/xxx 目录里添加必要的内容 device/qcom/common/vendorsetup.sh添加 add_lu ...

  6. 请把Camera hold住 - Android高通平台调试Camera驱动全纪录

    项目比较紧,3周内把一个带有外置ISP,MIPI数据通信,800万像素的camera从无驱动到实现客户全部需求. 1日 搭平台,建环境,编译内核,烧写代码. 我是一直在Window下搭个虚拟机登服务器 ...

  7. android 4.4.2 去除漫游r,Android 4.4.3应用,高通平台 去掉应用

    android 4.4.3 高通平台那些apk android 一 .packages/apps BasicMmsReceiver Bluetooth Browser Calculator Calen ...

  8. [Linux Device Driver] 高通平台分区学习

    1. 分区名字 && 作用 ssd ---ssd diag模块的分区,存储加密的RSA密钥. persist ---其中包含在设备出厂后不应该更改的数据,例如:芯片的校准数据(WIFI ...

  9. 关于高通平台王者荣耀,和平精英等游戏杂音问题

    关于高通平台王者荣耀,和平精英等游戏杂音问题 今天我将为大家讲述我在音频开发处理的第一个问题,王者荣耀的登录pop音问题. 问题描述:最新版本的手机上,安装了王者荣耀,和平精英,消消乐等游戏APP,可 ...

最新文章

  1. 动态规划和分治法的区别
  2. 绝对干货,教你4分钟插入1000万条数据到mysql数据库表,快快进来
  3. poj12652954 [皮克定理 格点多边形]【学习笔记】
  4. :寻找指定和的整数对_寻找时间:如何增加设计的时间
  5. 响应式开发中合理选定CSS媒体查询分割点
  6. datatable 转list
  7. 搭建PHP官方框架zend framework 2(LINUX)
  8. matlab repmat 函数的使用
  9. Web开发入门型服务器使用心得
  10. 利用ArcGIS Pro对疫情数据进行分析并可视化
  11. oracle select into from 用法,数据库插入数据之select into from与insert into select区别详解...
  12. Ubuntu 16.04 解决WPS for Linux提示“系统缺失字体symbol、wingdings、wingdings 2、wingdings 3、webding”的问题
  13. python pyd_python项目(.pyd或者.so)代码加密
  14. Android Studio App设置背景图片
  15. 树结构——2-3树图解
  16. sv_labs学习笔记——sv_lab1(System Verilog)
  17. 制作elasticsearch 镜像_相册视频制作-相册视频制作App下载-
  18. 2019年蚂蚁金服面经(已拿Offer)!附答案!!
  19. 微信开发(三)创建菜单
  20. [__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x7a97d4c0'报错

热门文章

  1. 小米10防误触模式开启教程(方法分享)
  2. 基于vue实现滑动验证码
  3. ElasticSearch 搜索引擎
  4. 李宁地胶网柱球网裁判椅价格表
  5. 盘点2021年手机市场,苹果、台积电和联发科大都是赢家
  6. MySQL Date 函数,统计当天、一周、一月等的数据
  7. 【观察】618亮眼成绩单背后 京东零售基础设施释放新价值
  8. 毕业论文封面无页码,罗马数字,阿拉伯数字
  9. java实现excel竖排数据导出并设置样式
  10. WAP技术研究综述(转)