private void doHeadlessMonitoringOn(HeadlessMonitoringOnMessage message) {
// The API is telling us to turn on monitoring.
DataInstance dataInstance = getDataInstance();
dataInstance.resumeMonitoring();
HeadlessMonitoringOnMessage.Options options = message.getOptions();
HeadlessMonitoringOnAckMessage ackMessage = HeadlessMonitoringOnAckMessage.create();
if (options != null) {
if (options.clearData()) {
doHeadlessClearData(null);
}
ackMessage.setOptions(options);
}
sendToContentScript(port, ackMessage);
}