Source:
private void writeUserLocked ( android.content.pm.UserInfo userInfo ) { java.io.FileOutputStream fos = null ; android.util.AtomicFile userFile = new android.util.AtomicFile ( new java.io.File ( mUsersDir , ( ( userInfo.id ) + ( com.android.server.pm.UserManagerService.XML_SUFFIX ) ) ) ) ; try { fos = userFile.startWrite ( ) ; final java.io.BufferedOutputStream bos = new java.io.BufferedOutputStream ( fos ) ; final org.xmlpull.v1.XmlSerializer serializer = new com.android.internal.util.FastXmlSerializer ( ) ; serializer.setOutput ( bos , "utf-8" ) ; serializer.startDocument ( null , true ) ; serializer.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; serializer.startTag ( null , com.android.server.pm.UserManagerService.TAG_USER ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_ID , java.lang.Integer.toString ( userInfo.id ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_SERIAL_NO , java.lang.Integer.toString ( userInfo.serialNumber ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_FLAGS , java.lang.Integer.toString ( userInfo.flags ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_CREATION_TIME , java.lang.Long.toString ( userInfo.creationTime ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_LAST_LOGGED_IN_TIME , java.lang.Long.toString ( userInfo.lastLoggedInTime ) ) ; com.android.server.pm.UserManagerService.RestrictionsPinState pinState = mRestrictionsPinStates.get ( userInfo.id ) ; if ( pinState != null ) { if ( ( pinState.salt ) != 0 ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_SALT , java.lang.Long.toString ( pinState.salt ) ) ; } if ( ( pinState.pinHash ) != null ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PIN_HASH , pinState.pinHash ) ; } if ( ( pinState.failedAttempts ) != 0 ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_FAILED_ATTEMPTS , java.lang.Integer.toString ( pinState.failedAttempts ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_LAST_RETRY_MS , java.lang.Long.toString ( pinState.lastAttemptTime ) ) ; } } if ( ( userInfo.iconPath ) != null ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_ICON_PATH , userInfo.iconPath ) ; } if ( userInfo.partial ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PARTIAL , "true" ) ; } if ( userInfo.guestToRemove ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_GUEST_TO_REMOVE , "true" ) ; } if ( ( userInfo.profileGroupId ) != ( android.content.pm.UserInfo.NO_PROFILE_GROUP_ID ) ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PROFILE_GROUP_ID , java.lang.Integer.toString ( userInfo.profileGroupId ) ) ; } serializer.startTag ( null , com.android.server.pm.UserManagerService.TAG_NAME ) ; serializer.text ( userInfo.name ) ; serializer.endTag ( null , com.android.server.pm.UserManagerService.TAG_NAME ) ; android.os.Bundle restrictions = mUserRestrictions.get ( userInfo.id ) ; if ( restrictions != null ) { writeRestrictionsLocked ( serializer , restrictions ) ; } serializer.endTag ( null , com.android.server.pm.UserManagerService.TAG_USER ) ; serializer.endDocument ( ) ; userFile.finishWrite ( fos ) ; } catch ( java.lang.Exception ioe ) { android.util.Slog.e ( com.android.server.pm.UserManagerService.LOG_TAG , ( ( ( "Error writing user info " + ( userInfo.id ) ) + "\n" ) + ioe ) ) ; userFile.failWrite ( fos ) ; } }

Target:
private void writeUserLocked ( android.content.pm.UserInfo userInfo ) { java.io.FileOutputStream fos = null ; android.util.AtomicFile userFile = new android.util.AtomicFile ( new java.io.File ( mUsersDir , ( ( userInfo.id ) + ( com.android.server.pm.UserManagerService.XML_SUFFIX ) ) ) ) ; try { fos = userFile.startWrite ( ) ; final java.io.BufferedOutputStream bos = new java.io.BufferedOutputStream ( fos ) ; final org.xmlpull.v1.XmlSerializer serializer = new com.android.internal.util.FastXmlSerializer ( ) ; serializer.setOutput ( bos , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; serializer.startDocument ( null , true ) ; serializer.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; serializer.startTag ( null , com.android.server.pm.UserManagerService.TAG_USER ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_ID , java.lang.Integer.toString ( userInfo.id ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_SERIAL_NO , java.lang.Integer.toString ( userInfo.serialNumber ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_FLAGS , java.lang.Integer.toString ( userInfo.flags ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_CREATION_TIME , java.lang.Long.toString ( userInfo.creationTime ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_LAST_LOGGED_IN_TIME , java.lang.Long.toString ( userInfo.lastLoggedInTime ) ) ; com.android.server.pm.UserManagerService.RestrictionsPinState pinState = mRestrictionsPinStates.get ( userInfo.id ) ; if ( pinState != null ) { if ( ( pinState.salt ) != 0 ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_SALT , java.lang.Long.toString ( pinState.salt ) ) ; } if ( ( pinState.pinHash ) != null ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PIN_HASH , pinState.pinHash ) ; } if ( ( pinState.failedAttempts ) != 0 ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_FAILED_ATTEMPTS , java.lang.Integer.toString ( pinState.failedAttempts ) ) ; serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_LAST_RETRY_MS , java.lang.Long.toString ( pinState.lastAttemptTime ) ) ; } } if ( ( userInfo.iconPath ) != null ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_ICON_PATH , userInfo.iconPath ) ; } if ( userInfo.partial ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PARTIAL , "true" ) ; } if ( userInfo.guestToRemove ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_GUEST_TO_REMOVE , "true" ) ; } if ( ( userInfo.profileGroupId ) != ( android.content.pm.UserInfo.NO_PROFILE_GROUP_ID ) ) { serializer.attribute ( null , com.android.server.pm.UserManagerService.ATTR_PROFILE_GROUP_ID , java.lang.Integer.toString ( userInfo.profileGroupId ) ) ; } serializer.startTag ( null , com.android.server.pm.UserManagerService.TAG_NAME ) ; serializer.text ( userInfo.name ) ; serializer.endTag ( null , com.android.server.pm.UserManagerService.TAG_NAME ) ; android.os.Bundle restrictions = mUserRestrictions.get ( userInfo.id ) ; if ( restrictions != null ) { writeRestrictionsLocked ( serializer , restrictions ) ; } serializer.endTag ( null , com.android.server.pm.UserManagerService.TAG_USER ) ; serializer.endDocument ( ) ; userFile.finishWrite ( fos ) ; } catch ( java.lang.Exception ioe ) { android.util.Slog.e ( com.android.server.pm.UserManagerService.LOG_TAG , ( ( ( "Error writing user info " + ( userInfo.id ) ) + "\n" ) + ioe ) ) ; userFile.failWrite ( fos ) ; } }