-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/18/10 22:37 , Kostya Vasilyev wrote: > > The code above multiplies two ints and casts them to long. If the > intermediate result is over 2Gb, you'll get a negative number. > > Try multiplying long values instead: > > long byteCount = blockSize * (long) avlBlocks; >
Ahhhhhhhh they are ints.... Hell. I think it can be definitely that. It is not reproduced on my Droid because it has 5.5Gb free that are reported as 1.5Gb. Indeed, it will report a negative number when the free space is between 2Gb and 4Gb, 6Gb and 8Gb, 10Gb and 12Gb, 14Gb and 18Gb etc... And my user has got 14Gb. - -- Fabrizio Giudici - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." java.net/blog/fabriziogiudici - www.tidalwave.it/people fabrizio.giud...@tidalwave.it -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxsUqwACgkQeDweFqgUGxdJNQCaAwtrwoaj+WMUsL8ZqseowIiw UR0AnixwG7t0M6V9SVhVW/sydNMk0xEw =X1Pt -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en