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);
}
相关推荐
StarsGreen15 小时前
Android ADB(Android Debug Bridge)命令详解
android
阿健君16 小时前
现代 Android 屏幕适配完全指南
android·kotlin
软件交付观察室17 小时前
用户关掉手机定位权限后,原生App还能显示哪些位置?
android·ios·移动开发
黄林晴18 小时前
Jetpack Compose 1.13.0 来了:大量 API 弃用,表单代码要重构
android·android jetpack
黄林晴18 小时前
Kotlin Toolchain 太牛了!一个提示词就能构建 KMP 双端应用
android·kotlin
黄林晴18 小时前
KMP 跨端共享资源别踩坑!composeResources 看着香,上线容易翻车
android
黄林晴18 小时前
Gradle 9.9.0发布,构建速度提升65%!
android·gradle
黄林晴18 小时前
Android 开了 R8,为什么 SDK 还在阻止优化?
android·google
黄林晴18 小时前
Android CLI 1.1真香:直连 Crashlytics,自助查崩溃、ANR
android·ai编程
黄林晴18 小时前
Android Studio Stingray 1 来了:AI 模型可按任务分开选
android·android studio