Prevent SecurityException during unit tests
Mock out displayOsd because it broadcasts an intent, which causes a runtime error due to missing permissions on ADT-4. Test: atest com.android.server.hdmi.SystemAudioAutoInitiationActionTest#testReceiveSystemAudioMode_systemAudioOn Bug: 289908764 Change-Id: Ie3020da76c6d9996119493dc042de8d91c414623
This commit is contained in:
@@ -81,6 +81,20 @@ public class SystemAudioAutoInitiationActionTest {
|
||||
protected void writeStringSystemProperty(String key, String value) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Override displayOsd to prevent it from broadcasting an intent, which
|
||||
* can trigger a SecurityException.
|
||||
*/
|
||||
@Override
|
||||
void displayOsd(int messageId) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
void displayOsd(int messageId, int extra) {
|
||||
// do nothing
|
||||
}
|
||||
};
|
||||
|
||||
mHdmiControlService.setIoLooper(myLooper);
|
||||
|
||||
Reference in New Issue
Block a user