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

Commit 31eb3031 authored by Yeabkal Wubshit's avatar Yeabkal Wubshit Committed by Android (Google) Code Review
Browse files

Merge "Avoid system app crashes for absent TEXT_SERVICES_MANAGER_SERVICE in Wear" into main

parents f87d2d91 442b805d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -593,6 +593,11 @@ public final class SystemServiceRegistry {
            @Override
            public TextServicesManager createService(ContextImpl ctx)
                    throws ServiceNotFoundException {
                 if (ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)
                        && ServiceManager.getService(Context.TEXT_SERVICES_MANAGER_SERVICE) == null
                        && android.server.Flags.removeTextService()) {
                    return null;
                }
                return TextServicesManager.createInstance(ctx);
            }});

@@ -1887,6 +1892,12 @@ public final class SystemServiceRegistry {
                        return null;
                    }
                    break;
                case Context.TEXT_SERVICES_MANAGER_SERVICE:
                    if (android.server.Flags.removeTextService()
                            && hasSystemFeatureOpportunistic(ctx, PackageManager.FEATURE_WATCH)) {
                        return null;
                    }
                    break;
            }
            Slog.wtf(TAG, "Manager wrapper not available: " + name);
            return null;