Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, I think that you may need to umount <code>.android_secure</code> filesystem before formatting SD card, whatever your approach may be.</p> <p>Then,</p> <p>Try including following permissions in your app:</p> <p>1) <code>MOUNT_FORMAT_FILESYSTEMS</code> - <a href="http://developer.android.com/reference/android/Manifest.permission.html#MOUNT_FORMAT_FILESYSTEMS" rel="nofollow">http://developer.android.com/reference/android/Manifest.permission.html#MOUNT_FORMAT_FILESYSTEMS</a></p> <p>2) <code>MOUNT_UNMOUNT_FILESYSTEMS</code> - <a href="http://developer.android.com/reference/android/Manifest.permission.html#MOUNT_UNMOUNT_FILESYSTEMS" rel="nofollow">http://developer.android.com/reference/android/Manifest.permission.html#MOUNT_UNMOUNT_FILESYSTEMS</a></p> <p>Android Settings app already uses the 2nd permission.</p> <p>================================================================================</p> <p>When you perform a build of AOSP or any other distribution code, IMountService.java file gets generated automatically. It contains following function which actually sends formatting commands to vold daemon I guess.:</p> <pre><code>private static class Proxy implements android.os.storage.IMountService { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } public android.os.IBinder asBinder() { return mRemote; } // **** A LOT OF OTHER CODE IS HERE..... public int formatVolume(java.lang.String mountPoint) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(mountPoint); mRemote.transact(Stub.TRANSACTION_formatVolume, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload