No description
422b94e002
android.hardware.graphics.allocator@2.0-passthrough should be a header-only library to be fully reusable by vendor HALs. This also allows us to switch from virtual inheritance to templates, which is more straightforward. This changes nothing to the users and we still have these relations - AllocatorHal is an abstract class to be implemented by vendors or the default implementations - Gralloc[01]Hal are our default implementations - Allocator implements HIDL IAllocator interface on top of AllocatorHal What we do not like about virtual inheritance is that, given // abstract class B and D class B { virtual void foo() = 0; virtual void bar() = 0; }; class D : public virtual B { // foo is superceded by fooEnhanced in D void foo() { fooEnhanced(); } virtual void fooEnhanced() = 0; }; // an implementation of B class BImpl : public virtual B { void foo() {} void bar() {} }; // an implementation of D on top of BImpl class DImpl : public virtual D, public virtual BImpl { void fooEnhanced() {} }; we get "no unique final overrider" becase both D and BImpl implement foo. With non-virtual inheritance, on the other hand, we get "DImpl is abstract" because foo is still pure virtual implemented in DImpl. Templates solve the issue by allowing namespace detail{ template<typename T> class BImpl : public T { ... }; template<typename T> class DImpl : public BImpl<T> { ... }; } // namespace detail using BImpl = detail::BImpl<B>; using DImpl = detail::DImpl<D>; Test: boots Change-Id: Iccb513e4fc751e9a687a1ed2d9fb2192c8324a50 |
||
---|---|---|
audio | ||
automotive | ||
biometrics/fingerprint/2.1 | ||
bluetooth/1.0 | ||
boot/1.0 | ||
broadcastradio | ||
camera | ||
cas | ||
compatibility_matrices | ||
configstore | ||
contexthub/1.0 | ||
drm/1.0 | ||
dumpstate/1.0 | ||
gatekeeper/1.0 | ||
gnss/1.0 | ||
graphics | ||
health | ||
ir/1.0 | ||
keymaster/3.0 | ||
light | ||
media | ||
memtrack/1.0 | ||
neuralnetworks/1.0 | ||
nfc/1.0 | ||
oemlock/1.0 | ||
power | ||
radio | ||
renderscript/1.0 | ||
secure_element/1.0 | ||
sensors/1.0 | ||
soundtrigger/2.0 | ||
tests | ||
tetheroffload | ||
thermal | ||
tv | ||
usb | ||
vibrator | ||
vr/1.0 | ||
weaver/1.0 | ||
wifi | ||
.clang-format | ||
Android.bp | ||
CleanSpec.mk | ||
current.txt | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
OWNERS | ||
PREUPLOAD.cfg | ||
update-base-files.sh | ||
update-makefiles.sh |