yashsingh1/xdaforums huggingface dataset:
[G Pad 8.3 Android Development] Deltadroid:
Bluetooth fix

Well, good news. I think I've found the problem with the bluetooth headsets not reconnecting after restarting the bluetooth services. I have set my device in permissive mode and performed some logging and finally found the denials.

<4>[35176.830535 / 04-03 22:57:35.087] type=1400 audit(1428094655.077:245): avc: denied { open } for pid=4530 comm="hci_qcomm_init" name="mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1
<4>[35176.832214 / 04-03 22:57:35.087] type=1400 audit(1428094655.077:246): avc: denied { getattr } for pid=4530 comm="hci_qcomm_init" path="/dev/block/mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1
<4>[36842.969695 / 04-03 23:25:36.452] type=1400 audit(1428096336.452:247): avc: denied { open } for pid=8540 comm="hci_qcomm_init" name="mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1
<4>[36842.970550 / 04-03 23:25:36.462] type=1400 audit(1428096336.452:248): avc: denied { getattr } for pid=8540 comm="hci_qcomm_init" path="/dev/block/mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1
<4>[37711.930450 / 04-03 23:40:05.430] type=1400 audit(1428097205.420:249): avc: denied { open } for pid=12070 comm="hci_qcomm_init" name="mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1
<4>[37711.932159 / 04-03 23:40:05.430] type=1400 audit(1428097205.420:250): avc: denied { getattr } for pid=12070 comm="hci_qcomm_init" path="/dev/block/mmcblk0p18" dev="tmpfs" ino=8543 scontext=u:r:bluetooth_loader:s0 tcontext=u:object_r:misc_partition:s0 tclass=blk_file permissive=1

I have used audit2policy to convert these logs into the missing bluetooth selinux policy.

adb shell su -c dmesg | grep denied | audit2allow -p sepolicy

#============= bluetooth_loader ==============
allow bluetooth_loader misc_partition:blk_file { getattr open };

I have uploaded a patch to be reviewed by cyanogenmod.

http://review.cyanogenmod.org/#/c/93433/

[MENTION=1077833]infected_[/MENTION] can someone do a build and test this? I dont have a build machine to verify this, but I'm 99% sure this will fix the problem. :) [MENTION=3265523]slebit[/MENTION]
[G Pad 8.3 Android Development] Deltadroid:
I'm wondering what these denials are....

cat full_selinux.log
<4>[ 1993.439392 / 04-04 23:44:31.994] type=1400 audit(1428183871.994:168): avc: denied { getattr } for pid=18626 comm="toolbox" path="/factory" dev="mmcblk0p19" ino=2 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0
<4>[ 1993.439971 / 04-04 23:44:31.994] type=1400 audit(1428183871.994:169): avc: denied { getattr } for pid=18626 comm="toolbox" path="/mpt" dev="mmcblk0p31" ino=2 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0
<4>[ 1993.440368 / 04-04 23:44:31.994] type=1400 audit(1428183871.994:170): avc: denied { getattr } for pid=18626 comm="toolbox" path="/persist" dev="mmcblk0p25" ino=2 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:persist_file:s0 tclass=dir permissive=0
<4>[ 1993.440765 / 04-04 23:44:31.994] type=1400 audit(1428183871.994:171): avc: denied { getattr } for pid=18626 comm="toolbox" path="/persist-lg" dev="mmcblk0p15" ino=2 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0
<4>[ 1993.441131 / 04-04 23:44:31.994] type=1400 audit(1428183871.994:172): avc: denied { getattr } for pid=18626 comm="toolbox" path="/sns" dev="mmcblk0p16" ino=2 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:sensors_persist_file:s0 tclass=dir permissive=0
<4>[ 1993.446563 / 04-04 23:44:32.004] type=1400 audit(1428183872.004:173): avc: denied { getattr } for pid=18612 comm="Thread-750" path="/data/tombstones" dev="mmcblk0p36" ino=565249 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:tombstone_data_file:s0 tclass=dir permissive=0

Running the logs through audit2allow gives:

cat full_selinux.log | grep denied | audit2allow -p sepolicy

#============= untrusted_app ==============
allow untrusted_app persist_file:dir getattr;
allow untrusted_app sensors_persist_file:dir getattr;
allow untrusted_app tombstone_data_file:dir getattr;
allow untrusted_app unlabeled:dir getattr;
[G Pad 8.3 Android Development] deepongi:
[MENTION=5227588]Deltadroid[/MENTION] try bluetooth on the build i've just uploaded. it contains the fix.
[G Pad 8.3 Android Development] Deltadroid:
If I have stock cm 12 installed, can I switch to your build without wiping anything?

Edit: I'm sure someone will beat me to it and test it first.

Thanks for the super fast response!

Edit2:

I think I could have made it all one line...

From:

allow bluetooth_loader misc_partition:blk_file { getattr open };

allow bluetooth_loader misc_partition:blk_file read;

To:

allow bluetooth_loader misc_partition:blk_file { getattr open read };
[G Pad 8.3 Android Development] DonDizzurp:
Anyone else having trouble with the last week or two?

Screen goes blank. Hitting the power button turns the backlight on and off but nothing shows up. The only way to get anything working again is to force a reboot (hold all buttons)
[G Pad 8.3 Android Development] deepongi:
had the same issue. fix goes by wiping /system & /data and

do not restore your google stuff

. you can add your account, but dont restore things.

report if it fixed. it did for me.
[G Pad 8.3 Android Development] Deltadroid:
Thanks to [MENTION=4939189]aicjofs[/MENTION], I've been able to modify his kernel installation script to create a universal stock kernel patcher that will unpack the currently installed kernel and append the boot command line so that the kernel defaults to permissive mode.

This should fix a bunch of selinux related issues, such as the headset not reconnecting after restarting the bluetooth service.

I am working on fixing the official selinux policy for the v500, but this should help eveyone until all the rules are fixed.

Flash this script after a flashing a CM update to patch the kernel boot command line and your rom will remain in permissive mode until a new kernel is flashed (or rom update).

v500-universal-selinux-disabler-loki-signed.zip

This script will automatically append "androidboot.selinux=permissive selinux=0" to the boot command line of the currently installed kernel.

NOTE: Do not apply twice on the same kernel or things will be appended twice.
[G Pad 8.3 Android Development] Deltadroid:
After patching my stock kernel with the script above, I paired my bluetooth devices one last time. After that, I can reboot the device and restart the Bluetooth services and everything just reconnects instantly. This obviously fixes the problems associated with selinux.
[G Pad 8.3 Android Development] Deltadroid:
In permissive mode, everything is soo much more responsive! I'd be willing to bet that permissive mode could keep people having problems with the device going black screen also.
[G Pad 8.3 Android Development] Deltadroid:
I posted a few posts back about some untrusted app selinux denials in the logs. This implies that we need to define more applications in the sepolicy. This is probably the reason for poor performance because services are being blocked.

The selinux denials from post #225 are probably the reason why we are having problems. Selinux is blocking some "toolbox" operations.
[G Pad 8.3 Android Development] DonDizzurp:
I'll do it when I get home. I had a feeling the solution was a reinstall :(
[G Pad 8.3 Android Development] davebuk:
Just tried the zip with 20150405 nightly. Bluetooth reconnect working fine and staying in permissive mode in selinux. Hopefully the CM team can find the issue that means selinux has to be in permissive.

Can they add the OTA enabled option as well as I am installing this zip when I update each nightly.

Cheers [MENTION=5227588]Deltadroid[/MENTION] for your hard work and the others who have been helping you out.
[G Pad 8.3 Android Development] Deltadroid:
I wonder if the themes will now stay installed after reboot while in permissive mode. I have submitted a patch for the Bluetooth, so let's hope it is accepted.

I've also noticed network speeds are faster in permissive mode.

Edit: themes still not working after rebooting. That must be a different problem.
[G Pad 8.3 Android Development] Deltadroid:
Open Bump

If you want to download a nightly update and "bump" the installation package before installing it.. do this.

Extract boot.img and updater-script from nightly zip.

Bump boot.img

Edit install-script

--- CM12/META-INF/com/google/android/updater-script.orig	2015-04-09 03:31:37.942847751 +0200
+++ CM12/META-INF/com/google/android/updater-script	2015-04-09 03:35:55.142847550 +0200
@@ -21,8 +21,7 @@
unmount("/system");
show_progress(0.050000, 5);
show_progress(0.200000, 10);
-package_extract_file("boot.img", "/tmp/boot.img");
+package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
-assert(run_program("/system/bin/loki.sh") == 0);
delete("/system/bin/loki.sh");
unmount("/system");

Insert new boot.img and install-script back into zip

sign zip (optional if you turn off zip verification)
[G Pad 8.3 Android Development] Deltadroid:
Here are my scripts to automatically download and bump latest cm 12 Rom. Requires Linux. Tested on ubuntu lts.

https://www.androidfilehost.com/?fid=95916177934553152
[G Pad 8.3 Android Development] Ultraman1966:
Using 0415 I just had the screen blank out whilst using a browsing app... had to press power button to turn off and restart. Any ideas? Never had it before.
[G Pad 8.3 Android Development] Deltadroid:
Yes, CM12.1 will be officially available for the v500 in about an hour. I'm getting ready to upgrade right now by making some backups. I plan on factory resetting when updating to 12.1.

I think the blackout issue is memory management related and the only way to fix it is to upgrade and factory reset.

Edit: I will make an official cm12.1 thread this evening. :)
[G Pad 8.3 Android Development] Ultraman1966:
Interesting, I'll have to check and see if I can replicate this error. In the short term, would force closing unused apps help?
[G Pad 8.3 Android Development] Deltadroid:
Force closing unused apps probably won't help much. Btw, just got first nightly of 12.1. :)
[G Pad 8.3 Android Development] Ultraman1966:
I saw but cyanogenmod appears to be having server issues, I cannot download anything and the website is timing out. Gah!
[G Pad 8.3 Android Development] Stransky:
Likewise, been trying to download 12.1 update for the past hour. Cannot even get to the download page for any phone.

Stranaky
[G Pad 8.3 Android Development] ThunderBolt_BR:
Server is back. Downloading CM12.1 right now.

I'll test the back camera and if it is not working I'll open a report on jira

[]'s
[G Pad 8.3 Android Development] Stransky:
CM 12.1. Downloaded and installed (dirty flash) over CM12 nightly and everything appears to be operating OK, rear camera is working. No FCs or freezes so far. I have not updated the gapps to 5.1, still on the 502 and no problems so far.

Stransky

---------- Post added at 09:47 AM ---------- Previous post was at 09:45 AM ----------

@Deltadroid

Will you be starting a new 5.1 thread or continuing on this one?

Stransky
[G Pad 8.3 Android Development] ThunderBolt_BR:
I made a clean install along with [MENTION=5227588]Deltadroid[/MENTION]'s minimal Gapps package. As espected, the back camera is not working (OV5693 module here).

I'll open the report @ jira.

[]'s
[G Pad 8.3 Android Development] Deltadroid:
I just had this bug with cm12.1 and I never had it with cm12. I think the problem is related to using trebuchet launcher. I never used trebuchet launcher with cm12 and I never had the problem. I did a fresh install of cm12.1 and got the problem within an hour of normal usage. I then replaced trebuchet with Google launcher and the problem has not occurred again.
[G Pad 8.3 Android Development] Sumanji:
Hey guys,

For use as a daily driver, would you recommend sticking to CM11 M12, or is it ok to jump to latest 12 nightlies?

It will be for my Dad, so looking at ROM that won't need to be updated for a while...

Cheers,

Su
[G Pad 8.3 Android Development] jimmys_:
I had the same issue about the screen going blank. Deltadroid's suggestiion of using the Google launcher fixed my problem partially. My screen blanking became less severe, but still happens. I had to uninstall the Adreno GPU driver from http://xdaforums.com/lg-g-pad-83/development/zip-qualcomm-adreno-gpu-binaries-t2788164

- I have not experienced the screen blanking issue since.
[G Pad 8.3 Android Development] annoyingduck:
Tough call, the m12 build is great - I ran it for quite a while. However the cm12 Nightlies are just as good, and considerably smoother,but with the recent addition of cm12.1, I'd hold off and wait for some stability reports. If you need to go with something now, m12 is solid or the latest cm12 is just as stable, but not enough info yet for 12.1...
[G Pad 8.3 Android Development] darkvoid_66:
Can I dirty flash CM 12.1 nigthly over a CM12.0 nigthly or do I need to do a clean data and system?
[G Pad 8.3 Android Development] Deltadroid:
Technically, yes. If you have problems with the upgrade, you can always factory reset later on.
[G Pad 8.3 Android Development] :
Not really a question but a rant...

Will we ever see a stable or final release of this? No snapshots for months, the last CM stable release is more than a year old. I don't want to be only nightlies on my phone. And I don't wanna go back to Stock. C'mon CM get your act together...
[G Pad 8.3 Android Development] michd2:
I don't know why you're complaining about this, because the latest nightly is very stable, and if you use the "selinux disabler"-zip everything works as it should be. So get your act together and don't complain about something that works very good and comes for free despite all the time and effort invested by the developers.
[G Pad 8.3 Android Development] nigelhealy:
"Stable" is relative. On my Nexus 10 the "stable" stock Android crashes more than the custom ROM.

This is real easy to solve. If you are on a nightly and you don't get bugs then just call it a personal stable and stop there. Others who get bugs or just like to play can keep flashing nightlies.
[G Pad 8.3 Android Development] :
Okay guys, since the official download for cm12 nightlies is borked could someone be so kind to upload my personal stable cm-12-20150417-NIGHTLY-v500.zip somewhere. I would really appreciate it...

Thanks in advance.

------>

Bump

No one? Not even the maintainer of this thread?
[G Pad 8.3 Android Development] Deltadroid:
cm-12-20150417-NIGHTLY-v500.zip

md5: b9094d9f1612663568e7fee0919097c3
[G Pad 8.3 Android Development] Sumanji:
Hey,

What does the selinux disabler do?

Cheers,

Su
[G Pad 8.3 Android Development] Deltadroid:
It's the same as these:

http://xdaforums.com/showthread.php?t=3081457

The selinux disabler sets the kernel into permissive mode so that Bluetooth devices automatically reconnect after applying system updates.
[G Pad 8.3 Android Development] darkvoid_66:
I did the dirty flash to latest version from CM12.0 but google play services are always terminating unexpectedly and I can't open my play store it says check connection and try again. The rest of things that I've tested are ok inclunind Gmail, wifi, apps etc.

My google account is configured correctly and its synced. I don't understand what's going on the play store.

I have cleared data and cache from play store. Still the same error. Any tips to fix this. I would not like to factory reset and have to reinstall and configure all my apps.
[G Pad 8.3 Android Development] Deltadroid:
You must update gapps.
[G Pad 8.3 Android Development] SQ9KFX:
Hi. I have problem. After Cm I can nor instal binary for supersu, where is the problem please? I can not do any update because of that.
[G Pad 8.3 Android Development] Deltadroid:
It is recommended to use the version of superuser that is already built into CM. You must first enable developer options to turn on root access.

Settings --> About Tablet (tap on the Build Number about 9 times in a row)
[G Pad 8.3 Android Development] SQ9KFX:
Thanks, I've missed that, now I can enter twrp, update done by twrp. After I've installed super su.zip from xda. Already everything are perfect.
[G Pad 8.3 Android Development] Sista Bossen:
Hey everyone,

First off, I want to say thanks to the developers and everyone involved in making this possible. The work I've seen people put into this is very impressive. Kudos!

I have the V500 running android 4.2.2 atm and I'm on my way to flashing it to Lollipop with CM12.1. I've gathered most of the files and the information needed for the procedure, but since I've never done this before I would like to know if there are any known issues with common functionality such as wifi, video/audio playback, bluetooth, browser, html5/webm, flash etc? This tablet is mainly a daily driver for my daughters Netflix needs, so it has to work or else all hell will break loose. :)

From this page (http://download.cyanogenmod.org/?device=v500) I've downloaded the latest release from 2015-09-01. I also have all the files necessary to get root access as well as making a backup recovery with TWRP. So now I'm just looking for that additional input to go forward.

Thanks in advanced!

SB
[G Pad 8.3 Android Development] Deltadroid:
The main problem with the official cm12.1 release is that the screen occasionally goes black, which requires a reboot. Most people have switched to the fefifofum build because it does not have this issue.
[G Pad 8.3 Android Development] Sista Bossen:
Thanks for the quick reply, [MENTION=5227588]Deltadroid[/MENTION]. How about stock Lollipop? Am I able to flash that rom? I found a huge thread about it, but I haven't read through it yet. I also found this thread that I believe is the fefifofum that you mention.
[G Pad 8.3 Android Development] Deltadroid:
I believe stock lollipop is 5.0.2, and has some issues. Yes that is the correct thread for fefifofum build of 5.1.1.
[G Pad 8.3 Android Development] Sista Bossen:
Thanks, much appreciated info! I will continue my research then, before I flash the device.
[G Pad 8.3 Android Development] metallbloodxox:
CAN I flash the v500 CM 12.1 snapshot on my lg gpad v510 Google play edition since they are the same tablets? Any answer will be appreciated. Thanks
[G Pad 8.3 Android Development] Deltadroid:
No. ROMs for v500 are not compatible with any other device.
[G Pad 8.3 Android Development] metallbloodxox:
I have the lg gpad v510 Google play edition. Can I flash the v500 cm12.1 snapshot on it since they are the same tablets??? Thanks in advance.
[G Pad 8.3 Android Development] Deltadroid:
they are not the same.
[G Pad 8.3 Android Development] metallbloodxox:
Thanks
[G Pad 8.3 Android Development] mrcrowley70:
Now that I am on Cyanogenmod 12.1 , I can't connect with ethernet adapter anymore.

With stock Rom worked well.

The tablet still correctly create eth0 device (dmesg log).

It does ping 192.168.1.1 (my router) , and 8.8.8.8 as well, even if I don't know what it is.

But it doesn't ping google.com or www.google.com, saying host unknown.

What else can I try ?

Inviato dal mio HTC One utilizzando Tapatalk
[G Pad 8.3 Android Development] pnin:
That's Google open DNS -- always a good one to check. If you see this but not Google search, chances are it's a DNS issue. Have you tried other Internet IPs/domains?

Tapatalked from my V500
[G Pad 8.3 Android Development] mrcrowley70:
Do you mean like xdaforums.com ?

Inviato dal mio HTC One utilizzando Tapatalk
[G Pad 8.3 Android Development] Kzyw:
I want to thank the team of cm12 this as good rom and that works so well on my tablet now i have two questions, by speaker sound hear you something low... you can climb with some equalizer?

Can viper4fx be installed in cm12?

At rest without wifi switched off screen i consume enough, 5% every 8 hours, is this normal?

Best regards!
[G Pad 8.3 Android Development] mrcrowley70:
Anyway with CM 13 Ethernet works without any particular setting.

Inviato dal mio HTC One utilizzando Tapatalk
[G Pad 8.3 Android Development] Kzyw:
Every 24 hours at rest without wifi it consumes me 12% battery

Is this normal?
[G Pad 8.3 Android Development] kris163:
Hi guys. Where can I download the latest nightly build of CM12.1? cyanogenmod site has only CM12.1 snapshot or CM14.1 nightly builds available.
[G Pad 8.3 Android Development] Deltadroid:
Nightly builds are only for the latest version.
[G Pad 8.3 Android Development] kris163:
I know. That is why there are no more CM12.1 nightly builds available. Means the latest version of CM12.1 I can download is cm-12.1-20151007-SNAPSHOT which is too old. I am looking for the latest CM12.1 nightly build. If someone has it (later then July 2016) please send me a link.

Thanks.
[G Pad 8.3 Android Development] akaloith:
I havent formated system

just factory reset (data, cache, dalvik)

is this ok?
[G Pad 8.3 Android Development] Deltadroid:
Yes, it should be ok. As long as you factory reset, then it should be fine.
[G Pad 8.3 Android Development] Deltadroid:
There are a bunch of ext4 sdcard fixes in 20140214 build that might be be worth testing out.
[G Pad 8.3 Android Development] Jansxel:
Can i have one question? Which is more Stable and Faster CM12 Unofficial or Official? Be quick
[G Pad 8.3 Android Development] Deltadroid:
They are both stable, but you should try both.
[G Pad 8.3 Android Development] bomdjz:
Have vk810 version?:(

Sent from my IM-A860S using Vegaviet App
[G Pad 8.3 Android Development] Deltadroid:
This thread is v500 only. I have not seen any cm12 ROMs for v810.
[G Pad 8.3 Android Development] Deltadroid:
This commit in today's build could also fix the problem.

http://review.cyanogenmod.org/#/c/85370/
[G Pad 8.3 Android Development] hcdav:
Is anybody else suffering from the 'authentication problem' when connecting to a WPA-protected WiFi network? Absolutely no success with reboots, reflashes, different nightlies etc. I have been unable to connect to the internet.
[G Pad 8.3 Android Development] Deltadroid:
I think you will have better luck using WPA2/PSK with AES encryption.
[G Pad 8.3 Android Development] DonDizzurp:
In my opinion:

Stability = official

Speed = unoffical

I personally use the official release. You probably won't notice a difference 75% of the time. [MENTION=1077833]infected_[/MENTION] has done A LOT for our tablet, though, so I'd give his a try just to see how you like it and to support an awesome dev.
[G Pad 8.3 Android Development] hcdav:
Yes it does seem to be a Lollipop problem right now. Thank you though
[G Pad 8.3 Android Development] kokotron:
Does Bluetooth work with those official builds? It doesn't with the unofficial ones.
[G Pad 8.3 Android Development] Deltadroid:
The only problem that I have now with Bluetooth devices is that I must add them back after every update. I think it is a selinux issue.
[G Pad 8.3 Android Development] ThunderBolt_BR:
Back Camera

Guys,

Sorry if it has already been asked but I couldn't find anything related at the search:

I just installed CM12 (today's nightly) on my v500 and the back camera is not working. Is this a known issue?

I am using 4.2.2 base, clean install.

[]'s
[G Pad 8.3 Android Development] Deltadroid:
Check this thread

http://xdaforums.com/showthread.php?t=3004451
[G Pad 8.3 Android Development] ThunderBolt_BR:
Thaks for the reply,

I read that thread and executed the commands you wrote at the last post in terminal but it didn't return anything for OV5693 and neither for S5K4E5YA as well...

I am lost...

[]'s
[G Pad 8.3 Android Development] Deltadroid:
Try rebooting and then doing it. I think the system log just got truncated after being on for a while.