Add a sky media service to make it possible to play a sound.
I didn't exactly follow the android API, but pretty close. Also started a java/common implementation for things like DataPipeUtils. I only needed the ability to copy from a data pipe to a file, so that's the only function we have so far. Fixes https://github.com/domokit/mojo/issues/270 R=abarth@chromium.org, abarth@google.com Review URL: https://codereview.chromium.org/1211913005.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
package org.domokit.sky.shell;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@@ -11,6 +13,7 @@ import java.util.TreeMap;
|
||||
* An registry for services.
|
||||
**/
|
||||
public class ServiceRegistry {
|
||||
private static final String TAG = "ServiceRegistry";
|
||||
private Map<String, ServiceFactory> mRegistrations;
|
||||
|
||||
public static final ServiceRegistry SHARED = new ServiceRegistry();
|
||||
@@ -26,6 +29,9 @@ public class ServiceRegistry {
|
||||
}
|
||||
|
||||
public ServiceFactory get(String interfaceName) {
|
||||
if (!mRegistrations.containsKey(interfaceName)) {
|
||||
Log.e(TAG, "Unknown service " + interfaceName);
|
||||
}
|
||||
return mRegistrations.get(interfaceName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user