Loading core/java/android/app/SystemServiceRegistry.java +19 −13 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.content.IRestrictionsManager; import android.content.RestrictionsManager; import android.content.pm.IShortcutService; import android.content.pm.LauncherApps; import android.content.pm.PackageManager; import android.content.pm.ShortcutManager; import android.content.res.Resources; import android.hardware.ConsumerIrManager; Loading Loading @@ -651,9 +652,12 @@ final class SystemServiceRegistry { new CachedServiceFetcher<PrintManager>() { @Override public PrintManager createService(ContextImpl ctx) throws ServiceNotFoundException { // Get the services without throwing as this is an optional feature IBinder iBinder = ServiceManager.getService(Context.PRINT_SERVICE); IPrintManager service = IPrintManager.Stub.asInterface(iBinder); IPrintManager service = null; // If the feature not present, don't try to look up every time if (ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_PRINTING)) { service = IPrintManager.Stub.asInterface(ServiceManager .getServiceOrThrow(Context.PRINT_SERVICE)); } return new PrintManager(ctx.getOuterContext(), service, UserHandle.myUserId(), UserHandle.getAppId(Process.myUid())); }}); Loading @@ -663,11 +667,13 @@ final class SystemServiceRegistry { @Override public CompanionDeviceManager createService(ContextImpl ctx) throws ServiceNotFoundException { // Get the services without throwing as this is an optional feature IBinder iBinder = ServiceManager.getService(Context.COMPANION_DEVICE_SERVICE); ICompanionDeviceManager service = ICompanionDeviceManager.Stub.asInterface(iBinder); ICompanionDeviceManager service = null; // If the feature not present, don't try to look up every time if (ctx.getPackageManager().hasSystemFeature( PackageManager.FEATURE_COMPANION_DEVICE_SETUP)) { service = ICompanionDeviceManager.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.COMPANION_DEVICE_SERVICE)); } return new CompanionDeviceManager(service, ctx.getOuterContext()); }}); Loading Loading
core/java/android/app/SystemServiceRegistry.java +19 −13 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.content.IRestrictionsManager; import android.content.RestrictionsManager; import android.content.pm.IShortcutService; import android.content.pm.LauncherApps; import android.content.pm.PackageManager; import android.content.pm.ShortcutManager; import android.content.res.Resources; import android.hardware.ConsumerIrManager; Loading Loading @@ -651,9 +652,12 @@ final class SystemServiceRegistry { new CachedServiceFetcher<PrintManager>() { @Override public PrintManager createService(ContextImpl ctx) throws ServiceNotFoundException { // Get the services without throwing as this is an optional feature IBinder iBinder = ServiceManager.getService(Context.PRINT_SERVICE); IPrintManager service = IPrintManager.Stub.asInterface(iBinder); IPrintManager service = null; // If the feature not present, don't try to look up every time if (ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_PRINTING)) { service = IPrintManager.Stub.asInterface(ServiceManager .getServiceOrThrow(Context.PRINT_SERVICE)); } return new PrintManager(ctx.getOuterContext(), service, UserHandle.myUserId(), UserHandle.getAppId(Process.myUid())); }}); Loading @@ -663,11 +667,13 @@ final class SystemServiceRegistry { @Override public CompanionDeviceManager createService(ContextImpl ctx) throws ServiceNotFoundException { // Get the services without throwing as this is an optional feature IBinder iBinder = ServiceManager.getService(Context.COMPANION_DEVICE_SERVICE); ICompanionDeviceManager service = ICompanionDeviceManager.Stub.asInterface(iBinder); ICompanionDeviceManager service = null; // If the feature not present, don't try to look up every time if (ctx.getPackageManager().hasSystemFeature( PackageManager.FEATURE_COMPANION_DEVICE_SETUP)) { service = ICompanionDeviceManager.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.COMPANION_DEVICE_SERVICE)); } return new CompanionDeviceManager(service, ctx.getOuterContext()); }}); Loading