zoukankan      html  css  js  c++  java
  • 【ARTS】001-第一周(2020.05.25-2020.05.31)

    一、Algorithm

      本周的算法题目和解析请戳 【leetcode】001-twoSum

    二、Review

      《C++ Primer》英文版第一章。

    三、Tips

      在这周的工作中,测试同事反馈预装 Amazon 后,打开 Amazon 到登录界面,会出现 Google Service Failed 提示。经过排查,此问题和预装 Google Service 和 Google Play 时的默认权限有关。

      Android 6.1 之后,权限的操作发生了变化。由安装时申请,变为使用时需要用到某项权限再申请。但有些应用在需要用到权限时,并不会申请。这就会导致问题。

      对于预装应用,我们可以在 code/frameworks/base/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java 的 grantDefaultSystemHandlerPermissions 方法中进行默认权限的配置。

     1 // gsf
     2 final String gsfPackageName = "com.google.android.gsf";
     3 PackageParser.Package gsfPackage = getSystemPackage(gsfPackageName);
     4 if (gsfPackage != null
     5     && doesPackageSupportRuntimePermissions(gsfPackage)) {
     6   grantRuntimePermissions(gsfPackage, PHONE_PERMISSIONS, userId);
     7   grantRuntimePermissions(gsfPackage, CONTACTS_PERMISSIONS, userId);
     8   grantRuntimePermissions(gsfPackage, LOCATION_PERMISSIONS, userId);
     9   grantRuntimePermissions(gsfPackage, SMS_PERMISSIONS, userId);
    10   grantRuntimePermissions(gsfPackage, MICROPHONE_PERMISSIONS, userId);
    11 }
    12 
    13 // gms
    14 final String gmsPackageName = "com.google.android.gms";
    15 PackageParser.Package gmsPackage = getSystemPackage(gmsPackageName);
    16 if (gmsPackage != null
    17     && doesPackageSupportRuntimePermissions(gmsPackage)) {
    18   grantRuntimePermissions(gmsPackage, PHONE_PERMISSIONS, userId);
    19   grantRuntimePermissions(gmsPackage, CONTACTS_PERMISSIONS, userId);
    20   grantRuntimePermissions(gmsPackage, LOCATION_PERMISSIONS, userId);
    21   grantRuntimePermissions(gmsPackage, SMS_PERMISSIONS, userId);
    22   grantRuntimePermissions(gmsPackage, MICROPHONE_PERMISSIONS, userId);
    23   grantRuntimePermissions(gmsPackage, STORAGE_PERMISSIONS, userId);
    24   grantRuntimePermissions(gmsPackage, CALENDAR_PERMISSIONS, userId);
    25 }
    26 
    27 // vending
    28 final String vendingPackageName = "com.android.vending";
    29 PackageParser.Package vendingPackage = getSystemPackage(vendingPackageName);
    30 if (vendingPackage != null
    31     && doesPackageSupportRuntimePermissions(vendingPackage)) {
    32   grantRuntimePermissions(vendingPackage, PHONE_PERMISSIONS, userId);
    33   grantRuntimePermissions(vendingPackage, CONTACTS_PERMISSIONS, userId);
    34   grantRuntimePermissions(vendingPackage, LOCATION_PERMISSIONS, userId);
    35   grantRuntimePermissions(vendingPackage, SMS_PERMISSIONS, userId);
    36   grantRuntimePermissions(vendingPackage, MICROPHONE_PERMISSIONS, userId);
    37 }

    四、Share

      《努力就会成功》

  • 相关阅读:
    HTML滚动时位置固定 PHP
    js判断验证码是否正确 PHP
    PNG渐变图生成工具 PHP
    C# 提醒小工具 PHP
    js 密码强度检测 PHP
    js辅助输入层 PHP
    不常用样式 PHP
    ASP.NET编程中的十大技巧
    WEB打印大全
    如何在ASP.NET中用OWC绘制图表
  • 原文地址:https://www.cnblogs.com/murongmochen/p/12974955.html
Copyright © 2011-2022 走看看