owner用户下,进程优先级IMPORTANCE_FOREGROUND
其他用户或者Guest用户下进程优先级是IMPORTANCE_SERVICE
这是什么原因?代码主要是运行一个常驻后台的service,AndroidManifest.xml文件定义如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.privacyprotection"
android:sharedUserId="android.uid.system"
android:versionCode="1"
android:versionName="1.0.0" >
<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="24" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.MANAGE_FINGERPRINT" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<application
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:persistent="true"
android:theme="@style/AppTheme" >
<service
android:name=".AppsLockService"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.STACK_TOP_CHANGED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<provider android:name=".EncryptAppProvider"
android:authorities="com.android.privacyprotection"
android:exported="true">
</provider>
</application>