高通平台源代码更改

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. Windows Server 2008R2使用web方式修改域账户密码
  2. 利用NavicatPremium把Oracle迁移到MySQL
  3. Spring注解编程基石(二)
  4. win7系统任务管理器如何强制关闭程序
  5. 面向对象编程其实很简单——Python 面向对象(初级篇)
  6. 连续4年财务造假 造假金额过亿!捧红杨幂的欢瑞世纪被重罚
  7. arp***的判断与解决方案总结
  8. 【TCP/IP】【测试】常用抓包软件一览
  9. 进销存库存管理软件哪个好用
  10. 分享功能 集成友盟分享
  11. 网站改造为百度智能小程序教程,适合所有网站封装
  12. 高颜值生物信息在线绘图工具
  13. 记录解决Win10底部任务栏转圈圈问题的过程(Windows假死)
  14. nginx配置访问白名单
  15. eclipse工程报faceted project problem
  16. CTFHub | Refer注入
  17. helm3 使用国内原安装Weave Scope
  18. 某计算机系统20位地址线 8位数据线,同济大学2009-2010(1)微机原理期终考试试题(A卷)...
  19. Java源码——使用BigInteger计算组合数(彩票中奖概率计算示例)
  20. 项目经理和技术经理的区别

热门文章

  1. 2023年大学生如何申请GitHub学生包看这个就够了
  2. 联想文件管理服务器,联想文件管家HD
  3. 神秘的营销武器,让蕾丝内衣店0元送丝袜,10天收9.6万!
  4. RN中布局方式FlexBox、absolute
  5. 下载vscode速度慢或无法下载问题解决
  6. 就业歧视的深层次剖析
  7. Linux中Vi编辑器和Vim编辑器
  8. 互联网摸鱼日报(2022-12-14)
  9. 有没有网络科幻小说可以与《流浪地球》一较高下的?
  10. DOTA-RGD,DOTA-ingr多肽,(68)Ga-DOTA-ingr