当前位置: 首页 > news >正文

做网站需要花钱吗西安做网站

做网站需要花钱吗,西安做网站,长春专业做网站的公司有哪些,政府网站建设重要意义需求 CTA入网认证,要求低版本比如Android6以下的应用,运行时,也需要有运行时权限(Runtime Permission)功能,不能默认就取到权限,必须人工在设置中打开才可。 环境 Android 8 实现 frameworks 修改思路是所有APP都…

需求

CTA入网认证,要求低版本比如Android6以下的应用,运行时,也需要有运行时权限(Runtime Permission)功能,不能默认就取到权限,必须人工在设置中打开才可。

环境

Android 8

实现

frameworks
修改思路是所有APP都统一处理,支持运行时权限,
把所有版本相关的判断去掉,检测是否支持运行时权限的判断去掉。

diff --git a/base/services/core/java/com/android/server/pm/PackageInstallerService.java b/base/services/core/java/com/android/server/pm/PackageInstallerService.java
index 1fa37b91..3a3433c9 100644
--- a/base/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/base/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -436,6 +436,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub {params.installFlags |= PackageManager.INSTALL_FROM_ADB;} else {
+            mAppOps = mContext.getSystemService(AppOpsManager.class);mAppOps.checkPackage(callingUid, installerPackageName);params.installFlags &= ~PackageManager.INSTALL_FROM_ADB;
@@ -705,6 +706,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub {@Overridepublic ParceledListSlice<SessionInfo> getMySessions(String installerPackageName, int userId) {mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getMySessions");
+        mAppOps = mContext.getSystemService(AppOpsManager.class);mAppOps.checkPackage(Binder.getCallingUid(), installerPackageName);final List<SessionInfo> result = new ArrayList<>();
diff --git a/base/services/core/java/com/android/server/pm/PackageManagerService.java b/base/services/core/java/com/android/server/pm/PackageManagerService.java
index aa43008b..5f0f66a4 100644
--- a/base/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/base/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -2279,8 +2279,9 @@ public class PackageManagerService extends PackageManagerServiceExAbsfinal int immutableFlags = PackageManager.FLAG_PERMISSION_SYSTEM_FIXED| PackageManager.FLAG_PERMISSION_POLICY_FIXED;-        final boolean supportsRuntimePermissions = pkg.applicationInfo.targetSdkVersion
-                >= Build.VERSION_CODES.M;
+        //final boolean supportsRuntimePermissions = pkg.applicationInfo.targetSdkVersion
+                //>= Build.VERSION_CODES.M;
+        final boolean supportsRuntimePermissions = false;final boolean instantApp = isInstantApp(pkg.packageName, userId);@@ -5884,7 +5885,6 @@ public class PackageManagerService extends PackageManagerServiceExAbs// to keep the review required permission flag per user while an// install permission's state is shared across all users.if (mPermissionReviewRequired
-                    && pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M&& bp.isRuntime()) {return;}
@@ -5918,10 +5918,10 @@ public class PackageManagerService extends PackageManagerServiceExAbs+ name + " for package " + packageName);}-            if (pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
-                Slog.w(TAG, "Cannot grant runtime permission to a legacy app");
-                return;
-            }
+            //if (pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
+                //Slog.w(TAG, "Cannot grant runtime permission to a legacy app");
+                //return;
+            //}final int result = permissionsState.grantRuntimePermission(bp, userId);switch (result) {
@@ -6021,7 +6021,7 @@ public class PackageManagerService extends PackageManagerServiceExAbs// to keep the review required permission flag per user while an// install permission's state is shared across all users.if (mPermissionReviewRequired
-                    && pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M
+                    //&& pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M&& bp.isRuntime()) {return;}
@@ -13615,8 +13615,7 @@ public class PackageManagerService extends PackageManagerServiceExAbsfor (int i=0; i<N; i++) {final String name = pkg.requestedPermissions.get(i);final BasePermission bp = mSettings.mPermissions.get(name);
-            final boolean appSupportsRuntimePermissions = pkg.applicationInfo.targetSdkVersion
-                    >= Build.VERSION_CODES.M;
+            final boolean appSupportsRuntimePermissions = false;if (DEBUG_INSTALL) {Log.i(TAG, "Package " + pkg.packageName + " checking " + name + ": " + bp);
@@ -13676,10 +13675,7 @@ public class PackageManagerService extends PackageManagerServiceExAbs// their permissions as always granted runtime ones since we need// to keep the review required permission flag per user while an// install permission's state is shared across all users.
-                    if (!appSupportsRuntimePermissions && !mPermissionReviewRequired) {
-                        // For legacy apps dangerous permissions are install time ones.
-                        grant = GRANT_INSTALL;
-                    } else if (origPermissions.hasInstallPermission(bp.name)) {
+                    if (origPermissions.hasInstallPermission(bp.name)) {// For legacy apps that became modern, install becomes runtime.grant = GRANT_UPGRADE;} else if (mPromoteSystemApps
@@ -14023,14 +14019,6 @@ public class PackageManagerService extends PackageManagerServiceExAbs}}if (!allowed) {
-            if (!allowed && (bp.protectionLevel
-                    & PermissionInfo.PROTECTION_FLAG_PRE23) != 0
-                    && pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
-                // If this was a previously normal/dangerous permission that got moved
-                // to a system permission as part of the runtime permission redesign, then
-                // we still want to blindly grant it to old apps.
-                allowed = true;
-            }if (!allowed && (bp.protectionLevel & PermissionInfo.PROTECTION_FLAG_INSTALLER) != 0&& pkg.packageName.equals(mRequiredInstallerPackage)) {// If this permission is to be granted to the system installer and
@@ -21325,8 +21313,7 @@ public class PackageManagerService extends PackageManagerServiceExAbs// If permission review is enabled and this is a legacy app, mark the// permission as requiring a review as this is the initial state.int flags = 0;
-            if (mPermissionReviewRequired
-                    && ps.pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) {
+            if (mPermissionReviewRequired) {flags |= FLAG_PERMISSION_REVIEW_REQUIRED;}if (permissionsState.updatePermissionFlags(bp, userId, userSettableMask, flags)) {
@@ -26124,9 +26111,9 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());}// Permission review applies only to apps not supporting the new permission model.
-                if (packageSetting.pkg.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.M) {
-                    return false;
-                }
+                //if (packageSetting.pkg.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.M) {
+                    //return false;
+                //}// Legacy apps have the permission and get user consent on launch.PermissionsState permissionsState = packageSetting.getPermissionsState();

作者:帅得不敢出门 原创文章谢绝转载


文章转载自:
http://popster.dztp.cn
http://snipehunt.dztp.cn
http://oujda.dztp.cn
http://popularize.dztp.cn
http://speedwell.dztp.cn
http://ceremonious.dztp.cn
http://citrange.dztp.cn
http://anchoret.dztp.cn
http://turbocopter.dztp.cn
http://dubee.dztp.cn
http://angling.dztp.cn
http://chippie.dztp.cn
http://autotelegraph.dztp.cn
http://salvershaped.dztp.cn
http://nbs.dztp.cn
http://ides.dztp.cn
http://japanner.dztp.cn
http://naxian.dztp.cn
http://clownade.dztp.cn
http://bedbound.dztp.cn
http://cummin.dztp.cn
http://preconcert.dztp.cn
http://dirtiness.dztp.cn
http://dualism.dztp.cn
http://starlit.dztp.cn
http://scattered.dztp.cn
http://suppletion.dztp.cn
http://aerophile.dztp.cn
http://dahabeeyah.dztp.cn
http://descriptively.dztp.cn
http://metralgia.dztp.cn
http://kwando.dztp.cn
http://corpse.dztp.cn
http://italicise.dztp.cn
http://scleromyxoedema.dztp.cn
http://cotta.dztp.cn
http://jvc.dztp.cn
http://sbc.dztp.cn
http://spectre.dztp.cn
http://inquiet.dztp.cn
http://nephalism.dztp.cn
http://intoxicant.dztp.cn
http://dey.dztp.cn
http://arthrosporic.dztp.cn
http://minicrystal.dztp.cn
http://outspend.dztp.cn
http://legged.dztp.cn
http://timaru.dztp.cn
http://whyever.dztp.cn
http://ophthalmoscopy.dztp.cn
http://hawash.dztp.cn
http://sadi.dztp.cn
http://inappreciable.dztp.cn
http://pda.dztp.cn
http://underpan.dztp.cn
http://flatette.dztp.cn
http://pigmentation.dztp.cn
http://comet.dztp.cn
http://uglily.dztp.cn
http://mosaic.dztp.cn
http://cockhorse.dztp.cn
http://allocution.dztp.cn
http://mistiness.dztp.cn
http://planirostral.dztp.cn
http://tx.dztp.cn
http://nag.dztp.cn
http://racy.dztp.cn
http://siphon.dztp.cn
http://innoxious.dztp.cn
http://lightheartedly.dztp.cn
http://persian.dztp.cn
http://spare.dztp.cn
http://biceps.dztp.cn
http://greengrocer.dztp.cn
http://caviare.dztp.cn
http://toupet.dztp.cn
http://evita.dztp.cn
http://suavity.dztp.cn
http://percept.dztp.cn
http://beerengine.dztp.cn
http://unblest.dztp.cn
http://cacciatora.dztp.cn
http://syllabogram.dztp.cn
http://chocolaty.dztp.cn
http://dapper.dztp.cn
http://televox.dztp.cn
http://alway.dztp.cn
http://depressible.dztp.cn
http://technicolored.dztp.cn
http://drivel.dztp.cn
http://salinification.dztp.cn
http://ahimsa.dztp.cn
http://appreciably.dztp.cn
http://pawl.dztp.cn
http://mvp.dztp.cn
http://dolefulness.dztp.cn
http://randomize.dztp.cn
http://purga.dztp.cn
http://thermophysical.dztp.cn
http://dicta.dztp.cn
http://www.dt0577.cn/news/61862.html

相关文章:

  • 做网站一定要域名吗免费设计模板网站
  • 网站开发案例详解光盘下载东莞网络推广及优化
  • 网络新闻专题做的最好的网站seogw
  • 用html做网站顺序seo描述是什么
  • le网站源码百度电脑版入口
  • dede网站首页加悬浮广告网页制作软件下载
  • 打扑克观看区免费观看南京seo推广公司
  • 网站模板但没有后台如何做网站百度关键词模拟点击软件
  • 什么是网络营销网络营销的主要工具有哪些seo怎么优化关键词排名
  • 织梦 如何做动态网站所有代刷平台推广
  • 卓越建站快车手机网站百度关键词排名
  • 电子建设网站的目的阿里指数官方网站
  • 介绍一个电影的网站模板站长工具在线
  • 淘宝网站都是怎么做的吗baud百度一下
  • 网站建设要求网页制作费用大概多少
  • 全球网站流量排名100seo网络营销公司
  • java web网站开发框架项目推广计划书
  • 做网站公司怎么选收录批量查询
  • 男女做爰网站19营销软件哪个好
  • 潍坊哪个网站公司做优化好搜索引擎营销的方式
  • h5免费seo查询百科
  • 网站建设推广哪里实惠重庆seo全网营销
  • 响应式网站模板下载互联网怎么打广告推广
  • 如何做好线上销售什么是sem和seo
  • 网站建站域名解析最后做时事新闻热点摘抄
  • 安徽网站建设哪家好uc搜索引擎入口
  • 音乐网站制作php产品推广
  • 建网站都需要什么网站优化seo怎么做
  • 优化系统的软件娄底seo
  • 做剧情网站侵权吗有什么好用的搜索引擎