Status Update
Comments
lb...@gmail.com <lb...@gmail.com>
ra...@google.com <ra...@google.com>
tr...@google.com <tr...@google.com>
du...@google.com <du...@google.com>
lb...@gmail.com <lb...@gmail.com> #2
Weird thing is that on the Pixel 6, I'm not sure why, but sometimes I can't reach the storage via the "my computer" of the PC.
It's not the case here of course, because here I can't reach only a specific folder...
ch...@google.com <ch...@google.com> #3
Is the issue of not finding the folder only on Pixel 6? From the logs we are finding /storage/emulated/0/Android/data/com.lb.myapplication/files/
for Pixel 2 Android 14.
For the Pixel 6 it looks like there might be a connection issue. Are you able to find the directory through command line using adb shell
?
lb...@gmail.com <lb...@gmail.com> #4
@3 I miss my old Pixel 2. It's the last one to have a decent screen, without camera hole and rounded corners. Didn't know it got Android 14.
I can't test on it. I tested on an emulator instead, and wrote about the issues I've found there.
I wanted to test now on the Honor Magic 4 pro (Android 14 too), and while this issue doesn't exist on it, the scenario might be different, because on the Pixel 6 I can mirror it fine with the canary IDE version, and on the Honor I can't (when the feature of screen-turn-off is enabled).
The "turn on package filter" doesn't work there to reach the folder, though. Seems it tries to reach only a single folder ( "/data/data") for some reason, instead of all the folders of the app.
Please fix this too. If this is intentional, please make it better to make the button more useful, to show all the folders of the app and not just the most private folder of it (which isn't even accessible for non-rooted real devices).
As for the Pixel 6, perhaps it's because I have a rooted device, and I've given the IDE (shell) to reach all folders? But then it would mean it should reach this folder too...
I tried to reproduce the issue again, and instead of the original issue, it just reached the wrong folder when I typed "com.lb". It preferred to reach a folder that is much less similar than the exact one that starts with it: "com.android.cellbroadcastreceiver".
Please fix this as well. I couldn't also copy the name of the folder, had to copy the path and remove the prefix of it.
So, the original issue can't be reproduced now. I can give you information about the IDE and the device:
Pixel 6 Android 14 , build AP2A.240705.004.
Android Studio Koala Feature Drop | 2024.1.2 Canary 8
Build #AI-241.18034.62.2412.12022747, built on June 27, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 16
Registry:
ide.images.show.chessboard=true
Non-Bundled Plugins:
com.github.drjacky.avocado (3.5.5)
cn.jxzhang.plugin.json-formatter (1.4)
com.intellij.marketplace (241.18034.82)
Show As ... (1.0.3)
String Manipulation (9.14.1)
GenerateSerialVersionUID (3.0.3)
idea.plugin.protoeditor (241.15989.49)
com.steve.plugins.autoscroll (1.1)
com.dethlex.numberconverter (2.0.1)
izhangzhihao.rainbow.brackets (2024.2.4-241)
com.ppismerov.ksvu (0.0.1)
net.aquadc.mike.plugin (0.32)
com.developerphil.adbidea (1.6.15)
GenerateSerializationHelpers (1.0.6)
cn.yiiguxing.plugin.translate (3.6.2)
ch...@google.com <ch...@google.com> #5
The reason it only looks for /data/data
folder because that's the closest thing to a guarantee for app data we can get from Android. Android doesn't provide markers on the directories or a contract for directory structure and would require a much higher analysis of the app if we want to look for all app folders.
It's unclear what File(ContextCompat.getExternalFilesDirs(this, null)[0], "video.mp4")
path is and from my understanding, it can vary from phone to phone. Try printing the file path and see what we get.
lb...@gmail.com <lb...@gmail.com> #6
@5 Are you talking about the "turn on package filter"?
If so, it doesn't make sense. The "/data/data/" is usually not accessible anyway. Please make this feature more useful and reach all folders and not just that.
There is technically no guarantee even in that. Please try what's possible. You can add new APIs for this on Android 15, to make it easier for the IDE to reach the paths.
This is even more possible on emulator and Pixel devices as you know how they work.
About ContextCompat.getExternalFilesDirs(this, null)[0] , sure it can technically vary, but you can try to query each that you know of, especially the most common ones that are on Pixel&emulator. It shouldn't be hard to query if a folder exists or not, and then show it in the list...
If they are not found, you can show a message "external folder/s not found, press here to tell us where to look at", and you could let us teach it what more folders to look at. Then you could gather the reports from various users of the IDE and make adjustments.
And as I said, you can change Android 15 to have some adb commands to help with all of these. It's not even privacy-related so it should be fine to query which folders an installed app is using.
Description
1. Create an app that just puts some file/folder into the app's public storage folder:
```
thread{
val videoFile = File(ContextCompat.getExternalFilesDirs(this, null)[0], "video.mp4")
if (videoFile.exists())
videoFile.delete()
videoFile.parentFile!!.mkdirs()
videoFile.createNewFile()
Log.d("AppLog", "succeeded creating file?${videoFile.exists()}")
}
```
2. Run the app on emulator&device (tested on Pixel 6 with Android 14, emulator Android 14)
3. Try to reach the file/folder in the "device explorer" window of the IDE
- What happened.
Can't find the file/folder for the device, but fine on emulator.
Also, for some reason, the button of "turn on package filter" is disabled for the emulator.
- What you think the correct behavior should be.
Should be accessible. This folder is accessible via USB, and I can see the folders of other apps. Just not the current one...
- Is this a security related issue? Yes/No
Maybe