diff options
author | Paul Lawrence <paullawrence@google.com> | 2014-03-18 10:56:00 -0700 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2014-04-02 07:16:05 -0700 |
commit | e51dcf98a4ddb1340cffba88059ad89f0b90909a (patch) | |
tree | af254b55a6ca13f1517b9acdec52008fef2e5f24 /services | |
parent | 9c3b2583b5fd9a610456cd42710808c5624f205b (diff) | |
download | frameworks_base-e51dcf98a4ddb1340cffba88059ad89f0b90909a.zip frameworks_base-e51dcf98a4ddb1340cffba88059ad89f0b90909a.tar.gz frameworks_base-e51dcf98a4ddb1340cffba88059ad89f0b90909a.tar.bz2 |
Save OwnerInfo so CryptKeeper can display at boot time
Requires vold change from
https://googleplex-android-review.git.corp.google.com/#/c/435164/
Bug: 13526708
Change-Id: I33153df9961832f72c3b8103bd5e1d3a17e77df3
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/MountService.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index c1d9fbd..b6e761c 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -158,6 +158,7 @@ class MountService extends IMountService.Stub public static final int VolumeListResult = 110; public static final int AsecListResult = 111; public static final int StorageUsersListResult = 112; + public static final int CryptfsGetfieldResult = 113; /* * 200 series - Requestion action has been successfully completed. @@ -2251,6 +2252,49 @@ class MountService extends IMountService.Stub } } + /** + * Set a field in the crypto header. + * @param field field to set + * @param contents contents to set in field + */ + @Override + public void setField(String field, String contents) throws RemoteException { + + waitForReady(); + + final NativeDaemonEvent event; + try { + event = mConnector.execute("cryptfs", "setfield", field, contents); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + /** + * Gets a field from the crypto header. + * @param field field to get + * @return contents of field + */ + @Override + public String getField(String field) throws RemoteException { + + waitForReady(); + + final NativeDaemonEvent event; + try { + final String[] contents = NativeDaemonEvent.filterMessageList( + mConnector.executeForList("cryptfs", "getfield", field), + VoldResponseCode.CryptfsGetfieldResult); + String result = new String(); + for (String content : contents) { + result += content; + } + return result; + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + @Override public String getPassword() throws RemoteException { if (!isReady()) { |