android.app.backup.BackupDataInputStream Java Examples

The following examples show how to use android.app.backup.BackupDataInputStream. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DbBackupHelper.java    From trackworktime with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void restoreEntity(final BackupDataInputStream data) {
	final DAO dao = new DAO(context);

	if (KEY.equals(data.getKey())) {
		final BufferedReader reader = new BufferedReader(new InputStreamReader(data));

		try {
			dao.restoreFromReader(reader);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	dao.close();
}
 
Example #2
Source File: SipProfilesHelper.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Read data from the input stream
 * 
 * @param data the input stream
 * @return the data
 * @throws IOException I/O error
 */
private String readData(BackupDataInputStream data) throws IOException {
    String dataS;
    byte[] buf = new byte[data.size()];
    data.read(buf, 0, buf.length);
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    DataInputStream dis = new DataInputStream(bais);
    dataS = dis.readUTF();
    dis.close();
    bais.close();
    return dataS;
}
 
Example #3
Source File: SipSharedPreferencesHelper.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Read data from the input stream
 * 
 * @param data the input stream
 * @return the data
 * @throws IOException I/O error
 */
private String readData(BackupDataInputStream data) throws IOException {
    String dataS;
    byte[] buf = new byte[data.size()];
    data.read(buf, 0, buf.length);
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    DataInputStream dis = new DataInputStream(bais);
    dataS = dis.readUTF();
    dis.close();
    bais.close();
    return dataS;
}
 
Example #4
Source File: LauncherPreferencesBackupHelper.java    From TurboLauncher with Apache License 2.0 4 votes vote down vote up
@Override
public void restoreEntity(BackupDataInputStream data) {
    if (mRestoreEnabled) {
        super.restoreEntity(data);
    }
}
 
Example #5
Source File: CarefulDatabaseBackupHelper.java    From android-device-identification with Apache License 2.0 4 votes vote down vote up
@Override
public void restoreEntity(BackupDataInputStream data) {
    stopContentProvider();
    super.restoreEntity(data);
}