Oreo(API 26) - drawOverlay +绘制状态栏

pro*_*m85 15 permissions android overlay android-windowmanager android-8.0-oreo

在android oreo中,我不能再使用WindowManager.LayoutParams.TYPE_SYSTEM_ERROR了,必须使用WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY.缺点是,此模式不会覆盖状态栏.

反正有没有实现旧的行为,并能够绘制状态栏?我有一个侧边栏应用程序,直到现在,我允许用户在屏幕顶部也有触发区域,现在不再工作,因为状态栏现在重叠在顶部的可触摸区域...

我对任何解决方案感兴趣,即使它仅适用于某些设备,例如root设备......因为我认为这个问题没有正常的解决方案,因为android系统不再允许这样做,如文档中所述(https://developer.android.com/about/versions/oreo/android-8.0-changes.html#o-apps).不过,这并不意味着没有替代解决方案......

sfr*_*ini 1

文档表示,该标志对于非系统应用程序已被弃用。您是否尝试过将应用程序设为系统应用程序?

\n\n
\n

对于非系统应用程序,此常量在 API 级别 26 中已弃用。

\n
\n\n

以下是使用 ES 文件资源管理器的方法:

\n\n
Configure ES File Explorer by doing the following steps:\n    Launch ES File Explorer.\n    Select Menu and choose Settings.\n    Under Settings, enable the options for Up to root and Root Explorer. A message will appear, requiring you to confirm your action. You will also need to confirm Superuser access.\n    Enable Mount File System.\n    Go back to the app\xe2\x80\x99s main menu.\nGet a copy of the APK (Android Package) of the app that you want to save as a system file by doing the following steps (skip to step 3 if you already have the app\xe2\x80\x99s APK file):\n    Install an app from the Google Play Store. For this guide, we will be using the app BioRhythms as an example.\n    Launch ES File Explorer and navigate to /data/app.\n    Locate the APK file that you want to install as a system app. If you don\xe2\x80\x99t know the APK\xe2\x80\x99s filename, simply go to the Google Play Store link of your chosen app. View the link and take note of the words after \xe2\x80\x9c?id=\xe2\x80\x9d. This will be your APK\xe2\x80\x99s filename. For instance, the BioRhythms app link is https://play.google.com/store/apps/details?id=app.biorhythms. The BioRhythms\xe2\x80\x99 APK is app.biorhythms-1.apk.\nCreate a backup of the chosen APK by copying it to the phone\xe2\x80\x99s SD Card.\nAfter creating a backup, long tap on the APK file and a menu will appear. Choose Cut. A blue arrow will appear at the bottom of the screen.\nGo back to the main menu and navigate to /system/app/.\nDrag the little arrow at the bottom of the screen. It will bring up the icon of the APK file.\nTap the APK file and it will be transferred to /system/app/.\nFind the APK file in /system/app/. Press and hold it and a menu will appear.\nSelect Properties on the menu. The dialog properties will show up.\nTap Change and it will show the permissions dialog box.\nCheck the boxes for the following permissions in the dialog box:\n    User: Read and Write\n    Group: Read\n    Other: Read\nSelect OK once the required settings have been made.\nReboot your device.\n
Run Code Online (Sandbox Code Playgroud)\n