Don't register PDBService if not available on device
Bug: 16455896 Change-Id: If576ce8e837ba498f10848795706efb29e76974a
This commit is contained in:
@@ -762,9 +762,16 @@ class ContextImpl extends Context {
|
||||
registerService(PERSISTENT_DATA_BLOCK_SERVICE, new ServiceFetcher() {
|
||||
public Object createService(ContextImpl ctx) {
|
||||
IBinder b = ServiceManager.getService(PERSISTENT_DATA_BLOCK_SERVICE);
|
||||
return new PersistentDataBlockManager(
|
||||
IPersistentDataBlockService.Stub.asInterface(b));
|
||||
}});
|
||||
IPersistentDataBlockService persistentDataBlockService =
|
||||
IPersistentDataBlockService.Stub.asInterface(b);
|
||||
if (persistentDataBlockService != null) {
|
||||
return new PersistentDataBlockManager(persistentDataBlockService);
|
||||
} else {
|
||||
// not supported
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
registerService(MEDIA_PROJECTION_SERVICE, new ServiceFetcher() {
|
||||
public Object createService(ContextImpl ctx) {
|
||||
|
||||
Reference in New Issue
Block a user