blob: 28489afce8d5d5731125d4acb3a5429a374fa5c5 [file] [log] [blame]
Robert Berry39194c02018-01-11 13:50:56 +00001/*
2 * Copyright (C) 2018 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
17package com.android.server.testing.shadows;
18
19import android.app.backup.BackupDataInput;
20
21import org.robolectric.annotation.Implementation;
22import org.robolectric.annotation.Implements;
23
24import java.io.FileDescriptor;
25import java.io.IOException;
26
27@Implements(BackupDataInput.class)
28public class ShadowBackupDataInput {
29 @Implementation
30 public void __constructor__(FileDescriptor fd) {
31 }
32
33 @Implementation
34 protected void finalize() throws Throwable {
35 }
36
37 @Implementation
38 public boolean readNextHeader() throws IOException {
39 return false;
40 }
41
42 @Implementation
43 public String getKey() {
44 throw new AssertionError("Can't call because readNextHeader() returned false");
45 }
46
47 @Implementation
48 public int getDataSize() {
49 throw new AssertionError("Can't call because readNextHeader() returned false");
50 }
51
52 @Implementation
53 public int readEntityData(byte[] data, int offset, int size) throws IOException {
54 throw new AssertionError("Can't call because readNextHeader() returned false");
55 }
56
57 @Implementation
58 public void skipEntityData() throws IOException {
59 throw new AssertionError("Can't call because readNextHeader() returned false");
60 }
61}