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

Commit c83189b5 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #25673462: Shamu update from MMB29J -> 29K does not complete

The direct path to the package manager returns null on failure, oops!

Change-Id: Id33ea299b605a59b0703dab200bafb754dd66e78
parent 8958c1ef
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -52,9 +52,21 @@ public class VoiceInteractionServiceInfo {
    }

    public VoiceInteractionServiceInfo(PackageManager pm, ComponentName comp, int userHandle)
            throws PackageManager.NameNotFoundException, RemoteException {
        this(pm, AppGlobals.getPackageManager().getServiceInfo(comp,
                PackageManager.GET_META_DATA, userHandle));
            throws PackageManager.NameNotFoundException {
        this(pm, getServiceInfoOrThrow(comp, userHandle));
    }

    static ServiceInfo getServiceInfoOrThrow(ComponentName comp, int userHandle)
            throws PackageManager.NameNotFoundException {
        try {
            ServiceInfo si = AppGlobals.getPackageManager().getServiceInfo(comp,
                    PackageManager.GET_META_DATA, userHandle);
            if (si != null) {
                return si;
            }
        } catch (RemoteException e) {
        }
        throw new PackageManager.NameNotFoundException(comp.toString());
    }

    public VoiceInteractionServiceInfo(PackageManager pm, ServiceInfo si) {
+0 −1
Original line number Diff line number Diff line
@@ -362,7 +362,6 @@ public class VoiceInteractionManagerService extends SystemService {
                            }
                        } catch (PackageManager.NameNotFoundException e) {
                            Slog.w(TAG, "Failure looking up interaction service " + comp);
                        } catch (RemoteException e) {
                        }
                    }
                }
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne
        VoiceInteractionServiceInfo info;
        try {
            info = new VoiceInteractionServiceInfo(context.getPackageManager(), service, mUser);
        } catch (RemoteException|PackageManager.NameNotFoundException e) {
        } catch (PackageManager.NameNotFoundException e) {
            Slog.w(TAG, "Voice interaction service not found: " + service, e);
            mInfo = null;
            mSessionComponentName = null;