android service开机启动权限 自启动权限被禁止 怎么获取?
解决方案
100
PackageManager mPackageManager = context.getPackageManager();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_BOOT_COMPLETED );
List<ResolveInfo> resolveInfoList = mPackageManager.queryBroadcastReceivers(intent, PackageManager.GET_DISABLED_COMPONENTS);
在resolveInfoList中判断能否有你的service。
Intent intent = new Intent();
intent.setAction(Intent.ACTION_BOOT_COMPLETED );
List<ResolveInfo> resolveInfoList = mPackageManager.queryBroadcastReceivers(intent, PackageManager.GET_DISABLED_COMPONENTS);
在resolveInfoList中判断能否有你的service。