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

Commit f2a9e36c authored by Dave Mankoff's avatar Dave Mankoff Committed by android-build-merger
Browse files

RESTRICT AUTOMERGE Remove the possibility of an NPE that is being seen in master.

am: 9ee4f596

Change-Id: I3e758a6238efd356adfcd5e4a021977b23a3303f
parents 452ab27d 9ee4f596
Loading
Loading
Loading
Loading
+0 −23
Original line number Original line Diff line number Diff line
@@ -17,8 +17,6 @@
package com.android.systemui;
package com.android.systemui;


import android.app.Application;
import android.app.Application;
import android.app.Service;
import android.content.Intent;


import androidx.core.app.CoreComponentFactory;
import androidx.core.app.CoreComponentFactory;


@@ -52,25 +50,4 @@ public class SystemUIAppComponentFactory extends CoreComponentFactory {


        return app;
        return app;
    }
    }

    @Override
    public Service instantiateService(ClassLoader cl, String className, Intent intent)
            throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        Service service = mComponentHelper.resolve(className);
        if (service != null) {
            return checkCompatWrapper(service);
        }
        return super.instantiateService(cl, className, intent);
    }

    static <T> T checkCompatWrapper(T obj) {
        if (obj instanceof CompatWrapped) {
            T wrapper = (T) ((CompatWrapped) obj).getWrapper();
            if (wrapper != null) {
                return wrapper;
            }
        }

        return obj;
    }
}
}