- static const unsigned std_channel_counts[] = {8, 4, 2, 1};
+ // TODO: Don't return MONO even if the device supports it. This causes problems
+ // in AudioPolicyManager. Revisit.
+ static const unsigned std_out_channel_counts[] = {8, 4, 2/*, 1*/};
+ static const unsigned std_in_channel_counts[] = {8, 4, 2, 1};
+
+ unsigned * channel_counts =
+ profile->direction == PCM_OUT ? std_out_channel_counts : std_in_channel_counts;
+ unsigned num_channel_counts =
+ profile->direction == PCM_OUT
+ ? ARRAY_SIZE(std_out_channel_counts) : ARRAY_SIZE(std_in_channel_counts);