From 76fc7cbf696a560f0752d3e628ef64fdc02c8ce5 Mon Sep 17 00:00:00 2001 From: Grant Hernandez Date: Mon, 1 Jul 2019 15:01:43 -0700 Subject: [PATCH] MTP: add friend class for fuzz testing In preparation for fuzz testing the MtpServer, we need to be able to mock the IMtpHandle interface to avoid reading directly from the USB interface. Test: SANITIZE_TARGET='hwaddress fuzzer' mmm -j . Test: atest mtp_ffs_handle_test Change-Id: I79d023cbda75d6760bed22b659fa31328e9d81c5 --- media/mtp/MtpServer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/mtp/MtpServer.h b/media/mtp/MtpServer.h index 1f8799ff23..8cc9a9ade2 100644 --- a/media/mtp/MtpServer.h +++ b/media/mtp/MtpServer.h @@ -34,8 +34,11 @@ namespace android { class IMtpDatabase; class MtpStorage; +class MtpMockServer; class MtpServer { + // libFuzzer testing + friend class MtpMockServer; private: IMtpDatabase* mDatabase;