Robert Berry | 39194c0 | 2018-01-11 13:50:56 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.testing.shadows; |
| 18 | |
| 19 | import android.app.backup.BackupDataInput; |
| 20 | |
| 21 | import org.robolectric.annotation.Implementation; |
| 22 | import org.robolectric.annotation.Implements; |
| 23 | |
| 24 | import java.io.FileDescriptor; |
| 25 | import java.io.IOException; |
| 26 | |
| 27 | @Implements(BackupDataInput.class) |
| 28 | public 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 | } |