[Samsung Galaxy S7 Edge Themes, Apps, and Mods] Mwyann:
Hi everyone,

I tried some Pie port ROMS and I found none has support for the S View Cover (no sleep, no cover screen). Lastly I settled on BlackDiamond NFE port v4.0, and so I'm trying to add support for the S View Cover which I own.

Long story short: I'm trying to make this work by modifying some system apks but it still doesn't work.

So I was investigating the S View Cover not supported on S7E BlackDiamond Pie Roms and here are my findings:

- To enable the S View Cover support, all there is to do is to put the following file into /system/etc/permissions/com.sec.feature.cover.sviewcover_level4.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<permissions>
<feature name="com.sec.feature.cover.sviewcover" level="4"/>
</permissions>

- Then the cover is recognized and all BUT SystemUI does not like it and continuously crashes until reboot, or until you remove the cover. The crash is as follows:

E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: com.android.systemui, PID: 4764
E AndroidRuntime: android.view.InflateException: Binary XML file line #1: Binary XML file line #2: Attempt to invoke virtual method 'void android.widget.FrameLayout.addView(android.view.View)' on a null object reference
E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #2: Attempt to invoke virtual method 'void android.widget.FrameLayout.addView(android.view.View)' on a null object reference
E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.addView(android.view.View)' on a null object reference
E AndroidRuntime: at com.samsung.android.app.cover.ui.CoverServiceBoxContainer.onFinishInflate(CoverServiceBoxContainer.java:467)
E AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:915)
E AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:863)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:554)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:461)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
E AndroidRuntime: at com.samsung.android.app.cover.ui.sviewcover.SViewCoverView.onFinishInflate(SViewCoverView.java:78)
E AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:915)
E AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:863)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:554)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:461)
E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
E AndroidRuntime: at android.view.View.inflate(View.java:26197)
E AndroidRuntime: at com.samsung.android.app.cover.CoverViewFactory.makeCoverView(CoverViewFactory.java:20)
E AndroidRuntime: at com.samsung.android.app.cover.CoverEx.reloadCoverView(CoverEx.java:284)
E AndroidRuntime: at com.samsung.android.app.cover.CoverEx.onCoverAttached(CoverEx.java:168)
E AndroidRuntime: at com.samsung.android.app.cover.plugin.PluginViewCoverImpl.onCoverAttached(PluginViewCoverImpl.java:38)
E AndroidRuntime: at com.android.systemui.cover.SysUICoverService.startCover(Unknown Source:33)
E AndroidRuntime: at com.android.systemui.cover.SysUICoverService.onPluginConnected(Unknown Source:24)
E AndroidRuntime: at com.android.systemui.cover.SysUICoverService.onPluginConnected(Unknown Source:2)
E AndroidRuntime: at com.android.systemui.splugins.SPluginInstanceManager$MainHandler.handleMessage(Unknown Source:183)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7045)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

- From what I understand, there are some missing resources in SystemUI to handle the S View Cover display, which makes sense.

- And that's where my understanding in Android stops, so if someone have any idea/advice to give me in order to fix this issue, I'd be glad to help make it work. I can do testings on my phone as needed. :)