-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AudioType Support #13
Conversation
- add AudioTypeResolver - add specific audio types - add AudioTypeChain - integrate into MapboxTelemetry
7e8722e
to
f48217e
Compare
@@ -0,0 +1,16 @@ | |||
package com.mapbox.services.android.telemetry.audio; | |||
|
|||
public class AudioTypeChain { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public
?
|
||
public class AudioTypeChain { | ||
|
||
public AudioTypeResolver setup() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here ☝️
|
||
import android.content.Context; | ||
|
||
public interface AudioTypeResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public
?
import android.content.Context; | ||
import android.media.AudioManager; | ||
|
||
public class HeadphonesAudioType implements AudioTypeResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public
?
import android.content.Context; | ||
import android.media.AudioManager; | ||
|
||
public class SpeakerAudioType implements AudioTypeResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public
?
|
||
import android.content.Context; | ||
|
||
public class UnknownAudioType implements AudioTypeResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public
?
@@ -277,4 +280,11 @@ public void onServiceDisconnected(ComponentName className) { | |||
serviceBound = false; | |||
} | |||
}; | |||
|
|||
public String obtainAudioType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are we using obtainAudioType()
? MapboxTelemetry
shouldn't expose this functionality. obtainAudioType()
should live in another class in which has more context of what it's doing. Events?
- create NavigationUtils - return audiotype there to dev - refactor audio classes out of their own directory, for later refactoring (likely into own Navigation directory)
* Add AudioType Support * NavigationUtils + Refactor
Adds audioType support with a chain of responsibility of:
speaker
>bluetooth
>headphones
>unknown