Android p升级引起的服务失效

之前版本中通过属性来启动服务失效了
是在P上对属性名进行了规范,必现符合规则的才可以
具体的修改提交如下

diff --git[a/init/action_parser.cpp](https://android.googlesource.com/platform/system/core/+/dd85c74655400347aee5f6bfecd827a311f16ca4/init/action_parser.cpp)[b/init/action_parser.cpp]
(https://android.googlesource.com/platform/system/core/+/fa79ae87f12d2709482375f56a1c13737a8513f3/init/action_parser.cpp)
index 2d497b3..4f8bd16 100644
--- a/init/action_parser.cpp
+++ b/init/action_parser.cpp

@@ -40,6 +40,18 @@  
      return true;    } 
+    static constexpr const char* kPartnerPrefixes[] = {
+            "init.svc.vendor.", "ro.vendor.",    "persist.vendor.",+            "vendor.",          "init.svc.odm.", "ro.odm.",
+            "persist.odm.",    "odm.",          "ro.boot.",+    };
++    for (const auto& prefix : kPartnerPrefixes) {
+        if (android::base::StartsWith(prop_name, prefix)) {
+            return true;+        }
+    }
+    return CanReadProperty(subcontext->context(), prop_name); }

    原文作者:布吉刀
    原文地址: https://www.jianshu.com/p/ee00cae4f5a4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞