Suppress implicit-fallthrough warnings in audioflinger etc.

Add FALLTHROUGH_INTENDED for clang compiler.

Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I8875bc7ed073aae84d5df97eb39c8c745ca627ef
gugelfrei
Chih-Hung Hsieh 6 years ago
parent f8d13dee65
commit 2b48703770

@ -78,6 +78,8 @@ LOCAL_SHARED_LIBRARIES := \
liblog \
libutils \
LOCAL_HEADER_LIBRARIES := libbase_headers
LOCAL_MODULE := test-resampler
LOCAL_MODULE_TAGS := optional

@ -27,6 +27,7 @@
#include <math.h>
#include <audio_utils/primitives.h>
#include <audio_utils/sndfile.h>
#include <android-base/macros.h>
#include <utils/Vector.h>
#include <media/AudioBufferProvider.h>
#include <media/AudioResampler.h>
@ -87,14 +88,14 @@ int parseCSV(const char *string, Vector<int>& values)
}
return numValues;
}
// fall through
FALLTHROUGH_INTENDED;
case ',':
if (hadDigit) {
hadDigit = false;
numValues++;
break;
}
// fall through
FALLTHROUGH_INTENDED;
default:
return -1;
}

@ -248,7 +248,7 @@ bool AudioFlinger::EffectModule::updateState() {
switch (mState) {
case RESTART:
reset_l();
// FALL THROUGH
FALLTHROUGH_INTENDED;
case STARTING:
// clear auxiliary effect input buffer for next accumulation

@ -4357,7 +4357,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
isActive = false;
break;
}
// fall through
FALLTHROUGH_INTENDED;
case TrackBase::STOPPING_2:
case TrackBase::PAUSED:
case TrackBase::STOPPED:

@ -842,7 +842,7 @@ void AudioFlinger::PlaybackThread::Track::pause()
// Offloaded track was draining, we need to carry on draining when resumed
mResumeToStopping = true;
// fall through...
FALLTHROUGH_INTENDED;
case ACTIVE:
case RESUMING:
mState = PAUSING;

@ -34,6 +34,8 @@ LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
LOCAL_MODULE := libaudiopolicyenginedefault
LOCAL_MODULE_TAGS := optional
LOCAL_HEADER_LIBRARIES := libbase_headers
LOCAL_STATIC_LIBRARIES := \
libaudiopolicycomponents \

@ -25,6 +25,7 @@
#endif
#include "Engine.h"
#include <android-base/macros.h>
#include <AudioPolicyManagerObserver.h>
#include <AudioPort.h>
#include <IOProfile.h>
@ -302,7 +303,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
break;
}
// when in call, DTMF and PHONE strategies follow the same rules
// FALL THROUGH
FALLTHROUGH_INTENDED;
case STRATEGY_PHONE:
// Force use of only devices on primary output if:
@ -343,7 +344,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
if (device) break;
// if SCO device is requested but no SCO device is available, fall back to default case
// FALL THROUGH
FALLTHROUGH_INTENDED;
default: // FORCE_NONE
device = availableOutputDevicesType & AUDIO_DEVICE_OUT_HEARING_AID;
@ -416,7 +417,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
outputDeviceTypesToIgnore);
break;
}
// FALL THROUGH
FALLTHROUGH_INTENDED;
case STRATEGY_ENFORCED_AUDIBLE:
// strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION
@ -466,7 +467,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
}
}
// The second device used for sonification is the same as the device used by media strategy
// FALL THROUGH
FALLTHROUGH_INTENDED;
case STRATEGY_ACCESSIBILITY:
if (strategy == STRATEGY_ACCESSIBILITY) {
@ -496,7 +497,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
}
}
// For other cases, STRATEGY_ACCESSIBILITY behaves like STRATEGY_MEDIA
// FALL THROUGH
FALLTHROUGH_INTENDED;
// FIXME: STRATEGY_REROUTING follow STRATEGY_MEDIA for now
case STRATEGY_REROUTING:
@ -681,7 +682,7 @@ audio_devices_t Engine::getDeviceForInputSource(audio_source_t inputSource) cons
device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
break;
}
// FALL THROUGH
FALLTHROUGH_INTENDED;
default: // FORCE_NONE
if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {

Loading…
Cancel
Save