根源:
此bug是优化camera 硬启动造成的, (当收到开机完成广播,进行软启动camera),解决方案是在systemui中添加白名单,屏蔽显示图标。
修改代码列表:
(1)SystemUI/res/values/config.xml
(2)SystemUI/src/com/android/systemui/privacy/AppOpsPrivacyItemMonitor.kt
代码详细patch:
[1]SystemUI/res/values/config.xml
<string translatable="false" name="config_cameraProtectionExcludedPackages">com.tinno.camerasaver</string>
[2]SystemUI/src/com/android/systemui/privacy/AppOpsPrivacyItemMonitor.kt
// Check if we care about this code right now
if (code in OPS_MIC_CAMERA && !micCameraAvailable) {
return
}
if (code in OPS_LOCATION && !locationAvailable) {
return
}
if (userTracker.userProfiles.any { it.id == UserHandle.getUserId(uid) } ||
code in USER_INDEPENDENT_OPS) {
logger.logUpdatedItemFromAppOps(code, uid, packageName, active)
//BEGIN
if("com.***.camerasaver".equals(packageName)){
return
}
//END
dispatchOnPrivacyItemsChanged()
}
}