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

Commit d8fdcc96 authored by Abhishek Gadewar's avatar Abhishek Gadewar
Browse files

Checking whether ComponentName with current InputMethod is not null



Summary : Sometime Settings.Secure.DEFAULT_INPUT_METHOD may actually not be set or set wrongly and that may actually cause unflattenFromString to return null.

Test: Build passes

Change-Id: I86c6cb9a32ebbeb7cb09730c9888e756f49b2b37
Signed-off-by: default avatarAbhishek Gadewar <abhishekgadewar@meta.com>
parent 2749a5ec
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -524,8 +524,12 @@ public final class SensorPrivacyService extends SystemService {
                    user.getIdentifier());
            String inputMethodPackageName = null;
            if (inputMethodComponent != null) {
                inputMethodPackageName = ComponentName.unflattenFromString(
                        inputMethodComponent).getPackageName();
                ComponentName component = ComponentName.unflattenFromString(inputMethodComponent);
                if (component != null) {
                    inputMethodPackageName = component.getPackageName();
                } else {
                    Log.w(TAG, "Failed to parse inputMethodComponent: " + inputMethodComponent);
                }
            }

            int capability;