Assigned
Status Update
Comments
jf...@gmail.com <jf...@gmail.com> #2
My SD card's file system supports a last modified timestamp; that is 'adb shell touch /mnt/sdcard/foo' works as expected. I need to check that calling from runtime works as well.
so...@google.com <so...@google.com>
so...@google.com <so...@google.com> #3
I couldn't reproduce this with a test case.
@hardwick.jim if this test doesn't pass for you, could you paste its output here? As well as your device's full version information. Thanks.
public final class FileTest extends TestCase {
public void testSetLastModified() {
File file = new File("/mnt/sdcard/foo");
assertTrue(file.setLastModified(0));
assertEquals(0, file.lastModified());
}
}
@hardwick.jim if this test doesn't pass for you, could you paste its output here? As well as your device's full version information. Thanks.
public final class FileTest extends TestCase {
public void testSetLastModified() {
File file = new File("/mnt/sdcard/foo");
assertTrue(file.setLastModified(0));
assertEquals(0, file.lastModified());
}
}
ta...@gmail.com <ta...@gmail.com> #4
[Comment deleted]
ta...@gmail.com <ta...@gmail.com> #5
Attached is the logcat lines from your testcase and my FileTest.java for line number references.
Device is a Motorola Xoom 3G from Verizon, Android 3.1, HMJ37, rooted. I'm not sure what other device info you need, so let me know if you need more.
I can also post the source and results of my tests on stock HMJ37 Xooms - both 3G and WiFi only - but it will take a couple days to get my hands on those devices again since I only own the rooted Xoom.
Device is a Motorola Xoom 3G from Verizon, Android 3.1, HMJ37, rooted. I'm not sure what other device info you need, so let me know if you need more.
I can also post the source and results of my tests on stock HMJ37 Xooms - both 3G and WiFi only - but it will take a couple days to get my hands on those devices again since I only own the rooted Xoom.
he...@gmail.com <he...@gmail.com> #6
Confirmed. When I'm not running as root I can create and delete files, but setLastModified() still fails. That's a bug! It works when running as root.
As a workaround, this ugly hack will set the last modified date to now:
RandomAccessFile raf = new RandomAccessFile(file, "rw");
long length = raf.length();
raf.setLength(length + 1);
raf.setLength(length);
raf.close();
As a workaround, this ugly hack will set the last modified date to now:
RandomAccessFile raf = new RandomAccessFile(file, "rw");
long length = raf.length();
raf.setLength(length + 1);
raf.setLength(length);
raf.close();
Description
What
User experience
What type of Android issue is this?
Other issue
What steps would let us observe this issue?
What was the effect of this issue on your device usage, such as lost time or work?
Moderate
When
Time and frequency
How often has this happened?
Every time
Where
Component
Originating component: <not visible> (1684638)
Build and device data
- Build Number: google/shiba_beta/shiba:Baklava/BP22.250103.008/12932282:user/release-keys
(Note: It is the build when sending this report. For exact build reference, please see the attached bugreport.)
- SoC Revision: Zuma B1
Debugging information
Google Play services
com.google.android.gms
Version 250261035 (25.02.61 (260400-717007275))
System App (Updated)
Android System WebView
com.google.android.webview
Version 677826233 (131.0.6778.262)
System App (Updated)
Network operator: Visible
SIM operator: Visible
Filed by Android Beta Feedback. Version (Updated): 2.46-betterbug.external_20241023_RC01 (DOGFOOD)https://developer.android.com/preview/feedback#feedback-app .
To learn more about our feedback process, please visit