{"id":12687,"date":"2022-11-24T15:14:50","date_gmt":"2022-11-24T07:14:50","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=12687"},"modified":"2022-11-24T15:14:51","modified_gmt":"2022-11-24T07:14:51","slug":"%e5%b0%8f%e7%b1%b3%e5%bc%80%e5%8f%91%e5%b9%b3%e5%8f%b0%e5%ba%94%e7%94%a8%e5%88%a0%e9%99%a4%e5%89%8d%e5%8f%b0%e6%9c%8d%e5%8a%a1%e9%80%9a%e7%9f%a5%e5%af%bc%e8%87%b4%e7%9a%84%e9%97%aa%e9%80%80%e9%97%ae","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/12687\/","title":{"rendered":"\u5c0f\u7c73\u5f00\u53d1\u5e73\u53f0\u5e94\u7528\u5220\u9664\u524d\u53f0\u670d\u52a1\u901a\u77e5\u5bfc\u81f4\u7684\u95ea\u9000\u95ee\u9898\u8bf4\u660e"},"content":{"rendered":"\n<p><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%b0%8f%e7%b1%b3%e5%bc%80%e5%8f%91%e5%b9%b3%e5%8f%b0\/\" title=\"\u5c0f\u7c73\u5f00\u53d1\u5e73\u53f0\" target=\"_blank\">\u5c0f\u7c73\u5f00\u53d1\u5e73\u53f0<\/a><\/span>\u5e94\u7528\u5220\u9664<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%89%8d%e5%8f%b0\/\" title=\"\u524d\u53f0\" target=\"_blank\">\u524d\u53f0<\/a><\/span><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%9c%8d%e5%8a%a1%e9%80%9a%e7%9f%a5\/\" title=\"\u670d\u52a1\u901a\u77e5\" target=\"_blank\">\u670d\u52a1\u901a\u77e5<\/a><\/span>\u5bfc\u81f4\u7684<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e9%97%aa%e9%80%80\/\" title=\"\u95ea\u9000\" target=\"_blank\">\u95ea\u9000<\/a><\/span>\u95ee\u9898\u8bf4\u660e<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8fd1\u671f\u53d1\u73b0\u8f83\u591a\u5e94\u7528\u51fa\u73b0\u95ea\u9000\u73b0\u8c61\uff0c\u5177\u4f53<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/trace\/\" title=\"trace\" target=\"_blank\">trace<\/a><\/span>\u5982\u4e0b\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>AndroidRuntime: FATAL EXCEPTION: main\nAndroidRuntime: Process: com.xxx.app, PID: 25339\nAndroidRuntime: java.lang.SecurityException: Not allowed to delete channel XXX with a foreground service\nAndroidRuntime:         at android.os.Parcel.createExceptionOrNull(Parcel.java:2376)\nAndroidRuntime:         at android.os.Parcel.createException(Parcel.java:2360)\nAndroidRuntime:         at android.os.Parcel.readException(Parcel.java:2343)\nAndroidRuntime:         at android.os.Parcel.readException(Parcel.java:2285)\nAndroidRuntime:         at android.app.INotificationManager$Stub$Proxy.deleteNotificationChannel(INotificationManager.java:4040)\nAndroidRuntime:         at android.app.NotificationManager.deleteNotificationChannel(NotificationManager.java:909)\nAndroidRuntime:         at androidx.core.app.NotificationManagerCompat.deleteNotificationChannel(SourceFile:2)\nAndroidRuntime:         at com.gyf.cactus.ext.c$a.run(SourceFile:1)\nAndroidRuntime:         at android.os.Handler.handleCallback(Handler.java:938)\nAndroidRuntime:         at android.os.Handler.dispatchMessage(Handler.java:99)\nAndroidRuntime:         at android.os.Looper.loop(Looper.java:236)\nAndroidRuntime:         at android.app.ActivityThread.main(ActivityThread.java:8142)\nAndroidRuntime:         at java.lang.reflect.Method.invoke(Native Method)\nAndroidRuntime:         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)\nAndroidRuntime:         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)\nAndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:\nAndroidRuntime:         at com.android.server.notification.NotificationManagerService$10.enforceDeletingChannelHasNoFgService(NotificationManagerService.java:3427)\nAndroidRuntime:         at com.android.server.notification.NotificationManagerService$10.deleteNotificationChannel(NotificationManagerService.java:3440)\nAndroidRuntime:         at android.app.INotificationManager$Stub.onTransact(INotificationManager.java:1737)\nAndroidRuntime:         at android.os.Binder.execTransactInternal(Binder.java:1160)\nAndroidRuntime:         at android.os.Binder.execTransact(Binder.java:1129)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>\u539f\u56e0\u662f\u53d7Google\u7684\u4e00\u7b14\u5b89\u5168\u6821\u9a8cPatch\u5f71\u54cd\uff1ahttps:\/\/cs.android.com\/android\/platform\/superproject\/+\/master:frameworks\/base\/services\/core\/java\/com\/android\/server\/notification\/NotificationManagerService.java;l=3413<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>private<\/strong> <strong>void<\/strong> <strong>enforceDeletingChannelHasNoFgService<\/strong>(String pkg, <strong>int<\/strong> userId,\n                String channelId) {\n            <strong>if<\/strong> (mAmi.hasForegroundServiceNotification(pkg, userId, channelId)) {\n                Slog.w(TAG, \"Package u\" + userId + \"\/\" + pkg\n                        + \" may not delete notification channel '\"\n                        + channelId + \"' with fg service\");\n                <strong>throw<\/strong> <strong>new<\/strong> SecurityException(\"Not allowed to delete channel \" + channelId\n                        + \" with a foreground service\");\n            }\n        }<\/code><\/pre>\n\n\n\n<p>\u4e5f\u5c31\u662fGoogle\u9650\u5236\u4e86\u5b58\u5728<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%89%8d%e5%8f%b0%e6%9c%8d%e5%8a%a1\/\" title=\"\u524d\u53f0\u670d\u52a1\" target=\"_blank\">\u524d\u53f0\u670d\u52a1<\/a><\/span>\u65f6\uff0c\u4e0d\u5141\u8bb8\u5e94\u7528\u5220\u9664\u4e0e\u524d\u53f0\u670d\u52a1\u7ed1\u5b9a\u7684channel\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\uff0c\u8bf7\u5f00\u53d1\u8005\u68c0\u67e5\u5904\u7406\uff0c\u611f\u8c22\u652f\u6301\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u671f\u53d1\u73b0\u8f83\u591a\u5e94\u7528\u51fa\u73b0\u95ea\u9000\u73b0\u8c61\uff0c\u5177\u4f53trace\u5982\u4e0b\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,94,160],"tags":[5925,5927,5928,862,5789,5929,1868,5926],"special":[67],"attr":[],"class_list":["post-12687","post","type-post","status-publish","format-standard","hentry","category-appsj","category-appjc","category-appcs","tag-trace","tag-5927","tag-5928","tag-xiaomi","tag-5789","tag-5929","tag-1868","tag-5926","special-xiaomikfpt","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=12687"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12687\/revisions"}],"predecessor-version":[{"id":12688,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12687\/revisions\/12688"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=12687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=12687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=12687"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=12687"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=12687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}