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

Commit 0a050b7d authored by Josh Hou's avatar Josh Hou Committed by Android (Google) Code Review
Browse files

Merge "NPE protection" into main

parents 5b86af12 3afd5f20
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -486,9 +486,12 @@ public class LocaleManagerService extends SystemService {
                Settings.Secure.DEFAULT_INPUT_METHOD,
                userId);
        if (!TextUtils.isEmpty(currentInputMethod)) {
            String inputMethodPkgName = ComponentName
                    .unflattenFromString(currentInputMethod)
                    .getPackageName();
            ComponentName componentName = ComponentName.unflattenFromString(currentInputMethod);
            if (componentName == null) {
                Slog.d(TAG, "inValid input method");
                return false;
            }
            String inputMethodPkgName = componentName.getPackageName();
            int inputMethodUid = getPackageUid(inputMethodPkgName, userId);
            return inputMethodUid >= 0 && UserHandle.isSameApp(Binder.getCallingUid(),
                    inputMethodUid);