Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [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 | #pragma once |
| 18 | |
| 19 | #include "DisplayDevice.h" |
| 20 | #include "SurfaceFlinger.h" |
| 21 | |
| 22 | namespace android { |
| 23 | |
| 24 | class TestableSurfaceFlinger { |
| 25 | public: |
| 26 | // Extend this as needed for accessing SurfaceFlinger private (and public) |
| 27 | // functions. |
| 28 | |
| 29 | /* ------------------------------------------------------------------------ |
| 30 | * Forwarding for functions being tested |
| 31 | */ |
| 32 | auto getDefaultDisplayDeviceLocked() const { return mFlinger->getDefaultDisplayDeviceLocked(); } |
| 33 | |
| 34 | auto processDisplayChangesLocked() { return mFlinger->processDisplayChangesLocked(); } |
| 35 | |
| 36 | /* ------------------------------------------------------------------------ |
| 37 | * Read-write access to private data to set up preconditions and assert |
| 38 | * post-conditions. |
| 39 | */ |
| 40 | auto& mutableBuiltinDisplays() { return mFlinger->mBuiltinDisplays; } |
| 41 | |
| 42 | sp<SurfaceFlinger> mFlinger = new SurfaceFlinger(); |
| 43 | }; |
| 44 | |
| 45 | } // namespace android |