MTK Android12 隐藏顶部状态栏

1、解决路径:
复制代码
	(1)vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
	(2)vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
2、方法:

(1)在StatusBar.java类的start()中:

java 复制代码
        RegisterStatusBarResult result = null;
        try {
            result = mBarService.registerStatusBar(mCommandQueue);
        } catch (RemoteException ex) {
            ex.rethrowFromSystemServer();
        }

        createAndAddWindows(result);
        // add start
		mStatusBarWindowController.setBarVisibility(View.GONE);
		// add end
        if (mWallpaperSupported) {
            // Make sure we always have the most current wallpaper info.
            IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
            mBroadcastDispatcher.registerReceiver(mWallpaperChangedReceiver, wallpaperChangedFilter,
                    null /* handler */, UserHandle.ALL);
            mWallpaperChangedReceiver.onReceive(mContext, null);
        } else if (DEBUG) {
            Log.v(TAG, "start(): no wallpaper service ");
        }
(2)在StatusBarWindowController.java类中
java 复制代码
public void setBarVisibility(int visibility) {
        mStatusBarView.setVisibility(visibility);
}
相关推荐
Ehtan_Zheng14 分钟前
Jetpack Compose 动画入门:轻松掌握状态驱动的动画转换
android
Ehtan_Zheng17 分钟前
Jetpack Compose 布局与可见性动画
android
_李小白1 小时前
【android opencv学习笔记】Day 12: HSV 色彩空间
android·opencv·学习
千里马学框架1 小时前
手机大厂Activity嵌套模式及三分屏SplitScreen功能调研报告-独家干货
android·智能手机·分屏·aaos·安卓framework开发·车机·三分屏
Mr.QingBin1 小时前
SystemUI插件开发指南
android
芋只因1 小时前
MySQL 分库分表与 MyCat 的使用
android
Ehtan_Zheng1 小时前
Jetpack Compose 与 RecyclerView 混合布局的性能债
android
Kapaseker2 小时前
MVVM 旧城改造,边界划分各有招
android·kotlin
我滴老baby2 小时前
多智能体协作系统设计当AI学会团队合作效率翻十倍
android·开发语言·人工智能
StockTV3 小时前
新加坡股票API 实时行情、K 线及指数数据
android·java·spring boot·后端·区块链