Android 13.0 grants app runtime permission by default when booting for the first time (remove the runtime authorization pop-up window)

1 Overview

  In the development of the 13.0 system product, the application for permission after android6.0 needs to be dynamically applied, so after the system is started for the first time, when the app is run for the first time, an authorization window will pop up, allowing the user to manually authorize the app to run Time permission, because the system product development needs to grant the app runtime permission by default, and the user does not need to grant the runtime pop-up window by default, so it is necessary to grant all apps the runtime permission by default at the first boot. Next, analyze the relevant process of dynamic permission authorization
. to implement the default authorization

 

2. The core class of the solution that grants the app runtime permission by default (remove the runtime authorization pop-up window) by default when booting for the first time

   frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
    frameworks/base/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java

3. The core function analysis and implementation of app runtime permission (removing the runtime authorization pop-up window) is granted by default when the app is powered on for the first time

  In the process of starting the android system, PMS is a system service of the Android system, which is mainly used to manage the installation, uninstallation and update of application programs. It will be started when the system starts and managed by the system process.
In the system, the PMS is responsible for app installation and uninstallation authorization, etc. The default runtime permissions granted to the app will be granted in DefaultPermissionGrantPolicy.java according to requirements. Permissions, so
the default permissions granted to the app at the first boot can also be set in Def

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132515466