Skip to content

Commit 23d50a3

Browse files
QuinceROMsjoeyhuab
authored andcommitted
core: Avoid DeadSystemException recursion when dropbox is unavailable
During early boot, framework callers can ask for DropBoxManager before the `dropbox` binder has been published. Using getServiceOrThrow() sends that path through onServiceNotFound(), which emits another WTF from a core process and can cascade into recursive error handling while system_server is already failing. Switch DROPBOX_SERVICE to ServiceManager.getService(), return null while the binder is still absent, and treat dropbox as an allowed transiently-unavailable service in getSystemService(). This keeps the early-boot path null-safe without spamming an extra WTF that can amplify DeadSystemException-style failures. Signed-off-by: Quince <quinceroms@gmail.com>
1 parent b5f4dab commit 23d50a3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

core/java/android/app/SystemServiceRegistry.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,10 @@ public BatteryManager createService(ContextImpl ctx) throws ServiceNotFoundExcep
580580
new CachedServiceFetcher<DropBoxManager>() {
581581
@Override
582582
public DropBoxManager createService(ContextImpl ctx) throws ServiceNotFoundException {
583-
IBinder b = ServiceManager.getServiceOrThrow(Context.DROPBOX_SERVICE);
583+
IBinder b = ServiceManager.getService(Context.DROPBOX_SERVICE);
584+
if (b == null) {
585+
return null;
586+
}
584587
IDropBoxManagerService service = IDropBoxManagerService.Stub.asInterface(b);
585588
return new DropBoxManager(ctx, service);
586589
}});
@@ -2109,6 +2112,7 @@ public static Object getSystemService(@NonNull ContextImpl ctx, String name) {
21092112
case Context.CONTEXTHUB_SERVICE:
21102113
case Context.VIRTUALIZATION_SERVICE:
21112114
case Context.VIRTUAL_DEVICE_SERVICE:
2115+
case Context.DROPBOX_SERVICE:
21122116
return null;
21132117
case Context.VCN_MANAGEMENT_SERVICE:
21142118
if (!hasSystemFeatureOpportunistic(ctx,

0 commit comments

Comments
 (0)