yashsingh1/xdaforums huggingface dataset:
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
guys, i got an email from Google support:

"Could add a note on XDA to let folks know that they shouldn't be replacing the persist partition as, that would blow up the factory calibration thats unique to their device?

We are looking for impacted devices to test a fix we have. Please have folks reach out to me if they still have their device having sensor issues."

so people with sensors problem would better wait for the fix by Google.

also, i think there is here some people who backed up their non-working persist partition so they could go back to non-working sensors situation and test an eventual fix from Google? if so let me know please I'll put you in contact with Google specialist
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you. Yes, please add me on the email thread. You should already have my email from the last email we received from Gopi from Google.

To others: I did make a backup of my persist partition and what I did today was I manually copied each file from my backup to the new persist partition (except the sensors folder, since that was problematic). So, my persist folder contains my unique calibration data. Maybe everyone else can do the same.
[Google Pixel 3 XL Guides, News, & Discussion] Chrizl577:
I haven't flash anything and still run the broken persist partition, so feel free to include me.

Did it work? And if it is: If there is a single file or folder causing all this, would it be possible to just copy these files from a working persist image? That might work around all the unique information
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
so you got sensors broken after Q update and you are still using phone in those conditions and never done anything about that? if so please PM your email address, thank you.

pixel 3xl i guess?
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Yes, it worked. I have reason to believe the "broken" directory is /persist/sensors. Here's what you can try:

1. Open any file explorer in root

2. Navigate to the mount point: /root/mnt/vendor/persist

3. BACKUP this directory!

4. Replace the /persist/sensors/ directory with the one from the working one. I am attaching it for your convenience as a ZIP.

5. Reboot and try your sensors.

I take no responsibility for this, although this should be safe to do.​

PS: FcukBloat and I are in touch with Google. The solution they posted is "chown;" that is to say they believe this is a permissions issue. However, I am convinced that is NOT the case. This is because for us folks who face this issue, the sensors files are completely empty: 0 bytes! These do need to be replaced for them to work. Regardless, this is the thread Google linked me to: https://xdaforums.com/pixel-3/how-to/how-to-fix-sensor-issues-android-q-guide-t3965640
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
in any case if he hasn't touched his phone yet and can wait a little more, I'd put him in touch with Google and wait to see if Google comes up with a definitive and clean solution?
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
I'm still perplexed as to why they left this non-restorative, crucial partition, which isn't flashed or patched in any factory images, open to being written to, by simply unlocking the bootloader.

In my past experience, this was how erasing it worked, causing it to repopulate properly.

Guess that's also due to the lack of a /cache partition, maybe.

Definitely not complaining that they leave their device open to modification, but leaving this wide open to corruption without a built in solution, this seems a bit careless in my opinion.

Glad they're looking at that and hopefully their fix and Twrp are both able to coexist moving forward.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
After a discussion with them, here's the reason: the /persist/ partition mainly consists factory calibration files that are unique to each device (eg. sensor test values, camera calibration values, speaker configuration files, etc)

Having this partition re-populated is impossible since, by definition, factory calibration files are unique to each device; and unless Google starts offering device-specific factory images (impossible!), this cannot be done. Locking this partition would have been the way to go.

It is TWRP's implementation that is faulty.

Regardless, for people who deleted their persist partition without a backup, the calibration files are gone... possibly forever. This includes accelerometer accuracy, light sensor accuracy, camera focus accuracy, and what not. I'm not saying it will ruin your device - for me someone else's calibration data worked perfectly, too. But it is a bit disconcerting to know I am using data meant for someone else's hardware.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
has someone informed twrp Devs about this problem to possibility fix it before the Q compatible twrp will be released?
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Not to my knowledge, no.

[MENTION=912474]Dees_Troy[/MENTION] and [MENTION=2638973]bigbiff[/MENTION] : I know you are super busy, but wanted to bring this to your attention. The implementation using /persist/ for storing logs and cache files for TWRP has significantly negative repercussions for some pixel phone users. This is because the /persist/ partition is limited in size and the log files can go upwards of 20MB, thereby causing significant corruption of the factory calibration files in the persist directory.

We wanted to bring this to your attention.
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
I wouldn't say repopulating is impossible.

On my HTC 10, the persist partition, was actually able to do just that.

Deleting it and having it repopulate, from cache I presume.

That was the only way to regenerate the IMEI and fix lack of signal, once /persist was corrupted.

The rest makes sense, more or less.

Like I said, persist should have been locked down, without a failsafe in place.(a safe, secure, partition from factory that can rewrite it)
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
I have spoken with one Twrp maintainer and there's a bug report filed as well.

More comments with useful information and/or logs can be added there and [MENTION=2638973]bigbiff[/MENTION] needs to be tagged as well.

https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1506
[Google Pixel 3 XL Guides, News, & Discussion] Chrizl577:
I copied the partition to my sd card using one of the dd commands in this thread but I haven't flashed anything. PM
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
So for those of us that already flashed over the working persist file, should we revert to our backup before doing these steps?,
[Google Pixel 3 XL Guides, News, & Discussion] steal25:
I'm wondering this as well because I still havmy backed up persist file. It also says in that post to not reboot? It doesn't stick...
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
I deleted the /persist/cache folder that only had TWRP files that fill the partition and after reboot all the 0 bytes files got populated and owner changed from root to system on all files in sensors folder.

i'm currently on android 9 as 10 is not usable without sensors

I haven't tested if this fix the sensors on 10 as upgrade doesn't work for me only clean and i'm not going to do this now
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
That is a big discovery!

Can anyone who has a persist.img backup try this? Simply deleting the /cache/ folder on /persist/ seems to repopulate the sensors data.

EDIT: I can try this, too, but can someone tell me how to make an IMG file from a folder that I have backed up?

OR: I am attaching my persist folder here. Would be lovely if someone can make an image file out of this so I can try this fix.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
I guess you can for now take an bad persist.img and test with it.

i remember someone post one somewhere in this thread.
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
I would like to help but first I have to ask:

Is the folder persist included in NANDROID backup in TWRP (back in Pie)? I was too excited on the "first snow" and I forgot to back up my persist_backup.img. I had a nandroid before all these exploration begun, just curious this folder would be part of the nandroid back-up.

Else I will have to sit aside and cheer for you guys :(

And yes after this incident I think I'm still a flashaholic.

Unless I missed out something, I was looking for it too but I couldn't find a non-working persist.img in this thread. That's why I asked a few pages back.
[Google Pixel 3 XL Guides, News, & Discussion] steal25:
Give about an hour and I can try this. Just so I understand what your asking. DD my backed up persist.img that was NOT working and delete the TWRP cache folder and reboot. Correct?
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
yep
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Exactly. If, after flashing the backed up image, you can confirm the sensors don't work again and that the sensor files in /persist/sensors/registry are 0bytes that'll be great.

Upon reboot after deleting cache folder, according to the member who discovered this, all sensor files should repopulate and sensors should, ideally, work.

Thank you!
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
Nandroid doesn't include the persist.

I guess there is no bad persist in the thread i probably just remembered your post.

---------- Post added at 01:49 AM ---------- Previous post was at 01:47 AM ----------

Maybe we can do it the other way around.

Put a 20MB file in the partition of a working sensors device and reboot.

Or better yet run a command that fill the partition as the sensors file are very small so it got to be full
[Google Pixel 3 XL Guides, News, & Discussion] steal25:
dd the backed up persist.img, deleted the persist/cache folder rebooted and the sensors did not work and the files were still zereod out.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
Ok, so maybe this is the issue, after upgrade the system fail to write the files even if it has space.

Next step would be for some one that has the problem and return to 9 delete the cache and try to upgrade after the files are fixed.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
anyone who backed up his bad persist partition please share the persist.img here... thanks!
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
I believe you are in this exact situation. Do let us know when you try this out!
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
i am, and i tried but i have another issue that upgrading get me in boot loop, i hoped that fixing the persist will fix this but it didn't.

Only reset to default is working for me, i will do it in the coming days as it require time to get everything setup again.

I assumed someone else will do it before anyway.
[Google Pixel 3 XL Guides, News, & Discussion] td00:
Hey all not sure if this will help everyone but it seemed to help me at the moment. If you go into system>developer options>quick settings developer tiles and then flip the sensors off toggle to ON - it places a toggle button in your main system tray next to wifi, bluetooth etc.

I have found that by playing with this (in my case I have the toggle on, then I rebooted my phone - Pixel 3 XL) that the sensor issue seems to be corrected. I haven't modified anything or used this persist partition trick. I literally just flashed, and started playing with this toggle. Thought it might help until Google gets their **** together and fixes it.

UPDATE - So I've also discovered that while this lets you now make phone calls (no more dark screen) it borks your camera and AR settings. So it's a one or the other until it's fixed properly. So if I need my camera, I turn the toggle off camera and AR work but phone doesn't. If I need phone I turn toggle on and phone works but camera and AR do not.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you for sharing your experience, td00. However, for us folks who had this bug, playing with this toggle did NOT make a difference. We have tried this, too.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
So.. i just move to 10 with clean install and found the sensors not working

I checked the persist partition and found out i forgot to remove cache folder after my last TWRP backup on 9 before the upgrade and it was again taking all the space.

i delete the cache and rebooted and it didn't fix the sensors.

so i switched to android 9 slot and try to reboot, it start loading and didn't finish (i wasn't expecting it to load as i wipe the phone and setup on 10)

then i switched back the slot and 10 loaded with the sensors working on 10
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
Maybe one open question is: Is this bad persist partition reproducible? Like, if I have a working persist partition, and I use twrp a few times etc, it starts to fill the partition, and causes my sensors to break when I go back to 10. This would be interesting for us, twrp and google.

Actually, has anyone figured out under what circumstances will twrp use the persist partition?

Btw, pm me if anyone still has broken sensors. Google is looking for some.
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
Tonight I did a test with my other p3 that had pie. I clean flashed 10 and sensors broke. I booted twrp and deleted the cache folder and clean flashed 10nand sensors still broken.

The only reason I flashed 10 first is that I didn't known if sensors would be broken or not.

Seems that it breaks for good on the first flash.

Edit: got off the phone with Google and they are actually sending me a new not return and they are flagging the return device to go directly to r&d to figure out what is going on.

I also forwarded my rma email to the guy at Google that needs a defective device to look at. Hopefully he will be able to get his hands on it.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
every time you enter TWRP it create the cache folder.

I tested it and notice that if you do simple things the log is small and doesn't fill the partition (i got a 30+KB log)

If i run a full backup the log gets to 20MB

Since you can't do a backup anyway because TWRP is broke on 10 i won't worry to much.

I guess when TWRP release an update they will address this.

and maybe you can turn log off in TWRP settings, but i didn't check this.

---------- Post added at 10:00 AM ---------- Previous post was at 09:46 AM ----------

You can do what i did and switch back to ver 9 slot, try to boot and than go back to 10 slot and it should fix the sensors.

The fact that Google still fail to reproduce it is very worrying.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
Thanks for the info, I can confirm that this method works, so guys if anyone still has problems and/or wants to fix his own persist partition, delete the cache folder on persist, install Android 9, let it bootloop for 2 min, install Android 10 again and enjoy your working sensors. A factory reset is not needed.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
no need to install just if your did it the OTA style android 9 is on the other slot:

1. check on which slot your currently (a/b): fastboot getvar current-slot

2. switch to the non-current slot: fastboot --set-active=a or fastboot --set-active=b

3. reboot: fastboot reboot

4. wait 2 min and force reboot to bootloader.

5. switch back the slot.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
Yeah well, I tried multiple things, so I didn't have Android 9 on the other Slot anymore ;)
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
Okay so right now I'm on 10 rooted with sensors working via the earlier method done in terminal using a working persist image.

So should I flash my backup of 9 and do this method so that I'll keep MY persist info?
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
I don't know what you mean with "my backup of 9" but yes, if you still have a backup of your own persist partition you definitely should restore it and follow this method since device specific informations are stored on persist.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
Yes you should use your own persist as it is device specific.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
You should always back up whenever doing this sort of thing, but I should note that I did not take a backup and have not had any problems.
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
Android 9.0. Revert to my TWRP backup of 9.0 an then start that method is what I was asking. But I'm good to go.

---------- Post added at 02:55 PM ---------- Previous post was at 02:54 PM ----------

I have backups of my backups. Been there lost that. So I don't take chances anymore.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
No, you don't need to do that since TWRP doesn't backup the persist partition. You only need to flash the backup of your persist partition (I hope you created one) using dd and delete the cache folder on it.

After that flash Android 9, let it bootloop for 2 min and then flash Android 10.

No wipe or restoration or a TWRP backup is needed.
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
I'm not worried about getting it to work. I am more interested in having Google find the fix for everyone. I own two p3. They already rma'd one and I am using that one now. I tested with my other one and it failed too.

I have been in touch with the Google engineer that said not to replace the persist folder and he is actually sending me a special return label for my bad device. He will have it in his hands by next week.

They should know more after.

Yeah remember that twrp is not a Google app and they don't use it so I am not surprised that they can't reproduce it.

They are actually sending me a new p3xl and not a refurb.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
[MENTION=5437072]bggold[/MENTION] Well it's not really Google's job to fix an issue that we caused ourselves by rooting our device and using a 3rd party recovery. Of course you can call it bad design but they don't need to change anything.
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
I think chances are they will find a way to prevent twrp from creating the cache folder in persist. Twrp will then have to find another way to log their actions (like Nandroid backup)..
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
I agree with you 100%. That is why I said originally in a post that they might not even address the issue.

At this point I have new phones and shouldn't experience the issue. If I didn't care about the community I wouldn't have even bothered pushing to get the device back to engineering.

Also it looks like they will be working on twrp for asop10 and hopefully they will change the way the are doing their logging.
[Google Pixel 3 XL Guides, News, & Discussion] steal25:
So basically if we are on android 10 with the working persist.img flashed that was posted in this thread we need to-

-reflash our broken persist.img that was previously backed up

-delete persist/cache folder (what about the .twrps file in /persist?)

-boot to boot loader reflash android 9, try booting, it should loop(?) leave for a few minutes.

-back to boot loader flash android 10 and sensors should be working with devices original persist.img??

I can try this later tonight, just making sure i have the steps correct?
[Google Pixel 3 XL Guides, News, & Discussion] Chrizl577:
I can confirm this to be working. My sensors are working again without flashing a persist image and without wiping data. Here's what worked for me:

1. Backup broken persist partition using adb root shell and dd if=/dev/block/sdf2 of=/sdcard/persist_backup.img

2. Delete the folder /cache and the file .twrps in /mnt/vendor/persist

3. Boot to bootloader and install the latest Android Pie full factory image using flash-all without wiping as described here

4. Let Android Pie boot for a few minutes

5. Reboot in bootloader and flash the latest Android 10 full factory image using flash-all without wiping

6. Reboot with working sensors

I used TWRP mainly for backups, but I also flashed a few files. The log seems to generate a lot of entries when backing up data. So I think this shouldn't be too hard to reproduce, but I'll leave that for Google.
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
​

Can confirm this works. My persist, Android 10, rooted and sensors working with no issues.

Thanks everyone. Hopefully TWRP will address this for the next release.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you for sharing this new workaround! I have a question for anyone who can answer me:

1. I do not have a backup of my persist partition in IMG format, but I have a backup of the folder as it was from root/mnt/vendor/persist. Can I replace the current contents of /mnt/vendor/persist with my backed up folder (manually replacing it) and try this workaround?

OR

2. Is it possible for someone to help me create an IMG file from the folder? I believe we need a linux system for this to run the "make_ext4fs" command, but not quite sure since I don't have a linux, but a mac.

Thank you!
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
[MENTION=3680138]steal25[/MENTION] Yes, this is basically what I did.

Well this file shouldn't be a problem, the important part is to delete the log file or the whole cache folder like I did to free up some space . For me the missing files only had the size of 45KB.

Yeah, I waited until the boot animation finished and the progress bar under the Google logo appeared then I let it loop for 2 min until I went back to fastboot.

Yes, it already worked for quite some people here so enjoy your working sensors.

I think this should work too, you might need to adjust the file permissions if you have the plain files in windows now. If you created a tarball on the phone though, file permissions are no problem.
[Google Pixel 3 XL Guides, News, & Discussion] logo20heli:
Thanks man for this! :good:

These steps worked for me, but I had to do additional steps. First off, I had to restore my broken persist partition from backup.

Then I did step 2 and the remaining steps and it didn't work.

I took a closer look at my broken persist partition and noticed that I had a lot of files in /mnt/vendor/persist/lost+found that were taking up a lot of space (and looked like TWRP related files too). I erased those files, redid the steps and then it worked.
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
I guess you can manually copy the files and use this post:

https://xdaforums.com/pixel-3/how-to/how-to-fix-sensor-issues-android-q-guide-t3965640

to set the permission on all files.
[Google Pixel 3 XL Guides, News, & Discussion] imna357:
so when you say delete the cache folder on it, you mean by using TWRP recovery, because you can't delete the folder when your on Android 10 even rooted, it does not allow me to delete it. So process would be, dd the file using adb shell, flash the backed partition, then boot to TWRP and delete the cache file in there, then flash PIE without -w and boot, then flash android 10 withou -w? :confused:
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
you can delete it on 10 if your rooted
[Google Pixel 3 XL Guides, News, & Discussion] imna357:
I tried using root explorer, but says failed

---------- Post added at 07:49 AM ---------- Previous post was at 07:48 AM ----------

do I need to boot into TWRP first then delete it there?
[Google Pixel 3 XL Guides, News, & Discussion] Goay:
It happened to me too, i don't remember what i did, maybe after a reboot or two it start working
[Google Pixel 3 XL Guides, News, & Discussion] imna357:
Just by using root explorer, your on 10 currently or pie? So if it'll work, you don't need to downgrade to PIE, just restore your persist.img, delete the files then reboot?