• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.os.storage;
18 
19 import android.content.pm.IPackageMoveObserver;
20 import android.os.Binder;
21 import android.os.IBinder;
22 import android.os.IInterface;
23 import android.os.Parcel;
24 import android.os.ParcelFileDescriptor;
25 import android.os.Parcelable;
26 import android.os.RemoteException;
27 
28 /**
29  * WARNING! Update IMountService.h and IMountService.cpp if you change this
30  * file. In particular, the ordering of the methods below must match the
31  * _TRANSACTION enum in IMountService.cpp
32  *
33  * @hide - Applications should use android.os.storage.StorageManager to access
34  *       storage functions.
35  */
36 public interface IMountService extends IInterface {
37     /** Local-side IPC implementation stub class. */
38     public static abstract class Stub extends Binder implements IMountService {
39         private static class Proxy implements IMountService {
40             private final IBinder mRemote;
41 
Proxy(IBinder remote)42             Proxy(IBinder remote) {
43                 mRemote = remote;
44             }
45 
asBinder()46             public IBinder asBinder() {
47                 return mRemote;
48             }
49 
getInterfaceDescriptor()50             public String getInterfaceDescriptor() {
51                 return DESCRIPTOR;
52             }
53 
54             /**
55              * Registers an IMountServiceListener for receiving async
56              * notifications.
57              */
registerListener(IMountServiceListener listener)58             public void registerListener(IMountServiceListener listener) throws RemoteException {
59                 Parcel _data = Parcel.obtain();
60                 Parcel _reply = Parcel.obtain();
61                 try {
62                     _data.writeInterfaceToken(DESCRIPTOR);
63                     _data.writeStrongBinder((listener != null ? listener.asBinder() : null));
64                     mRemote.transact(Stub.TRANSACTION_registerListener, _data, _reply, 0);
65                     _reply.readException();
66                 } finally {
67                     _reply.recycle();
68                     _data.recycle();
69                 }
70             }
71 
72             /**
73              * Unregisters an IMountServiceListener
74              */
unregisterListener(IMountServiceListener listener)75             public void unregisterListener(IMountServiceListener listener) throws RemoteException {
76                 Parcel _data = Parcel.obtain();
77                 Parcel _reply = Parcel.obtain();
78                 try {
79                     _data.writeInterfaceToken(DESCRIPTOR);
80                     _data.writeStrongBinder((listener != null ? listener.asBinder() : null));
81                     mRemote.transact(Stub.TRANSACTION_unregisterListener, _data, _reply, 0);
82                     _reply.readException();
83                 } finally {
84                     _reply.recycle();
85                     _data.recycle();
86                 }
87             }
88 
89             /**
90              * Returns true if a USB mass storage host is connected
91              */
isUsbMassStorageConnected()92             public boolean isUsbMassStorageConnected() throws RemoteException {
93                 Parcel _data = Parcel.obtain();
94                 Parcel _reply = Parcel.obtain();
95                 boolean _result;
96                 try {
97                     _data.writeInterfaceToken(DESCRIPTOR);
98                     mRemote.transact(Stub.TRANSACTION_isUsbMassStorageConnected, _data, _reply, 0);
99                     _reply.readException();
100                     _result = 0 != _reply.readInt();
101                 } finally {
102                     _reply.recycle();
103                     _data.recycle();
104                 }
105                 return _result;
106             }
107 
108             /**
109              * Enables / disables USB mass storage. The caller should check
110              * actual status of enabling/disabling USB mass storage via
111              * StorageEventListener.
112              */
setUsbMassStorageEnabled(boolean enable)113             public void setUsbMassStorageEnabled(boolean enable) throws RemoteException {
114                 Parcel _data = Parcel.obtain();
115                 Parcel _reply = Parcel.obtain();
116                 try {
117                     _data.writeInterfaceToken(DESCRIPTOR);
118                     _data.writeInt((enable ? 1 : 0));
119                     mRemote.transact(Stub.TRANSACTION_setUsbMassStorageEnabled, _data, _reply, 0);
120                     _reply.readException();
121                 } finally {
122                     _reply.recycle();
123                     _data.recycle();
124                 }
125             }
126 
127             /**
128              * Returns true if a USB mass storage host is enabled (media is
129              * shared)
130              */
isUsbMassStorageEnabled()131             public boolean isUsbMassStorageEnabled() throws RemoteException {
132                 Parcel _data = Parcel.obtain();
133                 Parcel _reply = Parcel.obtain();
134                 boolean _result;
135                 try {
136                     _data.writeInterfaceToken(DESCRIPTOR);
137                     mRemote.transact(Stub.TRANSACTION_isUsbMassStorageEnabled, _data, _reply, 0);
138                     _reply.readException();
139                     _result = 0 != _reply.readInt();
140                 } finally {
141                     _reply.recycle();
142                     _data.recycle();
143                 }
144                 return _result;
145             }
146 
147             /**
148              * Mount external storage at given mount point. Returns an int
149              * consistent with MountServiceResultCode
150              */
mountVolume(String mountPoint)151             public int mountVolume(String mountPoint) throws RemoteException {
152                 Parcel _data = Parcel.obtain();
153                 Parcel _reply = Parcel.obtain();
154                 int _result;
155                 try {
156                     _data.writeInterfaceToken(DESCRIPTOR);
157                     _data.writeString(mountPoint);
158                     mRemote.transact(Stub.TRANSACTION_mountVolume, _data, _reply, 0);
159                     _reply.readException();
160                     _result = _reply.readInt();
161                 } finally {
162                     _reply.recycle();
163                     _data.recycle();
164                 }
165                 return _result;
166             }
167 
168             /**
169              * Safely unmount external storage at given mount point. The unmount
170              * is an asynchronous operation. Applications should register
171              * StorageEventListener for storage related status changes.
172              */
unmountVolume(String mountPoint, boolean force, boolean removeEncryption)173             public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption)
174                     throws RemoteException {
175                 Parcel _data = Parcel.obtain();
176                 Parcel _reply = Parcel.obtain();
177                 try {
178                     _data.writeInterfaceToken(DESCRIPTOR);
179                     _data.writeString(mountPoint);
180                     _data.writeInt((force ? 1 : 0));
181                     _data.writeInt((removeEncryption ? 1 : 0));
182                     mRemote.transact(Stub.TRANSACTION_unmountVolume, _data, _reply, 0);
183                     _reply.readException();
184                 } finally {
185                     _reply.recycle();
186                     _data.recycle();
187                 }
188             }
189 
190             /**
191              * Format external storage given a mount point. Returns an int
192              * consistent with MountServiceResultCode
193              */
formatVolume(String mountPoint)194             public int formatVolume(String mountPoint) throws RemoteException {
195                 Parcel _data = Parcel.obtain();
196                 Parcel _reply = Parcel.obtain();
197                 int _result;
198                 try {
199                     _data.writeInterfaceToken(DESCRIPTOR);
200                     _data.writeString(mountPoint);
201                     mRemote.transact(Stub.TRANSACTION_formatVolume, _data, _reply, 0);
202                     _reply.readException();
203                     _result = _reply.readInt();
204                 } finally {
205                     _reply.recycle();
206                     _data.recycle();
207                 }
208                 return _result;
209             }
210 
211             /**
212              * Returns an array of pids with open files on the specified path.
213              */
getStorageUsers(String path)214             public int[] getStorageUsers(String path) throws RemoteException {
215                 Parcel _data = Parcel.obtain();
216                 Parcel _reply = Parcel.obtain();
217                 int[] _result;
218                 try {
219                     _data.writeInterfaceToken(DESCRIPTOR);
220                     _data.writeString(path);
221                     mRemote.transact(Stub.TRANSACTION_getStorageUsers, _data, _reply, 0);
222                     _reply.readException();
223                     _result = _reply.createIntArray();
224                 } finally {
225                     _reply.recycle();
226                     _data.recycle();
227                 }
228                 return _result;
229             }
230 
231             /**
232              * Gets the state of a volume via its mountpoint.
233              */
getVolumeState(String mountPoint)234             public String getVolumeState(String mountPoint) throws RemoteException {
235                 Parcel _data = Parcel.obtain();
236                 Parcel _reply = Parcel.obtain();
237                 String _result;
238                 try {
239                     _data.writeInterfaceToken(DESCRIPTOR);
240                     _data.writeString(mountPoint);
241                     mRemote.transact(Stub.TRANSACTION_getVolumeState, _data, _reply, 0);
242                     _reply.readException();
243                     _result = _reply.readString();
244                 } finally {
245                     _reply.recycle();
246                     _data.recycle();
247                 }
248                 return _result;
249             }
250 
251             /*
252              * Creates a secure container with the specified parameters. Returns
253              * an int consistent with MountServiceResultCode
254              */
createSecureContainer(String id, int sizeMb, String fstype, String key, int ownerUid, boolean external)255             public int createSecureContainer(String id, int sizeMb, String fstype, String key,
256                     int ownerUid, boolean external) throws RemoteException {
257                 Parcel _data = Parcel.obtain();
258                 Parcel _reply = Parcel.obtain();
259                 int _result;
260                 try {
261                     _data.writeInterfaceToken(DESCRIPTOR);
262                     _data.writeString(id);
263                     _data.writeInt(sizeMb);
264                     _data.writeString(fstype);
265                     _data.writeString(key);
266                     _data.writeInt(ownerUid);
267                     _data.writeInt(external ? 1 : 0);
268                     mRemote.transact(Stub.TRANSACTION_createSecureContainer, _data, _reply, 0);
269                     _reply.readException();
270                     _result = _reply.readInt();
271                 } finally {
272                     _reply.recycle();
273                     _data.recycle();
274                 }
275                 return _result;
276             }
277 
278             /*
279              * Destroy a secure container, and free up all resources associated
280              * with it. NOTE: Ensure all references are released prior to
281              * deleting. Returns an int consistent with MountServiceResultCode
282              */
destroySecureContainer(String id, boolean force)283             public int destroySecureContainer(String id, boolean force) throws RemoteException {
284                 Parcel _data = Parcel.obtain();
285                 Parcel _reply = Parcel.obtain();
286                 int _result;
287                 try {
288                     _data.writeInterfaceToken(DESCRIPTOR);
289                     _data.writeString(id);
290                     _data.writeInt((force ? 1 : 0));
291                     mRemote.transact(Stub.TRANSACTION_destroySecureContainer, _data, _reply, 0);
292                     _reply.readException();
293                     _result = _reply.readInt();
294                 } finally {
295                     _reply.recycle();
296                     _data.recycle();
297                 }
298                 return _result;
299             }
300 
301             /*
302              * Finalize a container which has just been created and populated.
303              * After finalization, the container is immutable. Returns an int
304              * consistent with MountServiceResultCode
305              */
finalizeSecureContainer(String id)306             public int finalizeSecureContainer(String id) throws RemoteException {
307                 Parcel _data = Parcel.obtain();
308                 Parcel _reply = Parcel.obtain();
309                 int _result;
310                 try {
311                     _data.writeInterfaceToken(DESCRIPTOR);
312                     _data.writeString(id);
313                     mRemote.transact(Stub.TRANSACTION_finalizeSecureContainer, _data, _reply, 0);
314                     _reply.readException();
315                     _result = _reply.readInt();
316                 } finally {
317                     _reply.recycle();
318                     _data.recycle();
319                 }
320                 return _result;
321             }
322 
323             /*
324              * Mount a secure container with the specified key and owner UID.
325              * Returns an int consistent with MountServiceResultCode
326              */
mountSecureContainer(String id, String key, int ownerUid, boolean readOnly)327             public int mountSecureContainer(String id, String key, int ownerUid, boolean readOnly)
328                     throws RemoteException {
329                 Parcel _data = Parcel.obtain();
330                 Parcel _reply = Parcel.obtain();
331                 int _result;
332                 try {
333                     _data.writeInterfaceToken(DESCRIPTOR);
334                     _data.writeString(id);
335                     _data.writeString(key);
336                     _data.writeInt(ownerUid);
337                     _data.writeInt(readOnly ? 1 : 0);
338                     mRemote.transact(Stub.TRANSACTION_mountSecureContainer, _data, _reply, 0);
339                     _reply.readException();
340                     _result = _reply.readInt();
341                 } finally {
342                     _reply.recycle();
343                     _data.recycle();
344                 }
345                 return _result;
346             }
347 
348             /*
349              * Unount a secure container. Returns an int consistent with
350              * MountServiceResultCode
351              */
unmountSecureContainer(String id, boolean force)352             public int unmountSecureContainer(String id, boolean force) throws RemoteException {
353                 Parcel _data = Parcel.obtain();
354                 Parcel _reply = Parcel.obtain();
355                 int _result;
356                 try {
357                     _data.writeInterfaceToken(DESCRIPTOR);
358                     _data.writeString(id);
359                     _data.writeInt((force ? 1 : 0));
360                     mRemote.transact(Stub.TRANSACTION_unmountSecureContainer, _data, _reply, 0);
361                     _reply.readException();
362                     _result = _reply.readInt();
363                 } finally {
364                     _reply.recycle();
365                     _data.recycle();
366                 }
367                 return _result;
368             }
369 
370             /*
371              * Returns true if the specified container is mounted
372              */
isSecureContainerMounted(String id)373             public boolean isSecureContainerMounted(String id) throws RemoteException {
374                 Parcel _data = Parcel.obtain();
375                 Parcel _reply = Parcel.obtain();
376                 boolean _result;
377                 try {
378                     _data.writeInterfaceToken(DESCRIPTOR);
379                     _data.writeString(id);
380                     mRemote.transact(Stub.TRANSACTION_isSecureContainerMounted, _data, _reply, 0);
381                     _reply.readException();
382                     _result = 0 != _reply.readInt();
383                 } finally {
384                     _reply.recycle();
385                     _data.recycle();
386                 }
387                 return _result;
388             }
389 
390             /*
391              * Rename an unmounted secure container. Returns an int consistent
392              * with MountServiceResultCode
393              */
renameSecureContainer(String oldId, String newId)394             public int renameSecureContainer(String oldId, String newId) throws RemoteException {
395                 Parcel _data = Parcel.obtain();
396                 Parcel _reply = Parcel.obtain();
397                 int _result;
398                 try {
399                     _data.writeInterfaceToken(DESCRIPTOR);
400                     _data.writeString(oldId);
401                     _data.writeString(newId);
402                     mRemote.transact(Stub.TRANSACTION_renameSecureContainer, _data, _reply, 0);
403                     _reply.readException();
404                     _result = _reply.readInt();
405                 } finally {
406                     _reply.recycle();
407                     _data.recycle();
408                 }
409                 return _result;
410             }
411 
412             /*
413              * Returns the filesystem path of a mounted secure container.
414              */
getSecureContainerPath(String id)415             public String getSecureContainerPath(String id) throws RemoteException {
416                 Parcel _data = Parcel.obtain();
417                 Parcel _reply = Parcel.obtain();
418                 String _result;
419                 try {
420                     _data.writeInterfaceToken(DESCRIPTOR);
421                     _data.writeString(id);
422                     mRemote.transact(Stub.TRANSACTION_getSecureContainerPath, _data, _reply, 0);
423                     _reply.readException();
424                     _result = _reply.readString();
425                 } finally {
426                     _reply.recycle();
427                     _data.recycle();
428                 }
429                 return _result;
430             }
431 
432             /**
433              * Gets an Array of currently known secure container IDs
434              */
getSecureContainerList()435             public String[] getSecureContainerList() throws RemoteException {
436                 Parcel _data = Parcel.obtain();
437                 Parcel _reply = Parcel.obtain();
438                 String[] _result;
439                 try {
440                     _data.writeInterfaceToken(DESCRIPTOR);
441                     mRemote.transact(Stub.TRANSACTION_getSecureContainerList, _data, _reply, 0);
442                     _reply.readException();
443                     _result = _reply.createStringArray();
444                 } finally {
445                     _reply.recycle();
446                     _data.recycle();
447                 }
448                 return _result;
449             }
450 
451             /**
452              * Shuts down the MountService and gracefully unmounts all external
453              * media. Invokes call back once the shutdown is complete.
454              */
shutdown(IMountShutdownObserver observer)455             public void shutdown(IMountShutdownObserver observer)
456                     throws RemoteException {
457                 Parcel _data = Parcel.obtain();
458                 Parcel _reply = Parcel.obtain();
459                 try {
460                     _data.writeInterfaceToken(DESCRIPTOR);
461                     _data.writeStrongBinder((observer != null ? observer.asBinder() : null));
462                     mRemote.transact(Stub.TRANSACTION_shutdown, _data, _reply, 0);
463                     _reply.readException();
464                 } finally {
465                     _reply.recycle();
466                     _data.recycle();
467                 }
468             }
469 
470             /**
471              * Call into MountService by PackageManager to notify that its done
472              * processing the media status update request.
473              */
finishMediaUpdate()474             public void finishMediaUpdate() throws RemoteException {
475                 Parcel _data = Parcel.obtain();
476                 Parcel _reply = Parcel.obtain();
477                 try {
478                     _data.writeInterfaceToken(DESCRIPTOR);
479                     mRemote.transact(Stub.TRANSACTION_finishMediaUpdate, _data, _reply, 0);
480                     _reply.readException();
481                 } finally {
482                     _reply.recycle();
483                     _data.recycle();
484                 }
485             }
486 
487             /**
488              * Mounts an Opaque Binary Blob (OBB) with the specified decryption
489              * key and only allows the calling process's UID access to the
490              * contents. MountService will call back to the supplied
491              * IObbActionListener to inform it of the terminal state of the
492              * call.
493              */
mountObb(String rawPath, String canonicalPath, String key, IObbActionListener token, int nonce)494             public void mountObb(String rawPath, String canonicalPath, String key,
495                     IObbActionListener token, int nonce) throws RemoteException {
496                 Parcel _data = Parcel.obtain();
497                 Parcel _reply = Parcel.obtain();
498                 try {
499                     _data.writeInterfaceToken(DESCRIPTOR);
500                     _data.writeString(rawPath);
501                     _data.writeString(canonicalPath);
502                     _data.writeString(key);
503                     _data.writeStrongBinder((token != null ? token.asBinder() : null));
504                     _data.writeInt(nonce);
505                     mRemote.transact(Stub.TRANSACTION_mountObb, _data, _reply, 0);
506                     _reply.readException();
507                 } finally {
508                     _reply.recycle();
509                     _data.recycle();
510                 }
511             }
512 
513             /**
514              * Unmounts an Opaque Binary Blob (OBB). When the force flag is
515              * specified, any program using it will be forcibly killed to
516              * unmount the image. MountService will call back to the supplied
517              * IObbActionListener to inform it of the terminal state of the
518              * call.
519              */
unmountObb( String rawPath, boolean force, IObbActionListener token, int nonce)520             public void unmountObb(
521                     String rawPath, boolean force, IObbActionListener token, int nonce)
522                     throws RemoteException {
523                 Parcel _data = Parcel.obtain();
524                 Parcel _reply = Parcel.obtain();
525                 try {
526                     _data.writeInterfaceToken(DESCRIPTOR);
527                     _data.writeString(rawPath);
528                     _data.writeInt((force ? 1 : 0));
529                     _data.writeStrongBinder((token != null ? token.asBinder() : null));
530                     _data.writeInt(nonce);
531                     mRemote.transact(Stub.TRANSACTION_unmountObb, _data, _reply, 0);
532                     _reply.readException();
533                 } finally {
534                     _reply.recycle();
535                     _data.recycle();
536                 }
537             }
538 
539             /**
540              * Checks whether the specified Opaque Binary Blob (OBB) is mounted
541              * somewhere.
542              */
isObbMounted(String rawPath)543             public boolean isObbMounted(String rawPath) throws RemoteException {
544                 Parcel _data = Parcel.obtain();
545                 Parcel _reply = Parcel.obtain();
546                 boolean _result;
547                 try {
548                     _data.writeInterfaceToken(DESCRIPTOR);
549                     _data.writeString(rawPath);
550                     mRemote.transact(Stub.TRANSACTION_isObbMounted, _data, _reply, 0);
551                     _reply.readException();
552                     _result = 0 != _reply.readInt();
553                 } finally {
554                     _reply.recycle();
555                     _data.recycle();
556                 }
557                 return _result;
558             }
559 
560             /**
561              * Gets the path to the mounted Opaque Binary Blob (OBB).
562              */
getMountedObbPath(String rawPath)563             public String getMountedObbPath(String rawPath) throws RemoteException {
564                 Parcel _data = Parcel.obtain();
565                 Parcel _reply = Parcel.obtain();
566                 String _result;
567                 try {
568                     _data.writeInterfaceToken(DESCRIPTOR);
569                     _data.writeString(rawPath);
570                     mRemote.transact(Stub.TRANSACTION_getMountedObbPath, _data, _reply, 0);
571                     _reply.readException();
572                     _result = _reply.readString();
573                 } finally {
574                     _reply.recycle();
575                     _data.recycle();
576                 }
577                 return _result;
578             }
579 
580             /**
581              * Returns whether the external storage is emulated.
582              */
isExternalStorageEmulated()583             public boolean isExternalStorageEmulated() throws RemoteException {
584                 Parcel _data = Parcel.obtain();
585                 Parcel _reply = Parcel.obtain();
586                 boolean _result;
587                 try {
588                     _data.writeInterfaceToken(DESCRIPTOR);
589                     mRemote.transact(Stub.TRANSACTION_isExternalStorageEmulated, _data, _reply, 0);
590                     _reply.readException();
591                     _result = 0 != _reply.readInt();
592                 } finally {
593                     _reply.recycle();
594                     _data.recycle();
595                 }
596                 return _result;
597             }
598 
getEncryptionState()599             public int getEncryptionState() throws RemoteException {
600                 Parcel _data = Parcel.obtain();
601                 Parcel _reply = Parcel.obtain();
602                 int _result;
603                 try {
604                     _data.writeInterfaceToken(DESCRIPTOR);
605                     mRemote.transact(Stub.TRANSACTION_getEncryptionState, _data, _reply, 0);
606                     _reply.readException();
607                     _result = _reply.readInt();
608                 } finally {
609                     _reply.recycle();
610                     _data.recycle();
611                 }
612                 return _result;
613             }
614 
decryptStorage(String password)615             public int decryptStorage(String password) throws RemoteException {
616                 Parcel _data = Parcel.obtain();
617                 Parcel _reply = Parcel.obtain();
618                 int _result;
619                 try {
620                     _data.writeInterfaceToken(DESCRIPTOR);
621                     _data.writeString(password);
622                     mRemote.transact(Stub.TRANSACTION_decryptStorage, _data, _reply, 0);
623                     _reply.readException();
624                     _result = _reply.readInt();
625                 } finally {
626                     _reply.recycle();
627                     _data.recycle();
628                 }
629                 return _result;
630             }
631 
encryptStorage(int type, String password)632             public int encryptStorage(int type, String password) throws RemoteException {
633                 Parcel _data = Parcel.obtain();
634                 Parcel _reply = Parcel.obtain();
635                 int _result;
636                 try {
637                     _data.writeInterfaceToken(DESCRIPTOR);
638                     _data.writeInt(type);
639                     _data.writeString(password);
640                     mRemote.transact(Stub.TRANSACTION_encryptStorage, _data, _reply, 0);
641                     _reply.readException();
642                     _result = _reply.readInt();
643                 } finally {
644                     _reply.recycle();
645                     _data.recycle();
646                 }
647                 return _result;
648             }
649 
changeEncryptionPassword(int type, String password)650             public int changeEncryptionPassword(int type, String password) throws RemoteException {
651                 Parcel _data = Parcel.obtain();
652                 Parcel _reply = Parcel.obtain();
653                 int _result;
654                 try {
655                     _data.writeInterfaceToken(DESCRIPTOR);
656                     _data.writeInt(type);
657                     _data.writeString(password);
658                     mRemote.transact(Stub.TRANSACTION_changeEncryptionPassword, _data, _reply, 0);
659                     _reply.readException();
660                     _result = _reply.readInt();
661                 } finally {
662                     _reply.recycle();
663                     _data.recycle();
664                 }
665                 return _result;
666             }
667 
668             @Override
verifyEncryptionPassword(String password)669             public int verifyEncryptionPassword(String password) throws RemoteException {
670                 Parcel _data = Parcel.obtain();
671                 Parcel _reply = Parcel.obtain();
672                 int _result;
673                 try {
674                     _data.writeInterfaceToken(DESCRIPTOR);
675                     _data.writeString(password);
676                     mRemote.transact(Stub.TRANSACTION_verifyEncryptionPassword, _data, _reply, 0);
677                     _reply.readException();
678                     _result = _reply.readInt();
679                 } finally {
680                     _reply.recycle();
681                     _data.recycle();
682                 }
683                 return _result;
684             }
685 
getPasswordType()686             public int getPasswordType() throws RemoteException {
687                 Parcel _data = Parcel.obtain();
688                 Parcel _reply = Parcel.obtain();
689                 int _result;
690                 try {
691                     _data.writeInterfaceToken(DESCRIPTOR);
692                     mRemote.transact(Stub.TRANSACTION_getPasswordType, _data, _reply, 0);
693                     _reply.readException();
694                     _result = _reply.readInt();
695                 } finally {
696                     _reply.recycle();
697                     _data.recycle();
698                 }
699                 return _result;
700             }
701 
getPassword()702             public String getPassword() throws RemoteException {
703                 Parcel _data = Parcel.obtain();
704                 Parcel _reply = Parcel.obtain();
705                 String _result;
706                 try {
707                     _data.writeInterfaceToken(DESCRIPTOR);
708                     mRemote.transact(Stub.TRANSACTION_getPassword, _data, _reply, 0);
709                     _reply.readException();
710                     _result = _reply.readString();
711                 } finally {
712                     _reply.recycle();
713                     _data.recycle();
714                 }
715                 return _result;
716             }
717 
clearPassword()718             public void clearPassword() throws RemoteException {
719                 Parcel _data = Parcel.obtain();
720                 Parcel _reply = Parcel.obtain();
721                 try {
722                     _data.writeInterfaceToken(DESCRIPTOR);
723                     mRemote.transact(Stub.TRANSACTION_clearPassword, _data, _reply, IBinder.FLAG_ONEWAY);
724                     _reply.readException();
725                 } finally {
726                     _reply.recycle();
727                     _data.recycle();
728                 }
729             }
730 
setField(String field, String data)731             public void setField(String field, String data) throws RemoteException {
732                 Parcel _data = Parcel.obtain();
733                 Parcel _reply = Parcel.obtain();
734                 try {
735                     _data.writeInterfaceToken(DESCRIPTOR);
736                     _data.writeString(field);
737                     _data.writeString(data);
738                     mRemote.transact(Stub.TRANSACTION_setField, _data, _reply, IBinder.FLAG_ONEWAY);
739                     _reply.readException();
740                 } finally {
741                     _reply.recycle();
742                     _data.recycle();
743                 }
744             }
745 
getField(String field)746             public String getField(String field) throws RemoteException {
747                 Parcel _data = Parcel.obtain();
748                 Parcel _reply = Parcel.obtain();
749                 String _result;
750                 try {
751                     _data.writeInterfaceToken(DESCRIPTOR);
752                     _data.writeString(field);
753                     mRemote.transact(Stub.TRANSACTION_getField, _data, _reply, 0);
754                     _reply.readException();
755                     _result = _reply.readString();
756                 } finally {
757                     _reply.recycle();
758                     _data.recycle();
759                 }
760                 return _result;
761             }
762 
isConvertibleToFBE()763             public boolean isConvertibleToFBE() throws RemoteException {
764                 Parcel _data = Parcel.obtain();
765                 Parcel _reply = Parcel.obtain();
766                 boolean _result;
767                 try {
768                     _data.writeInterfaceToken(DESCRIPTOR);
769                     mRemote.transact(Stub.TRANSACTION_isConvertibleToFBE, _data, _reply, 0);
770                     _reply.readException();
771                     _result = _reply.readInt() != 0;
772                 } finally {
773                     _reply.recycle();
774                     _data.recycle();
775                 }
776                 return _result;
777             }
778 
getVolumeList(int uid, String packageName, int flags)779             public StorageVolume[] getVolumeList(int uid, String packageName, int flags)
780                     throws RemoteException {
781                 Parcel _data = Parcel.obtain();
782                 Parcel _reply = Parcel.obtain();
783                 StorageVolume[] _result;
784                 try {
785                     _data.writeInterfaceToken(DESCRIPTOR);
786                     _data.writeInt(uid);
787                     _data.writeString(packageName);
788                     _data.writeInt(flags);
789                     mRemote.transact(Stub.TRANSACTION_getVolumeList, _data, _reply, 0);
790                     _reply.readException();
791                     _result = _reply.createTypedArray(StorageVolume.CREATOR);
792                 } finally {
793                     _reply.recycle();
794                     _data.recycle();
795                 }
796                 return _result;
797             }
798 
799             /*
800              * Returns the filesystem path of a mounted secure container.
801              */
getSecureContainerFilesystemPath(String id)802             public String getSecureContainerFilesystemPath(String id) throws RemoteException {
803                 Parcel _data = Parcel.obtain();
804                 Parcel _reply = Parcel.obtain();
805                 String _result;
806                 try {
807                     _data.writeInterfaceToken(DESCRIPTOR);
808                     _data.writeString(id);
809                     mRemote.transact(Stub.TRANSACTION_getSecureContainerFilesystemPath, _data, _reply, 0);
810                     _reply.readException();
811                     _result = _reply.readString();
812                 } finally {
813                     _reply.recycle();
814                     _data.recycle();
815                 }
816                 return _result;
817             }
818 
819             /**
820              * Fix permissions in a container which has just been created and
821              * populated. Returns an int consistent with MountServiceResultCode
822              */
fixPermissionsSecureContainer(String id, int gid, String filename)823             public int fixPermissionsSecureContainer(String id, int gid, String filename)
824                     throws RemoteException {
825                 Parcel _data = Parcel.obtain();
826                 Parcel _reply = Parcel.obtain();
827                 int _result;
828                 try {
829                     _data.writeInterfaceToken(DESCRIPTOR);
830                     _data.writeString(id);
831                     _data.writeInt(gid);
832                     _data.writeString(filename);
833                     mRemote.transact(Stub.TRANSACTION_fixPermissionsSecureContainer, _data, _reply, 0);
834                     _reply.readException();
835                     _result = _reply.readInt();
836                 } finally {
837                     _reply.recycle();
838                     _data.recycle();
839                 }
840                 return _result;
841             }
842 
843             @Override
mkdirs(String callingPkg, String path)844             public int mkdirs(String callingPkg, String path) throws RemoteException {
845                 Parcel _data = Parcel.obtain();
846                 Parcel _reply = Parcel.obtain();
847                 int _result;
848                 try {
849                     _data.writeInterfaceToken(DESCRIPTOR);
850                     _data.writeString(callingPkg);
851                     _data.writeString(path);
852                     mRemote.transact(Stub.TRANSACTION_mkdirs, _data, _reply, 0);
853                     _reply.readException();
854                     _result = _reply.readInt();
855                 } finally {
856                     _reply.recycle();
857                     _data.recycle();
858                 }
859                 return _result;
860             }
861 
862             @Override
resizeSecureContainer(String id, int sizeMb, String key)863             public int resizeSecureContainer(String id, int sizeMb, String key)
864                     throws RemoteException {
865                 Parcel _data = Parcel.obtain();
866                 Parcel _reply = Parcel.obtain();
867                 int _result;
868                 try {
869                     _data.writeInterfaceToken(DESCRIPTOR);
870                     _data.writeString(id);
871                     _data.writeInt(sizeMb);
872                     _data.writeString(key);
873                     mRemote.transact(Stub.TRANSACTION_resizeSecureContainer, _data, _reply, 0);
874                     _reply.readException();
875                     _result = _reply.readInt();
876                 } finally {
877                     _reply.recycle();
878                     _data.recycle();
879                 }
880                 return _result;
881             }
882 
883             @Override
lastMaintenance()884             public long lastMaintenance() throws RemoteException {
885                 Parcel _data = Parcel.obtain();
886                 Parcel _reply = Parcel.obtain();
887                 long _result;
888                 try {
889                     _data.writeInterfaceToken(DESCRIPTOR);
890                     mRemote.transact(Stub.TRANSACTION_lastMaintenance, _data, _reply, 0);
891                     _reply.readException();
892                     _result = _reply.readLong();
893                 } finally {
894                     _reply.recycle();
895                     _data.recycle();
896                 }
897                 return _result;
898             }
899 
900             @Override
runMaintenance()901             public void runMaintenance() throws RemoteException {
902                 Parcel _data = Parcel.obtain();
903                 Parcel _reply = Parcel.obtain();
904                 try {
905                     _data.writeInterfaceToken(DESCRIPTOR);
906                     mRemote.transact(Stub.TRANSACTION_runMaintenance, _data, _reply, 0);
907                     _reply.readException();
908                 } finally {
909                     _reply.recycle();
910                     _data.recycle();
911                 }
912                 return;
913             }
914 
915             @Override
waitForAsecScan()916             public void waitForAsecScan() throws RemoteException {
917                 Parcel _data = Parcel.obtain();
918                 Parcel _reply = Parcel.obtain();
919                 try {
920                     _data.writeInterfaceToken(DESCRIPTOR);
921                     mRemote.transact(Stub.TRANSACTION_waitForAsecScan, _data, _reply, 0);
922                     _reply.readException();
923                 } finally {
924                     _reply.recycle();
925                     _data.recycle();
926                 }
927                 return;
928             }
929 
930             @Override
getDisks()931             public DiskInfo[] getDisks() throws RemoteException {
932                 Parcel _data = Parcel.obtain();
933                 Parcel _reply = Parcel.obtain();
934                 DiskInfo[] _result;
935                 try {
936                     _data.writeInterfaceToken(DESCRIPTOR);
937                     mRemote.transact(Stub.TRANSACTION_getDisks, _data, _reply, 0);
938                     _reply.readException();
939                     _result = _reply.createTypedArray(DiskInfo.CREATOR);
940                 } finally {
941                     _reply.recycle();
942                     _data.recycle();
943                 }
944                 return _result;
945             }
946 
947             @Override
getVolumes(int _flags)948             public VolumeInfo[] getVolumes(int _flags) throws RemoteException {
949                 Parcel _data = Parcel.obtain();
950                 Parcel _reply = Parcel.obtain();
951                 VolumeInfo[] _result;
952                 try {
953                     _data.writeInterfaceToken(DESCRIPTOR);
954                     _data.writeInt(_flags);
955                     mRemote.transact(Stub.TRANSACTION_getVolumes, _data, _reply, 0);
956                     _reply.readException();
957                     _result = _reply.createTypedArray(VolumeInfo.CREATOR);
958                 } finally {
959                     _reply.recycle();
960                     _data.recycle();
961                 }
962                 return _result;
963             }
964 
965             @Override
getVolumeRecords(int _flags)966             public VolumeRecord[] getVolumeRecords(int _flags) throws RemoteException {
967                 Parcel _data = Parcel.obtain();
968                 Parcel _reply = Parcel.obtain();
969                 VolumeRecord[] _result;
970                 try {
971                     _data.writeInterfaceToken(DESCRIPTOR);
972                     _data.writeInt(_flags);
973                     mRemote.transact(Stub.TRANSACTION_getVolumeRecords, _data, _reply, 0);
974                     _reply.readException();
975                     _result = _reply.createTypedArray(VolumeRecord.CREATOR);
976                 } finally {
977                     _reply.recycle();
978                     _data.recycle();
979                 }
980                 return _result;
981             }
982 
983             @Override
mount(String volId)984             public void mount(String volId) throws RemoteException {
985                 Parcel _data = Parcel.obtain();
986                 Parcel _reply = Parcel.obtain();
987                 try {
988                     _data.writeInterfaceToken(DESCRIPTOR);
989                     _data.writeString(volId);
990                     mRemote.transact(Stub.TRANSACTION_mount, _data, _reply, 0);
991                     _reply.readException();
992                 } finally {
993                     _reply.recycle();
994                     _data.recycle();
995                 }
996             }
997 
998             @Override
unmount(String volId)999             public void unmount(String volId) throws RemoteException {
1000                 Parcel _data = Parcel.obtain();
1001                 Parcel _reply = Parcel.obtain();
1002                 try {
1003                     _data.writeInterfaceToken(DESCRIPTOR);
1004                     _data.writeString(volId);
1005                     mRemote.transact(Stub.TRANSACTION_unmount, _data, _reply, 0);
1006                     _reply.readException();
1007                 } finally {
1008                     _reply.recycle();
1009                     _data.recycle();
1010                 }
1011             }
1012 
1013             @Override
format(String volId)1014             public void format(String volId) throws RemoteException {
1015                 Parcel _data = Parcel.obtain();
1016                 Parcel _reply = Parcel.obtain();
1017                 try {
1018                     _data.writeInterfaceToken(DESCRIPTOR);
1019                     _data.writeString(volId);
1020                     mRemote.transact(Stub.TRANSACTION_format, _data, _reply, 0);
1021                     _reply.readException();
1022                 } finally {
1023                     _reply.recycle();
1024                     _data.recycle();
1025                 }
1026             }
1027 
1028             @Override
benchmark(String volId)1029             public long benchmark(String volId) throws RemoteException {
1030                 Parcel _data = Parcel.obtain();
1031                 Parcel _reply = Parcel.obtain();
1032                 try {
1033                     _data.writeInterfaceToken(DESCRIPTOR);
1034                     _data.writeString(volId);
1035                     mRemote.transact(Stub.TRANSACTION_benchmark, _data, _reply, 0);
1036                     _reply.readException();
1037                     return _reply.readLong();
1038                 } finally {
1039                     _reply.recycle();
1040                     _data.recycle();
1041                 }
1042             }
1043 
1044             @Override
partitionPublic(String diskId)1045             public void partitionPublic(String diskId) throws RemoteException {
1046                 Parcel _data = Parcel.obtain();
1047                 Parcel _reply = Parcel.obtain();
1048                 try {
1049                     _data.writeInterfaceToken(DESCRIPTOR);
1050                     _data.writeString(diskId);
1051                     mRemote.transact(Stub.TRANSACTION_partitionPublic, _data, _reply, 0);
1052                     _reply.readException();
1053                 } finally {
1054                     _reply.recycle();
1055                     _data.recycle();
1056                 }
1057             }
1058 
1059             @Override
partitionPrivate(String diskId)1060             public void partitionPrivate(String diskId) throws RemoteException {
1061                 Parcel _data = Parcel.obtain();
1062                 Parcel _reply = Parcel.obtain();
1063                 try {
1064                     _data.writeInterfaceToken(DESCRIPTOR);
1065                     _data.writeString(diskId);
1066                     mRemote.transact(Stub.TRANSACTION_partitionPrivate, _data, _reply, 0);
1067                     _reply.readException();
1068                 } finally {
1069                     _reply.recycle();
1070                     _data.recycle();
1071                 }
1072             }
1073 
1074             @Override
partitionMixed(String diskId, int ratio)1075             public void partitionMixed(String diskId, int ratio) throws RemoteException {
1076                 Parcel _data = Parcel.obtain();
1077                 Parcel _reply = Parcel.obtain();
1078                 try {
1079                     _data.writeInterfaceToken(DESCRIPTOR);
1080                     _data.writeString(diskId);
1081                     _data.writeInt(ratio);
1082                     mRemote.transact(Stub.TRANSACTION_partitionMixed, _data, _reply, 0);
1083                     _reply.readException();
1084                 } finally {
1085                     _reply.recycle();
1086                     _data.recycle();
1087                 }
1088             }
1089 
1090             @Override
setVolumeNickname(String fsUuid, String nickname)1091             public void setVolumeNickname(String fsUuid, String nickname) throws RemoteException {
1092                 Parcel _data = Parcel.obtain();
1093                 Parcel _reply = Parcel.obtain();
1094                 try {
1095                     _data.writeInterfaceToken(DESCRIPTOR);
1096                     _data.writeString(fsUuid);
1097                     _data.writeString(nickname);
1098                     mRemote.transact(Stub.TRANSACTION_setVolumeNickname, _data, _reply, 0);
1099                     _reply.readException();
1100                 } finally {
1101                     _reply.recycle();
1102                     _data.recycle();
1103                 }
1104             }
1105 
1106             @Override
setVolumeUserFlags(String fsUuid, int flags, int mask)1107             public void setVolumeUserFlags(String fsUuid, int flags, int mask) throws RemoteException {
1108                 Parcel _data = Parcel.obtain();
1109                 Parcel _reply = Parcel.obtain();
1110                 try {
1111                     _data.writeInterfaceToken(DESCRIPTOR);
1112                     _data.writeString(fsUuid);
1113                     _data.writeInt(flags);
1114                     _data.writeInt(mask);
1115                     mRemote.transact(Stub.TRANSACTION_setVolumeUserFlags, _data, _reply, 0);
1116                     _reply.readException();
1117                 } finally {
1118                     _reply.recycle();
1119                     _data.recycle();
1120                 }
1121             }
1122 
1123             @Override
forgetVolume(String fsUuid)1124             public void forgetVolume(String fsUuid) throws RemoteException {
1125                 Parcel _data = Parcel.obtain();
1126                 Parcel _reply = Parcel.obtain();
1127                 try {
1128                     _data.writeInterfaceToken(DESCRIPTOR);
1129                     _data.writeString(fsUuid);
1130                     mRemote.transact(Stub.TRANSACTION_forgetVolume, _data, _reply, 0);
1131                     _reply.readException();
1132                 } finally {
1133                     _reply.recycle();
1134                     _data.recycle();
1135                 }
1136             }
1137 
1138             @Override
forgetAllVolumes()1139             public void forgetAllVolumes() throws RemoteException {
1140                 Parcel _data = Parcel.obtain();
1141                 Parcel _reply = Parcel.obtain();
1142                 try {
1143                     _data.writeInterfaceToken(DESCRIPTOR);
1144                     mRemote.transact(Stub.TRANSACTION_forgetAllVolumes, _data, _reply, 0);
1145                     _reply.readException();
1146                 } finally {
1147                     _reply.recycle();
1148                     _data.recycle();
1149                 }
1150             }
1151 
1152             @Override
setDebugFlags(int _flags, int _mask)1153             public void setDebugFlags(int _flags, int _mask) throws RemoteException {
1154                 Parcel _data = Parcel.obtain();
1155                 Parcel _reply = Parcel.obtain();
1156                 try {
1157                     _data.writeInterfaceToken(DESCRIPTOR);
1158                     _data.writeInt(_flags);
1159                     _data.writeInt(_mask);
1160                     mRemote.transact(Stub.TRANSACTION_setDebugFlags, _data, _reply, 0);
1161                     _reply.readException();
1162                 } finally {
1163                     _reply.recycle();
1164                     _data.recycle();
1165                 }
1166             }
1167 
1168             @Override
getPrimaryStorageUuid()1169             public String getPrimaryStorageUuid() throws RemoteException {
1170                 Parcel _data = Parcel.obtain();
1171                 Parcel _reply = Parcel.obtain();
1172                 String _result;
1173                 try {
1174                     _data.writeInterfaceToken(DESCRIPTOR);
1175                     mRemote.transact(Stub.TRANSACTION_getPrimaryStorageUuid, _data, _reply, 0);
1176                     _reply.readException();
1177                     _result = _reply.readString();
1178                 } finally {
1179                     _reply.recycle();
1180                     _data.recycle();
1181                 }
1182                 return _result;
1183             }
1184 
1185             @Override
setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback)1186             public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback)
1187                     throws RemoteException {
1188                 Parcel _data = Parcel.obtain();
1189                 Parcel _reply = Parcel.obtain();
1190                 try {
1191                     _data.writeInterfaceToken(DESCRIPTOR);
1192                     _data.writeString(volumeUuid);
1193                     _data.writeStrongBinder((callback != null ? callback.asBinder() : null));
1194                     mRemote.transact(Stub.TRANSACTION_setPrimaryStorageUuid, _data, _reply, 0);
1195                     _reply.readException();
1196                 } finally {
1197                     _reply.recycle();
1198                     _data.recycle();
1199                 }
1200             }
1201 
1202             @Override
createUserKey(int userId, int serialNumber, boolean ephemeral)1203             public void createUserKey(int userId, int serialNumber, boolean ephemeral)
1204                     throws RemoteException {
1205                 Parcel _data = Parcel.obtain();
1206                 Parcel _reply = Parcel.obtain();
1207                 try {
1208                     _data.writeInterfaceToken(DESCRIPTOR);
1209                     _data.writeInt(userId);
1210                     _data.writeInt(serialNumber);
1211                     _data.writeInt(ephemeral ? 1 : 0);
1212                     mRemote.transact(Stub.TRANSACTION_createUserKey, _data, _reply, 0);
1213                     _reply.readException();
1214                 } finally {
1215                     _reply.recycle();
1216                     _data.recycle();
1217                 }
1218             }
1219 
1220             @Override
destroyUserKey(int userId)1221             public void destroyUserKey(int userId) throws RemoteException {
1222                 Parcel _data = Parcel.obtain();
1223                 Parcel _reply = Parcel.obtain();
1224                 try {
1225                     _data.writeInterfaceToken(DESCRIPTOR);
1226                     _data.writeInt(userId);
1227                     mRemote.transact(Stub.TRANSACTION_destroyUserKey, _data, _reply, 0);
1228                     _reply.readException();
1229                 } finally {
1230                     _reply.recycle();
1231                     _data.recycle();
1232                 }
1233             }
1234 
1235             @Override
addUserKeyAuth(int userId, int serialNumber, byte[] token, byte[] secret)1236             public void addUserKeyAuth(int userId, int serialNumber,
1237                     byte[] token, byte[] secret) throws RemoteException {
1238                 Parcel _data = Parcel.obtain();
1239                 Parcel _reply = Parcel.obtain();
1240                 try {
1241                     _data.writeInterfaceToken(DESCRIPTOR);
1242                     _data.writeInt(userId);
1243                     _data.writeInt(serialNumber);
1244                     _data.writeByteArray(token);
1245                     _data.writeByteArray(secret);
1246                     mRemote.transact(Stub.TRANSACTION_addUserKeyAuth, _data, _reply, 0);
1247                     _reply.readException();
1248                 } finally {
1249                     _reply.recycle();
1250                     _data.recycle();
1251                 }
1252             }
1253 
1254             @Override
fixateNewestUserKeyAuth(int userId)1255             public void fixateNewestUserKeyAuth(int userId) throws RemoteException {
1256                 Parcel _data = Parcel.obtain();
1257                 Parcel _reply = Parcel.obtain();
1258                 try {
1259                     _data.writeInterfaceToken(DESCRIPTOR);
1260                     _data.writeInt(userId);
1261                     mRemote.transact(Stub.TRANSACTION_fixateNewestUserKeyAuth, _data, _reply, 0);
1262                     _reply.readException();
1263                 } finally {
1264                     _reply.recycle();
1265                     _data.recycle();
1266                 }
1267             }
1268 
1269             @Override
unlockUserKey(int userId, int serialNumber, byte[] token, byte[] secret)1270             public void unlockUserKey(int userId, int serialNumber,
1271                     byte[] token, byte[] secret) throws RemoteException {
1272                 Parcel _data = Parcel.obtain();
1273                 Parcel _reply = Parcel.obtain();
1274                 try {
1275                     _data.writeInterfaceToken(DESCRIPTOR);
1276                     _data.writeInt(userId);
1277                     _data.writeInt(serialNumber);
1278                     _data.writeByteArray(token);
1279                     _data.writeByteArray(secret);
1280                     mRemote.transact(Stub.TRANSACTION_unlockUserKey, _data, _reply, 0);
1281                     _reply.readException();
1282                 } finally {
1283                     _reply.recycle();
1284                     _data.recycle();
1285                 }
1286             }
1287 
1288             @Override
lockUserKey(int userId)1289             public void lockUserKey(int userId) throws RemoteException {
1290                 Parcel _data = Parcel.obtain();
1291                 Parcel _reply = Parcel.obtain();
1292                 try {
1293                     _data.writeInterfaceToken(DESCRIPTOR);
1294                     _data.writeInt(userId);
1295                     mRemote.transact(Stub.TRANSACTION_lockUserKey, _data, _reply, 0);
1296                     _reply.readException();
1297                 } finally {
1298                     _reply.recycle();
1299                     _data.recycle();
1300                 }
1301             }
1302 
1303             @Override
isUserKeyUnlocked(int userId)1304             public boolean isUserKeyUnlocked(int userId) throws RemoteException {
1305                 Parcel _data = Parcel.obtain();
1306                 Parcel _reply = Parcel.obtain();
1307                 boolean _result;
1308                 try {
1309                     _data.writeInterfaceToken(DESCRIPTOR);
1310                     _data.writeInt(userId);
1311                     mRemote.transact(Stub.TRANSACTION_isUserKeyUnlocked, _data, _reply, 0);
1312                     _reply.readException();
1313                     _result = 0 != _reply.readInt();
1314                 } finally {
1315                     _reply.recycle();
1316                     _data.recycle();
1317                 }
1318                 return _result;
1319             }
1320 
1321             @Override
prepareUserStorage( String volumeUuid, int userId, int serialNumber, int flags)1322             public void prepareUserStorage(
1323                     String volumeUuid, int userId, int serialNumber, int flags)
1324                     throws RemoteException {
1325                 Parcel _data = Parcel.obtain();
1326                 Parcel _reply = Parcel.obtain();
1327                 try {
1328                     _data.writeInterfaceToken(DESCRIPTOR);
1329                     _data.writeString(volumeUuid);
1330                     _data.writeInt(userId);
1331                     _data.writeInt(serialNumber);
1332                     _data.writeInt(flags);
1333                     mRemote.transact(Stub.TRANSACTION_prepareUserStorage, _data, _reply, 0);
1334                     _reply.readException();
1335                 } finally {
1336                     _reply.recycle();
1337                     _data.recycle();
1338                 }
1339             }
1340 
1341             @Override
destroyUserStorage(String volumeUuid, int userId, int flags)1342             public void destroyUserStorage(String volumeUuid, int userId, int flags)
1343                     throws RemoteException {
1344                 Parcel _data = Parcel.obtain();
1345                 Parcel _reply = Parcel.obtain();
1346                 try {
1347                     _data.writeInterfaceToken(DESCRIPTOR);
1348                     _data.writeString(volumeUuid);
1349                     _data.writeInt(userId);
1350                     _data.writeInt(flags);
1351                     mRemote.transact(Stub.TRANSACTION_destroyUserStorage, _data, _reply, 0);
1352                     _reply.readException();
1353                 } finally {
1354                     _reply.recycle();
1355                     _data.recycle();
1356                 }
1357             }
1358 
1359             @Override
mountAppFuse(String name)1360             public ParcelFileDescriptor mountAppFuse(String name) throws RemoteException {
1361                 Parcel _data = Parcel.obtain();
1362                 Parcel _reply = Parcel.obtain();
1363                 ParcelFileDescriptor _result = null;
1364                 try {
1365                     _data.writeInterfaceToken(DESCRIPTOR);
1366                     _data.writeString(name);
1367                     mRemote.transact(Stub.TRANSACTION_mountAppFuse, _data, _reply, 0);
1368                     _reply.readException();
1369                     _result = _reply.<ParcelFileDescriptor>readParcelable(
1370                             ClassLoader.getSystemClassLoader());
1371                 } finally {
1372                     _reply.recycle();
1373                     _data.recycle();
1374                 }
1375                 return _result;
1376             }
1377         }
1378 
1379         private static final String DESCRIPTOR = "IMountService";
1380 
1381         static final int TRANSACTION_registerListener = IBinder.FIRST_CALL_TRANSACTION + 0;
1382 
1383         static final int TRANSACTION_unregisterListener = IBinder.FIRST_CALL_TRANSACTION + 1;
1384 
1385         static final int TRANSACTION_isUsbMassStorageConnected = IBinder.FIRST_CALL_TRANSACTION + 2;
1386 
1387         static final int TRANSACTION_setUsbMassStorageEnabled = IBinder.FIRST_CALL_TRANSACTION + 3;
1388 
1389         static final int TRANSACTION_isUsbMassStorageEnabled = IBinder.FIRST_CALL_TRANSACTION + 4;
1390 
1391         static final int TRANSACTION_mountVolume = IBinder.FIRST_CALL_TRANSACTION + 5;
1392 
1393         static final int TRANSACTION_unmountVolume = IBinder.FIRST_CALL_TRANSACTION + 6;
1394 
1395         static final int TRANSACTION_formatVolume = IBinder.FIRST_CALL_TRANSACTION + 7;
1396 
1397         static final int TRANSACTION_getStorageUsers = IBinder.FIRST_CALL_TRANSACTION + 8;
1398 
1399         static final int TRANSACTION_getVolumeState = IBinder.FIRST_CALL_TRANSACTION + 9;
1400 
1401         static final int TRANSACTION_createSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 10;
1402 
1403         static final int TRANSACTION_finalizeSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 11;
1404 
1405         static final int TRANSACTION_destroySecureContainer = IBinder.FIRST_CALL_TRANSACTION + 12;
1406 
1407         static final int TRANSACTION_mountSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 13;
1408 
1409         static final int TRANSACTION_unmountSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 14;
1410 
1411         static final int TRANSACTION_isSecureContainerMounted = IBinder.FIRST_CALL_TRANSACTION + 15;
1412 
1413         static final int TRANSACTION_renameSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 16;
1414 
1415         static final int TRANSACTION_getSecureContainerPath = IBinder.FIRST_CALL_TRANSACTION + 17;
1416 
1417         static final int TRANSACTION_getSecureContainerList = IBinder.FIRST_CALL_TRANSACTION + 18;
1418 
1419         static final int TRANSACTION_shutdown = IBinder.FIRST_CALL_TRANSACTION + 19;
1420 
1421         static final int TRANSACTION_finishMediaUpdate = IBinder.FIRST_CALL_TRANSACTION + 20;
1422 
1423         static final int TRANSACTION_mountObb = IBinder.FIRST_CALL_TRANSACTION + 21;
1424 
1425         static final int TRANSACTION_unmountObb = IBinder.FIRST_CALL_TRANSACTION + 22;
1426 
1427         static final int TRANSACTION_isObbMounted = IBinder.FIRST_CALL_TRANSACTION + 23;
1428 
1429         static final int TRANSACTION_getMountedObbPath = IBinder.FIRST_CALL_TRANSACTION + 24;
1430 
1431         static final int TRANSACTION_isExternalStorageEmulated = IBinder.FIRST_CALL_TRANSACTION + 25;
1432 
1433         static final int TRANSACTION_decryptStorage = IBinder.FIRST_CALL_TRANSACTION + 26;
1434 
1435         static final int TRANSACTION_encryptStorage = IBinder.FIRST_CALL_TRANSACTION + 27;
1436 
1437         static final int TRANSACTION_changeEncryptionPassword = IBinder.FIRST_CALL_TRANSACTION + 28;
1438 
1439         static final int TRANSACTION_getVolumeList = IBinder.FIRST_CALL_TRANSACTION + 29;
1440 
1441         static final int TRANSACTION_getSecureContainerFilesystemPath = IBinder.FIRST_CALL_TRANSACTION + 30;
1442 
1443         static final int TRANSACTION_getEncryptionState = IBinder.FIRST_CALL_TRANSACTION + 31;
1444 
1445         static final int TRANSACTION_verifyEncryptionPassword = IBinder.FIRST_CALL_TRANSACTION + 32;
1446 
1447         static final int TRANSACTION_fixPermissionsSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 33;
1448 
1449         static final int TRANSACTION_mkdirs = IBinder.FIRST_CALL_TRANSACTION + 34;
1450 
1451         static final int TRANSACTION_getPasswordType = IBinder.FIRST_CALL_TRANSACTION + 35;
1452 
1453         static final int TRANSACTION_getPassword = IBinder.FIRST_CALL_TRANSACTION + 36;
1454 
1455         static final int TRANSACTION_clearPassword = IBinder.FIRST_CALL_TRANSACTION + 37;
1456 
1457         static final int TRANSACTION_setField = IBinder.FIRST_CALL_TRANSACTION + 38;
1458 
1459         static final int TRANSACTION_getField = IBinder.FIRST_CALL_TRANSACTION + 39;
1460 
1461         static final int TRANSACTION_resizeSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 40;
1462 
1463         static final int TRANSACTION_lastMaintenance = IBinder.FIRST_CALL_TRANSACTION + 41;
1464 
1465         static final int TRANSACTION_runMaintenance = IBinder.FIRST_CALL_TRANSACTION + 42;
1466 
1467         static final int TRANSACTION_waitForAsecScan = IBinder.FIRST_CALL_TRANSACTION + 43;
1468 
1469         static final int TRANSACTION_getDisks = IBinder.FIRST_CALL_TRANSACTION + 44;
1470         static final int TRANSACTION_getVolumes = IBinder.FIRST_CALL_TRANSACTION + 45;
1471         static final int TRANSACTION_getVolumeRecords = IBinder.FIRST_CALL_TRANSACTION + 46;
1472 
1473         static final int TRANSACTION_mount = IBinder.FIRST_CALL_TRANSACTION + 47;
1474         static final int TRANSACTION_unmount = IBinder.FIRST_CALL_TRANSACTION + 48;
1475         static final int TRANSACTION_format = IBinder.FIRST_CALL_TRANSACTION + 49;
1476 
1477         static final int TRANSACTION_partitionPublic = IBinder.FIRST_CALL_TRANSACTION + 50;
1478         static final int TRANSACTION_partitionPrivate = IBinder.FIRST_CALL_TRANSACTION + 51;
1479         static final int TRANSACTION_partitionMixed = IBinder.FIRST_CALL_TRANSACTION + 52;
1480 
1481         static final int TRANSACTION_setVolumeNickname = IBinder.FIRST_CALL_TRANSACTION + 53;
1482         static final int TRANSACTION_setVolumeUserFlags = IBinder.FIRST_CALL_TRANSACTION + 54;
1483         static final int TRANSACTION_forgetVolume = IBinder.FIRST_CALL_TRANSACTION + 55;
1484         static final int TRANSACTION_forgetAllVolumes = IBinder.FIRST_CALL_TRANSACTION + 56;
1485 
1486         static final int TRANSACTION_getPrimaryStorageUuid = IBinder.FIRST_CALL_TRANSACTION + 57;
1487         static final int TRANSACTION_setPrimaryStorageUuid = IBinder.FIRST_CALL_TRANSACTION + 58;
1488 
1489         static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59;
1490         static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60;
1491 
1492         static final int TRANSACTION_createUserKey = IBinder.FIRST_CALL_TRANSACTION + 61;
1493         static final int TRANSACTION_destroyUserKey = IBinder.FIRST_CALL_TRANSACTION + 62;
1494 
1495         static final int TRANSACTION_unlockUserKey = IBinder.FIRST_CALL_TRANSACTION + 63;
1496         static final int TRANSACTION_lockUserKey = IBinder.FIRST_CALL_TRANSACTION + 64;
1497         static final int TRANSACTION_isUserKeyUnlocked = IBinder.FIRST_CALL_TRANSACTION + 65;
1498 
1499         static final int TRANSACTION_prepareUserStorage = IBinder.FIRST_CALL_TRANSACTION + 66;
1500         static final int TRANSACTION_destroyUserStorage = IBinder.FIRST_CALL_TRANSACTION + 67;
1501 
1502         static final int TRANSACTION_isConvertibleToFBE = IBinder.FIRST_CALL_TRANSACTION + 68;
1503 
1504         static final int TRANSACTION_mountAppFuse = IBinder.FIRST_CALL_TRANSACTION + 69;
1505 
1506         static final int TRANSACTION_addUserKeyAuth = IBinder.FIRST_CALL_TRANSACTION + 70;
1507 
1508         static final int TRANSACTION_fixateNewestUserKeyAuth = IBinder.FIRST_CALL_TRANSACTION + 71;
1509 
1510         /**
1511          * Cast an IBinder object into an IMountService interface, generating a
1512          * proxy if needed.
1513          */
asInterface(IBinder obj)1514         public static IMountService asInterface(IBinder obj) {
1515             if (obj == null) {
1516                 return null;
1517             }
1518             IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
1519             if (iin != null && iin instanceof IMountService) {
1520                 return (IMountService) iin;
1521             }
1522             return new IMountService.Stub.Proxy(obj);
1523         }
1524 
1525         /** Construct the stub at attach it to the interface. */
Stub()1526         public Stub() {
1527             attachInterface(this, DESCRIPTOR);
1528         }
1529 
asBinder()1530         public IBinder asBinder() {
1531             return this;
1532         }
1533 
1534         @Override
onTransact(int code, Parcel data, Parcel reply, int flags)1535         public boolean onTransact(int code, Parcel data, Parcel reply,
1536                 int flags) throws RemoteException {
1537             switch (code) {
1538                 case INTERFACE_TRANSACTION: {
1539                     reply.writeString(DESCRIPTOR);
1540                     return true;
1541                 }
1542                 case TRANSACTION_registerListener: {
1543                     data.enforceInterface(DESCRIPTOR);
1544                     IMountServiceListener listener;
1545                     listener = IMountServiceListener.Stub.asInterface(data.readStrongBinder());
1546                     registerListener(listener);
1547                     reply.writeNoException();
1548                     return true;
1549                 }
1550                 case TRANSACTION_unregisterListener: {
1551                     data.enforceInterface(DESCRIPTOR);
1552                     IMountServiceListener listener;
1553                     listener = IMountServiceListener.Stub.asInterface(data.readStrongBinder());
1554                     unregisterListener(listener);
1555                     reply.writeNoException();
1556                     return true;
1557                 }
1558                 case TRANSACTION_isUsbMassStorageConnected: {
1559                     data.enforceInterface(DESCRIPTOR);
1560                     boolean result = isUsbMassStorageConnected();
1561                     reply.writeNoException();
1562                     reply.writeInt((result ? 1 : 0));
1563                     return true;
1564                 }
1565                 case TRANSACTION_setUsbMassStorageEnabled: {
1566                     data.enforceInterface(DESCRIPTOR);
1567                     boolean enable;
1568                     enable = 0 != data.readInt();
1569                     setUsbMassStorageEnabled(enable);
1570                     reply.writeNoException();
1571                     return true;
1572                 }
1573                 case TRANSACTION_isUsbMassStorageEnabled: {
1574                     data.enforceInterface(DESCRIPTOR);
1575                     boolean result = isUsbMassStorageEnabled();
1576                     reply.writeNoException();
1577                     reply.writeInt((result ? 1 : 0));
1578                     return true;
1579                 }
1580                 case TRANSACTION_mountVolume: {
1581                     data.enforceInterface(DESCRIPTOR);
1582                     String mountPoint;
1583                     mountPoint = data.readString();
1584                     int resultCode = mountVolume(mountPoint);
1585                     reply.writeNoException();
1586                     reply.writeInt(resultCode);
1587                     return true;
1588                 }
1589                 case TRANSACTION_unmountVolume: {
1590                     data.enforceInterface(DESCRIPTOR);
1591                     String mountPoint;
1592                     mountPoint = data.readString();
1593                     boolean force = 0 != data.readInt();
1594                     boolean removeEncrypt = 0 != data.readInt();
1595                     unmountVolume(mountPoint, force, removeEncrypt);
1596                     reply.writeNoException();
1597                     return true;
1598                 }
1599                 case TRANSACTION_formatVolume: {
1600                     data.enforceInterface(DESCRIPTOR);
1601                     String mountPoint;
1602                     mountPoint = data.readString();
1603                     int result = formatVolume(mountPoint);
1604                     reply.writeNoException();
1605                     reply.writeInt(result);
1606                     return true;
1607                 }
1608                 case TRANSACTION_getStorageUsers: {
1609                     data.enforceInterface(DESCRIPTOR);
1610                     String path;
1611                     path = data.readString();
1612                     int[] pids = getStorageUsers(path);
1613                     reply.writeNoException();
1614                     reply.writeIntArray(pids);
1615                     return true;
1616                 }
1617                 case TRANSACTION_getVolumeState: {
1618                     data.enforceInterface(DESCRIPTOR);
1619                     String mountPoint;
1620                     mountPoint = data.readString();
1621                     String state = getVolumeState(mountPoint);
1622                     reply.writeNoException();
1623                     reply.writeString(state);
1624                     return true;
1625                 }
1626                 case TRANSACTION_createSecureContainer: {
1627                     data.enforceInterface(DESCRIPTOR);
1628                     String id;
1629                     id = data.readString();
1630                     int sizeMb;
1631                     sizeMb = data.readInt();
1632                     String fstype;
1633                     fstype = data.readString();
1634                     String key;
1635                     key = data.readString();
1636                     int ownerUid;
1637                     ownerUid = data.readInt();
1638                     boolean external;
1639                     external = 0 != data.readInt();
1640                     int resultCode = createSecureContainer(id, sizeMb, fstype, key, ownerUid,
1641                             external);
1642                     reply.writeNoException();
1643                     reply.writeInt(resultCode);
1644                     return true;
1645                 }
1646                 case TRANSACTION_finalizeSecureContainer: {
1647                     data.enforceInterface(DESCRIPTOR);
1648                     String id;
1649                     id = data.readString();
1650                     int resultCode = finalizeSecureContainer(id);
1651                     reply.writeNoException();
1652                     reply.writeInt(resultCode);
1653                     return true;
1654                 }
1655                 case TRANSACTION_destroySecureContainer: {
1656                     data.enforceInterface(DESCRIPTOR);
1657                     String id;
1658                     id = data.readString();
1659                     boolean force;
1660                     force = 0 != data.readInt();
1661                     int resultCode = destroySecureContainer(id, force);
1662                     reply.writeNoException();
1663                     reply.writeInt(resultCode);
1664                     return true;
1665                 }
1666                 case TRANSACTION_mountSecureContainer: {
1667                     data.enforceInterface(DESCRIPTOR);
1668                     String id;
1669                     id = data.readString();
1670                     String key;
1671                     key = data.readString();
1672                     int ownerUid;
1673                     ownerUid = data.readInt();
1674                     boolean readOnly;
1675                     readOnly = data.readInt() != 0;
1676                     int resultCode = mountSecureContainer(id, key, ownerUid, readOnly);
1677                     reply.writeNoException();
1678                     reply.writeInt(resultCode);
1679                     return true;
1680                 }
1681                 case TRANSACTION_unmountSecureContainer: {
1682                     data.enforceInterface(DESCRIPTOR);
1683                     String id;
1684                     id = data.readString();
1685                     boolean force;
1686                     force = 0 != data.readInt();
1687                     int resultCode = unmountSecureContainer(id, force);
1688                     reply.writeNoException();
1689                     reply.writeInt(resultCode);
1690                     return true;
1691                 }
1692                 case TRANSACTION_isSecureContainerMounted: {
1693                     data.enforceInterface(DESCRIPTOR);
1694                     String id;
1695                     id = data.readString();
1696                     boolean status = isSecureContainerMounted(id);
1697                     reply.writeNoException();
1698                     reply.writeInt((status ? 1 : 0));
1699                     return true;
1700                 }
1701                 case TRANSACTION_renameSecureContainer: {
1702                     data.enforceInterface(DESCRIPTOR);
1703                     String oldId;
1704                     oldId = data.readString();
1705                     String newId;
1706                     newId = data.readString();
1707                     int resultCode = renameSecureContainer(oldId, newId);
1708                     reply.writeNoException();
1709                     reply.writeInt(resultCode);
1710                     return true;
1711                 }
1712                 case TRANSACTION_getSecureContainerPath: {
1713                     data.enforceInterface(DESCRIPTOR);
1714                     String id;
1715                     id = data.readString();
1716                     String path = getSecureContainerPath(id);
1717                     reply.writeNoException();
1718                     reply.writeString(path);
1719                     return true;
1720                 }
1721                 case TRANSACTION_getSecureContainerList: {
1722                     data.enforceInterface(DESCRIPTOR);
1723                     String[] ids = getSecureContainerList();
1724                     reply.writeNoException();
1725                     reply.writeStringArray(ids);
1726                     return true;
1727                 }
1728                 case TRANSACTION_shutdown: {
1729                     data.enforceInterface(DESCRIPTOR);
1730                     IMountShutdownObserver observer;
1731                     observer = IMountShutdownObserver.Stub.asInterface(data
1732                             .readStrongBinder());
1733                     shutdown(observer);
1734                     reply.writeNoException();
1735                     return true;
1736                 }
1737                 case TRANSACTION_finishMediaUpdate: {
1738                     data.enforceInterface(DESCRIPTOR);
1739                     finishMediaUpdate();
1740                     reply.writeNoException();
1741                     return true;
1742                 }
1743                 case TRANSACTION_mountObb: {
1744                     data.enforceInterface(DESCRIPTOR);
1745                     final String rawPath = data.readString();
1746                     final String canonicalPath = data.readString();
1747                     final String key = data.readString();
1748                     IObbActionListener observer;
1749                     observer = IObbActionListener.Stub.asInterface(data.readStrongBinder());
1750                     int nonce;
1751                     nonce = data.readInt();
1752                     mountObb(rawPath, canonicalPath, key, observer, nonce);
1753                     reply.writeNoException();
1754                     return true;
1755                 }
1756                 case TRANSACTION_unmountObb: {
1757                     data.enforceInterface(DESCRIPTOR);
1758                     String filename;
1759                     filename = data.readString();
1760                     boolean force;
1761                     force = 0 != data.readInt();
1762                     IObbActionListener observer;
1763                     observer = IObbActionListener.Stub.asInterface(data.readStrongBinder());
1764                     int nonce;
1765                     nonce = data.readInt();
1766                     unmountObb(filename, force, observer, nonce);
1767                     reply.writeNoException();
1768                     return true;
1769                 }
1770                 case TRANSACTION_isObbMounted: {
1771                     data.enforceInterface(DESCRIPTOR);
1772                     String filename;
1773                     filename = data.readString();
1774                     boolean status = isObbMounted(filename);
1775                     reply.writeNoException();
1776                     reply.writeInt((status ? 1 : 0));
1777                     return true;
1778                 }
1779                 case TRANSACTION_getMountedObbPath: {
1780                     data.enforceInterface(DESCRIPTOR);
1781                     String filename;
1782                     filename = data.readString();
1783                     String mountedPath = getMountedObbPath(filename);
1784                     reply.writeNoException();
1785                     reply.writeString(mountedPath);
1786                     return true;
1787                 }
1788                 case TRANSACTION_isExternalStorageEmulated: {
1789                     data.enforceInterface(DESCRIPTOR);
1790                     boolean emulated = isExternalStorageEmulated();
1791                     reply.writeNoException();
1792                     reply.writeInt(emulated ? 1 : 0);
1793                     return true;
1794                 }
1795                 case TRANSACTION_decryptStorage: {
1796                     data.enforceInterface(DESCRIPTOR);
1797                     String password = data.readString();
1798                     int result = decryptStorage(password);
1799                     reply.writeNoException();
1800                     reply.writeInt(result);
1801                     return true;
1802                 }
1803                 case TRANSACTION_encryptStorage: {
1804                     data.enforceInterface(DESCRIPTOR);
1805                     int type = data.readInt();
1806                     String password = data.readString();
1807                     int result = encryptStorage(type, password);
1808                     reply.writeNoException();
1809                     reply.writeInt(result);
1810                     return true;
1811                 }
1812                 case TRANSACTION_changeEncryptionPassword: {
1813                     data.enforceInterface(DESCRIPTOR);
1814                     int type = data.readInt();
1815                     String password = data.readString();
1816                     int result = changeEncryptionPassword(type, password);
1817                     reply.writeNoException();
1818                     reply.writeInt(result);
1819                     return true;
1820                 }
1821                 case TRANSACTION_getVolumeList: {
1822                     data.enforceInterface(DESCRIPTOR);
1823                     int uid = data.readInt();
1824                     String packageName = data.readString();
1825                     int _flags = data.readInt();
1826                     StorageVolume[] result = getVolumeList(uid, packageName, _flags);
1827                     reply.writeNoException();
1828                     reply.writeTypedArray(result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1829                     return true;
1830                 }
1831                 case TRANSACTION_getSecureContainerFilesystemPath: {
1832                     data.enforceInterface(DESCRIPTOR);
1833                     String id;
1834                     id = data.readString();
1835                     String path = getSecureContainerFilesystemPath(id);
1836                     reply.writeNoException();
1837                     reply.writeString(path);
1838                     return true;
1839                 }
1840                 case TRANSACTION_getEncryptionState: {
1841                     data.enforceInterface(DESCRIPTOR);
1842                     int result = getEncryptionState();
1843                     reply.writeNoException();
1844                     reply.writeInt(result);
1845                     return true;
1846                 }
1847                 case TRANSACTION_fixPermissionsSecureContainer: {
1848                     data.enforceInterface(DESCRIPTOR);
1849                     String id;
1850                     id = data.readString();
1851                     int gid;
1852                     gid = data.readInt();
1853                     String filename;
1854                     filename = data.readString();
1855                     int resultCode = fixPermissionsSecureContainer(id, gid, filename);
1856                     reply.writeNoException();
1857                     reply.writeInt(resultCode);
1858                     return true;
1859                 }
1860                 case TRANSACTION_mkdirs: {
1861                     data.enforceInterface(DESCRIPTOR);
1862                     String callingPkg = data.readString();
1863                     String path = data.readString();
1864                     int result = mkdirs(callingPkg, path);
1865                     reply.writeNoException();
1866                     reply.writeInt(result);
1867                     return true;
1868                 }
1869                 case TRANSACTION_getPasswordType: {
1870                     data.enforceInterface(DESCRIPTOR);
1871                     int result = getPasswordType();
1872                     reply.writeNoException();
1873                     reply.writeInt(result);
1874                     return true;
1875                 }
1876                 case TRANSACTION_getPassword: {
1877                     data.enforceInterface(DESCRIPTOR);
1878                     String result = getPassword();
1879                     reply.writeNoException();
1880                     reply.writeString(result);
1881                     return true;
1882                 }
1883                 case TRANSACTION_clearPassword: {
1884                     data.enforceInterface(DESCRIPTOR);
1885                     clearPassword();
1886                     reply.writeNoException();
1887                     return true;
1888                 }
1889                 case TRANSACTION_setField: {
1890                     data.enforceInterface(DESCRIPTOR);
1891                     String field = data.readString();
1892                     String contents = data.readString();
1893                     setField(field, contents);
1894                     reply.writeNoException();
1895                     return true;
1896                 }
1897                 case TRANSACTION_getField: {
1898                     data.enforceInterface(DESCRIPTOR);
1899                     String field = data.readString();
1900                     String contents = getField(field);
1901                     reply.writeNoException();
1902                     reply.writeString(contents);
1903                     return true;
1904                 }
1905                 case TRANSACTION_isConvertibleToFBE: {
1906                     data.enforceInterface(DESCRIPTOR);
1907                     int resultCode = isConvertibleToFBE() ? 1 : 0;
1908                     reply.writeNoException();
1909                     reply.writeInt(resultCode);
1910                     return true;
1911                 }
1912                 case TRANSACTION_resizeSecureContainer: {
1913                     data.enforceInterface(DESCRIPTOR);
1914                     String id;
1915                     id = data.readString();
1916                     int sizeMb;
1917                     sizeMb = data.readInt();
1918                     String key;
1919                     key = data.readString();
1920                     int resultCode = resizeSecureContainer(id, sizeMb, key);
1921                     reply.writeNoException();
1922                     reply.writeInt(resultCode);
1923                     return true;
1924                 }
1925                 case TRANSACTION_lastMaintenance: {
1926                     data.enforceInterface(DESCRIPTOR);
1927                     long lastMaintenance = lastMaintenance();
1928                     reply.writeNoException();
1929                     reply.writeLong(lastMaintenance);
1930                     return true;
1931                 }
1932                 case TRANSACTION_runMaintenance: {
1933                     data.enforceInterface(DESCRIPTOR);
1934                     runMaintenance();
1935                     reply.writeNoException();
1936                     return true;
1937                 }
1938                 case TRANSACTION_waitForAsecScan: {
1939                     data.enforceInterface(DESCRIPTOR);
1940                     waitForAsecScan();
1941                     reply.writeNoException();
1942                     return true;
1943                 }
1944                 case TRANSACTION_getDisks: {
1945                     data.enforceInterface(DESCRIPTOR);
1946                     DiskInfo[] disks = getDisks();
1947                     reply.writeNoException();
1948                     reply.writeTypedArray(disks, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1949                     return true;
1950                 }
1951                 case TRANSACTION_getVolumes: {
1952                     data.enforceInterface(DESCRIPTOR);
1953                     int _flags = data.readInt();
1954                     VolumeInfo[] volumes = getVolumes(_flags);
1955                     reply.writeNoException();
1956                     reply.writeTypedArray(volumes, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1957                     return true;
1958                 }
1959                 case TRANSACTION_getVolumeRecords: {
1960                     data.enforceInterface(DESCRIPTOR);
1961                     int _flags = data.readInt();
1962                     VolumeRecord[] volumes = getVolumeRecords(_flags);
1963                     reply.writeNoException();
1964                     reply.writeTypedArray(volumes, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1965                     return true;
1966                 }
1967                 case TRANSACTION_mount: {
1968                     data.enforceInterface(DESCRIPTOR);
1969                     String volId = data.readString();
1970                     mount(volId);
1971                     reply.writeNoException();
1972                     return true;
1973                 }
1974                 case TRANSACTION_unmount: {
1975                     data.enforceInterface(DESCRIPTOR);
1976                     String volId = data.readString();
1977                     unmount(volId);
1978                     reply.writeNoException();
1979                     return true;
1980                 }
1981                 case TRANSACTION_format: {
1982                     data.enforceInterface(DESCRIPTOR);
1983                     String volId = data.readString();
1984                     format(volId);
1985                     reply.writeNoException();
1986                     return true;
1987                 }
1988                 case TRANSACTION_benchmark: {
1989                     data.enforceInterface(DESCRIPTOR);
1990                     String volId = data.readString();
1991                     long res = benchmark(volId);
1992                     reply.writeNoException();
1993                     reply.writeLong(res);
1994                     return true;
1995                 }
1996                 case TRANSACTION_partitionPublic: {
1997                     data.enforceInterface(DESCRIPTOR);
1998                     String diskId = data.readString();
1999                     partitionPublic(diskId);
2000                     reply.writeNoException();
2001                     return true;
2002                 }
2003                 case TRANSACTION_partitionPrivate: {
2004                     data.enforceInterface(DESCRIPTOR);
2005                     String diskId = data.readString();
2006                     partitionPrivate(diskId);
2007                     reply.writeNoException();
2008                     return true;
2009                 }
2010                 case TRANSACTION_partitionMixed: {
2011                     data.enforceInterface(DESCRIPTOR);
2012                     String diskId = data.readString();
2013                     int ratio = data.readInt();
2014                     partitionMixed(diskId, ratio);
2015                     reply.writeNoException();
2016                     return true;
2017                 }
2018                 case TRANSACTION_setVolumeNickname: {
2019                     data.enforceInterface(DESCRIPTOR);
2020                     String volId = data.readString();
2021                     String nickname = data.readString();
2022                     setVolumeNickname(volId, nickname);
2023                     reply.writeNoException();
2024                     return true;
2025                 }
2026                 case TRANSACTION_setVolumeUserFlags: {
2027                     data.enforceInterface(DESCRIPTOR);
2028                     String volId = data.readString();
2029                     int _flags = data.readInt();
2030                     int _mask = data.readInt();
2031                     setVolumeUserFlags(volId, _flags, _mask);
2032                     reply.writeNoException();
2033                     return true;
2034                 }
2035                 case TRANSACTION_forgetVolume: {
2036                     data.enforceInterface(DESCRIPTOR);
2037                     String fsUuid = data.readString();
2038                     forgetVolume(fsUuid);
2039                     reply.writeNoException();
2040                     return true;
2041                 }
2042                 case TRANSACTION_forgetAllVolumes: {
2043                     data.enforceInterface(DESCRIPTOR);
2044                     forgetAllVolumes();
2045                     reply.writeNoException();
2046                     return true;
2047                 }
2048                 case TRANSACTION_setDebugFlags: {
2049                     data.enforceInterface(DESCRIPTOR);
2050                     int _flags = data.readInt();
2051                     int _mask = data.readInt();
2052                     setDebugFlags(_flags, _mask);
2053                     reply.writeNoException();
2054                     return true;
2055                 }
2056                 case TRANSACTION_getPrimaryStorageUuid: {
2057                     data.enforceInterface(DESCRIPTOR);
2058                     String volumeUuid = getPrimaryStorageUuid();
2059                     reply.writeNoException();
2060                     reply.writeString(volumeUuid);
2061                     return true;
2062                 }
2063                 case TRANSACTION_setPrimaryStorageUuid: {
2064                     data.enforceInterface(DESCRIPTOR);
2065                     String volumeUuid = data.readString();
2066                     IPackageMoveObserver listener = IPackageMoveObserver.Stub.asInterface(
2067                             data.readStrongBinder());
2068                     setPrimaryStorageUuid(volumeUuid, listener);
2069                     reply.writeNoException();
2070                     return true;
2071                 }
2072                 case TRANSACTION_createUserKey: {
2073                     data.enforceInterface(DESCRIPTOR);
2074                     int userId = data.readInt();
2075                     int serialNumber = data.readInt();
2076                     boolean ephemeral = data.readInt() != 0;
2077                     createUserKey(userId, serialNumber, ephemeral);
2078                     reply.writeNoException();
2079                     return true;
2080                 }
2081                 case TRANSACTION_destroyUserKey: {
2082                     data.enforceInterface(DESCRIPTOR);
2083                     int userId = data.readInt();
2084                     destroyUserKey(userId);
2085                     reply.writeNoException();
2086                     return true;
2087                 }
2088                 case TRANSACTION_addUserKeyAuth: {
2089                     data.enforceInterface(DESCRIPTOR);
2090                     int userId = data.readInt();
2091                     int serialNumber = data.readInt();
2092                     byte[] token = data.createByteArray();
2093                     byte[] secret = data.createByteArray();
2094                     addUserKeyAuth(userId, serialNumber, token, secret);
2095                     reply.writeNoException();
2096                     return true;
2097                 }
2098                 case TRANSACTION_fixateNewestUserKeyAuth: {
2099                     data.enforceInterface(DESCRIPTOR);
2100                     int userId = data.readInt();
2101                     fixateNewestUserKeyAuth(userId);
2102                     reply.writeNoException();
2103                     return true;
2104                 }
2105                 case TRANSACTION_unlockUserKey: {
2106                     data.enforceInterface(DESCRIPTOR);
2107                     int userId = data.readInt();
2108                     int serialNumber = data.readInt();
2109                     byte[] token = data.createByteArray();
2110                     byte[] secret = data.createByteArray();
2111                     unlockUserKey(userId, serialNumber, token, secret);
2112                     reply.writeNoException();
2113                     return true;
2114                 }
2115                 case TRANSACTION_lockUserKey: {
2116                     data.enforceInterface(DESCRIPTOR);
2117                     int userId = data.readInt();
2118                     lockUserKey(userId);
2119                     reply.writeNoException();
2120                     return true;
2121                 }
2122                 case TRANSACTION_isUserKeyUnlocked: {
2123                     data.enforceInterface(DESCRIPTOR);
2124                     int userId = data.readInt();
2125                     boolean result = isUserKeyUnlocked(userId);
2126                     reply.writeNoException();
2127                     reply.writeInt(result ? 1 : 0);
2128                     return true;
2129                 }
2130                 case TRANSACTION_prepareUserStorage: {
2131                     data.enforceInterface(DESCRIPTOR);
2132                     String volumeUuid = data.readString();
2133                     int userId = data.readInt();
2134                     int serialNumber = data.readInt();
2135                     int _flags = data.readInt();
2136                     prepareUserStorage(volumeUuid, userId, serialNumber, _flags);
2137                     reply.writeNoException();
2138                     return true;
2139                 }
2140                 case TRANSACTION_destroyUserStorage: {
2141                     data.enforceInterface(DESCRIPTOR);
2142                     String volumeUuid = data.readString();
2143                     int userId = data.readInt();
2144                     int _flags = data.readInt();
2145                     destroyUserStorage(volumeUuid, userId, _flags);
2146                     reply.writeNoException();
2147                     return true;
2148                 }
2149                 case TRANSACTION_mountAppFuse: {
2150                     data.enforceInterface(DESCRIPTOR);
2151                     String name = data.readString();
2152                     ParcelFileDescriptor fd = mountAppFuse(name);
2153                     reply.writeNoException();
2154                     reply.writeParcelable(fd, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2155                     return true;
2156                 }
2157             }
2158             return super.onTransact(code, data, reply, flags);
2159         }
2160     }
2161 
2162     /*
2163      * Creates a secure container with the specified parameters. Returns an int
2164      * consistent with MountServiceResultCode
2165      */
createSecureContainer(String id, int sizeMb, String fstype, String key, int ownerUid, boolean external)2166     public int createSecureContainer(String id, int sizeMb, String fstype, String key,
2167             int ownerUid, boolean external) throws RemoteException;
2168 
2169     /*
2170      * Destroy a secure container, and free up all resources associated with it.
2171      * NOTE: Ensure all references are released prior to deleting. Returns an
2172      * int consistent with MountServiceResultCode
2173      */
destroySecureContainer(String id, boolean force)2174     public int destroySecureContainer(String id, boolean force) throws RemoteException;
2175 
2176     /*
2177      * Finalize a container which has just been created and populated. After
2178      * finalization, the container is immutable. Returns an int consistent with
2179      * MountServiceResultCode
2180      */
finalizeSecureContainer(String id)2181     public int finalizeSecureContainer(String id) throws RemoteException;
2182 
2183     /**
2184      * Call into MountService by PackageManager to notify that its done
2185      * processing the media status update request.
2186      */
finishMediaUpdate()2187     public void finishMediaUpdate() throws RemoteException;
2188 
2189     /**
2190      * Format external storage given a mount point. Returns an int consistent
2191      * with MountServiceResultCode
2192      */
formatVolume(String mountPoint)2193     public int formatVolume(String mountPoint) throws RemoteException;
2194 
2195     /**
2196      * Gets the path to the mounted Opaque Binary Blob (OBB).
2197      */
getMountedObbPath(String rawPath)2198     public String getMountedObbPath(String rawPath) throws RemoteException;
2199 
2200     /**
2201      * Gets an Array of currently known secure container IDs
2202      */
getSecureContainerList()2203     public String[] getSecureContainerList() throws RemoteException;
2204 
2205     /*
2206      * Returns the filesystem path of a mounted secure container.
2207      */
getSecureContainerPath(String id)2208     public String getSecureContainerPath(String id) throws RemoteException;
2209 
2210     /**
2211      * Returns an array of pids with open files on the specified path.
2212      */
getStorageUsers(String path)2213     public int[] getStorageUsers(String path) throws RemoteException;
2214 
2215     /**
2216      * Gets the state of a volume via its mountpoint.
2217      */
getVolumeState(String mountPoint)2218     public String getVolumeState(String mountPoint) throws RemoteException;
2219 
2220     /**
2221      * Checks whether the specified Opaque Binary Blob (OBB) is mounted
2222      * somewhere.
2223      */
isObbMounted(String rawPath)2224     public boolean isObbMounted(String rawPath) throws RemoteException;
2225 
2226     /*
2227      * Returns true if the specified container is mounted
2228      */
isSecureContainerMounted(String id)2229     public boolean isSecureContainerMounted(String id) throws RemoteException;
2230 
2231     /**
2232      * Returns true if a USB mass storage host is connected
2233      */
isUsbMassStorageConnected()2234     public boolean isUsbMassStorageConnected() throws RemoteException;
2235 
2236     /**
2237      * Returns true if a USB mass storage host is enabled (media is shared)
2238      */
isUsbMassStorageEnabled()2239     public boolean isUsbMassStorageEnabled() throws RemoteException;
2240 
2241     /**
2242      * Mounts an Opaque Binary Blob (OBB) with the specified decryption key and
2243      * only allows the calling process's UID access to the contents.
2244      * MountService will call back to the supplied IObbActionListener to inform
2245      * it of the terminal state of the call.
2246      */
mountObb(String rawPath, String canonicalPath, String key, IObbActionListener token, int nonce)2247     public void mountObb(String rawPath, String canonicalPath, String key,
2248             IObbActionListener token, int nonce) throws RemoteException;
2249 
2250     /*
2251      * Mount a secure container with the specified key and owner UID. Returns an
2252      * int consistent with MountServiceResultCode
2253      */
mountSecureContainer(String id, String key, int ownerUid, boolean readOnly)2254     public int mountSecureContainer(String id, String key, int ownerUid, boolean readOnly)
2255             throws RemoteException;
2256 
2257     /**
2258      * Mount external storage at given mount point. Returns an int consistent
2259      * with MountServiceResultCode
2260      */
mountVolume(String mountPoint)2261     public int mountVolume(String mountPoint) throws RemoteException;
2262 
2263     /**
2264      * Registers an IMountServiceListener for receiving async notifications.
2265      */
registerListener(IMountServiceListener listener)2266     public void registerListener(IMountServiceListener listener) throws RemoteException;
2267 
2268     /*
2269      * Rename an unmounted secure container. Returns an int consistent with
2270      * MountServiceResultCode
2271      */
renameSecureContainer(String oldId, String newId)2272     public int renameSecureContainer(String oldId, String newId) throws RemoteException;
2273 
2274     /**
2275      * Enables / disables USB mass storage. The caller should check actual
2276      * status of enabling/disabling USB mass storage via StorageEventListener.
2277      */
setUsbMassStorageEnabled(boolean enable)2278     public void setUsbMassStorageEnabled(boolean enable) throws RemoteException;
2279 
2280     /**
2281      * Shuts down the MountService and gracefully unmounts all external media.
2282      * Invokes call back once the shutdown is complete.
2283      */
shutdown(IMountShutdownObserver observer)2284     public void shutdown(IMountShutdownObserver observer) throws RemoteException;
2285 
2286     /**
2287      * Unmounts an Opaque Binary Blob (OBB). When the force flag is specified,
2288      * any program using it will be forcibly killed to unmount the image.
2289      * MountService will call back to the supplied IObbActionListener to inform
2290      * it of the terminal state of the call.
2291      */
unmountObb(String rawPath, boolean force, IObbActionListener token, int nonce)2292     public void unmountObb(String rawPath, boolean force, IObbActionListener token, int nonce)
2293             throws RemoteException;
2294 
2295     /*
2296      * Unount a secure container. Returns an int consistent with
2297      * MountServiceResultCode
2298      */
unmountSecureContainer(String id, boolean force)2299     public int unmountSecureContainer(String id, boolean force) throws RemoteException;
2300 
2301     /**
2302      * Safely unmount external storage at given mount point. The unmount is an
2303      * asynchronous operation. Applications should register StorageEventListener
2304      * for storage related status changes.
2305      * @param mountPoint the mount point
2306      * @param force whether or not to forcefully unmount it (e.g. even if programs are using this
2307      *     data currently)
2308      * @param removeEncryption whether or not encryption mapping should be removed from the volume.
2309      *     This value implies {@code force}.
2310      */
unmountVolume(String mountPoint, boolean force, boolean removeEncryption)2311     public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption)
2312             throws RemoteException;
2313 
2314     /**
2315      * Unregisters an IMountServiceListener
2316      */
unregisterListener(IMountServiceListener listener)2317     public void unregisterListener(IMountServiceListener listener) throws RemoteException;
2318 
2319     /**
2320      * Returns whether or not the external storage is emulated.
2321      */
isExternalStorageEmulated()2322     public boolean isExternalStorageEmulated() throws RemoteException;
2323 
2324     /** The volume is not encrypted. */
2325     static final int ENCRYPTION_STATE_NONE = 1;
2326     /** The volume has been encrypted succesfully. */
2327     static final int ENCRYPTION_STATE_OK = 0;
2328     /** The volume is in a bad state.*/
2329     static final int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
2330     /** Encryption is incomplete */
2331     static final int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
2332     /** Encryption is incomplete and irrecoverable */
2333     static final int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
2334     /** Underlying data is corrupt */
2335     static final int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
2336 
2337     /**
2338      * Determines the encryption state of the volume.
2339      * @return a numerical value. See {@code ENCRYPTION_STATE_*} for possible
2340      * values.
2341      * Note that this has been replaced in most cases by the APIs in
2342      * StorageManager (see isEncryptable and below)
2343      * This is still useful to get the error state when encryption has failed
2344      * and CryptKeeper needs to throw up a screen advising the user what to do
2345      */
getEncryptionState()2346     public int getEncryptionState() throws RemoteException;
2347 
2348     /**
2349      * Decrypts any encrypted volumes.
2350      */
decryptStorage(String password)2351     public int decryptStorage(String password) throws RemoteException;
2352 
2353     /**
2354      * Encrypts storage.
2355      */
encryptStorage(int type, String password)2356     public int encryptStorage(int type, String password) throws RemoteException;
2357 
2358     /**
2359      * Changes the encryption password.
2360      */
changeEncryptionPassword(int type, String password)2361     public int changeEncryptionPassword(int type, String password)
2362         throws RemoteException;
2363 
2364     /**
2365      * Verify the encryption password against the stored volume.  This method
2366      * may only be called by the system process.
2367      */
verifyEncryptionPassword(String password)2368     public int verifyEncryptionPassword(String password) throws RemoteException;
2369 
2370     /**
2371      * Returns list of all mountable volumes.
2372      */
getVolumeList(int uid, String packageName, int flags)2373     public StorageVolume[] getVolumeList(int uid, String packageName, int flags) throws RemoteException;
2374 
2375     /**
2376      * Gets the path on the filesystem for the ASEC container itself.
2377      *
2378      * @param cid ASEC container ID
2379      * @return path to filesystem or {@code null} if it's not found
2380      * @throws RemoteException
2381      */
getSecureContainerFilesystemPath(String cid)2382     public String getSecureContainerFilesystemPath(String cid) throws RemoteException;
2383 
2384     /*
2385      * Fix permissions in a container which has just been created and populated.
2386      * Returns an int consistent with MountServiceResultCode
2387      */
fixPermissionsSecureContainer(String id, int gid, String filename)2388     public int fixPermissionsSecureContainer(String id, int gid, String filename)
2389             throws RemoteException;
2390 
2391     /**
2392      * Ensure that all directories along given path exist, creating parent
2393      * directories as needed. Validates that given path is absolute and that it
2394      * contains no relative "." or ".." paths or symlinks. Also ensures that
2395      * path belongs to a volume managed by vold, and that path is either
2396      * external storage data or OBB directory belonging to calling app.
2397      */
mkdirs(String callingPkg, String path)2398     public int mkdirs(String callingPkg, String path) throws RemoteException;
2399 
2400     /**
2401      * Determines the type of the encryption password
2402      * @return PasswordType
2403      */
getPasswordType()2404     public int getPasswordType() throws RemoteException;
2405 
2406     /**
2407      * Get password from vold
2408      * @return password or empty string
2409      */
getPassword()2410     public String getPassword() throws RemoteException;
2411 
2412     /**
2413      * Securely clear password from vold
2414      */
clearPassword()2415     public void clearPassword() throws RemoteException;
2416 
2417     /**
2418      * Set a field in the crypto header.
2419      * @param field field to set
2420      * @param contents contents to set in field
2421      */
setField(String field, String contents)2422     public void setField(String field, String contents) throws RemoteException;
2423 
2424     /**
2425      * Gets a field from the crypto header.
2426      * @param field field to get
2427      * @return contents of field
2428      */
getField(String field)2429     public String getField(String field) throws RemoteException;
2430 
isConvertibleToFBE()2431     public boolean isConvertibleToFBE() throws RemoteException;
2432 
resizeSecureContainer(String id, int sizeMb, String key)2433     public int resizeSecureContainer(String id, int sizeMb, String key) throws RemoteException;
2434 
2435     /**
2436      * Report the time of the last maintenance operation such as fstrim.
2437      * @return Timestamp of the last maintenance operation, in the
2438      *     System.currentTimeMillis() time base
2439      * @throws RemoteException
2440      */
lastMaintenance()2441     public long lastMaintenance() throws RemoteException;
2442 
2443     /**
2444      * Kick off an immediate maintenance operation
2445      * @throws RemoteException
2446      */
runMaintenance()2447     public void runMaintenance() throws RemoteException;
2448 
waitForAsecScan()2449     public void waitForAsecScan() throws RemoteException;
2450 
getDisks()2451     public DiskInfo[] getDisks() throws RemoteException;
getVolumes(int flags)2452     public VolumeInfo[] getVolumes(int flags) throws RemoteException;
getVolumeRecords(int flags)2453     public VolumeRecord[] getVolumeRecords(int flags) throws RemoteException;
2454 
mount(String volId)2455     public void mount(String volId) throws RemoteException;
unmount(String volId)2456     public void unmount(String volId) throws RemoteException;
format(String volId)2457     public void format(String volId) throws RemoteException;
benchmark(String volId)2458     public long benchmark(String volId) throws RemoteException;
2459 
partitionPublic(String diskId)2460     public void partitionPublic(String diskId) throws RemoteException;
partitionPrivate(String diskId)2461     public void partitionPrivate(String diskId) throws RemoteException;
partitionMixed(String diskId, int ratio)2462     public void partitionMixed(String diskId, int ratio) throws RemoteException;
2463 
setVolumeNickname(String fsUuid, String nickname)2464     public void setVolumeNickname(String fsUuid, String nickname) throws RemoteException;
setVolumeUserFlags(String fsUuid, int flags, int mask)2465     public void setVolumeUserFlags(String fsUuid, int flags, int mask) throws RemoteException;
forgetVolume(String fsUuid)2466     public void forgetVolume(String fsUuid) throws RemoteException;
forgetAllVolumes()2467     public void forgetAllVolumes() throws RemoteException;
setDebugFlags(int flags, int mask)2468     public void setDebugFlags(int flags, int mask) throws RemoteException;
2469 
getPrimaryStorageUuid()2470     public String getPrimaryStorageUuid() throws RemoteException;
setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback)2471     public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback)
2472             throws RemoteException;
2473 
createUserKey(int userId, int serialNumber, boolean ephemeral)2474     public void createUserKey(int userId, int serialNumber, boolean ephemeral)
2475             throws RemoteException;
destroyUserKey(int userId)2476     public void destroyUserKey(int userId) throws RemoteException;
addUserKeyAuth(int userId, int serialNumber, byte[] token, byte[] secret)2477     public void addUserKeyAuth(int userId, int serialNumber,
2478             byte[] token, byte[] secret) throws RemoteException;
fixateNewestUserKeyAuth(int userId)2479     public void fixateNewestUserKeyAuth(int userId) throws RemoteException;
2480 
unlockUserKey(int userId, int serialNumber, byte[] token, byte[] secret)2481     public void unlockUserKey(int userId, int serialNumber,
2482             byte[] token, byte[] secret) throws RemoteException;
lockUserKey(int userId)2483     public void lockUserKey(int userId) throws RemoteException;
isUserKeyUnlocked(int userId)2484     public boolean isUserKeyUnlocked(int userId) throws RemoteException;
2485 
prepareUserStorage(String volumeUuid, int userId, int serialNumber, int flags)2486     public void prepareUserStorage(String volumeUuid, int userId, int serialNumber,
2487             int flags) throws RemoteException;
destroyUserStorage(String volumeUuid, int userId, int flags)2488     public void destroyUserStorage(String volumeUuid, int userId, int flags) throws RemoteException;
2489 
mountAppFuse(String name)2490     public ParcelFileDescriptor mountAppFuse(String name) throws RemoteException;
2491 }
2492