Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e586e08 authored by Andres Morales's avatar Andres Morales
Browse files

Don't register PDBService if not available on device

Bug: 16455896
Change-Id: If576ce8e837ba498f10848795706efb29e76974a
parent 054c6d96
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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) {