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

Commit 8a6765d9 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Make ExtServices handle instant apps.

Test: run foreground service from instant app, verify no crash/log error
Change-Id: I646521495935687de3d8f5ed18bca0c4efb8cc87
Fixes: 120430037
parent 5b66f8cf
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -27,7 +27,9 @@ import android.app.Notification;
import android.app.NotificationChannel;
import android.app.Person;
import android.app.RemoteInput;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.media.AudioAttributes;
import android.media.AudioSystem;
import android.os.Build;
@@ -67,8 +69,12 @@ public class NotificationEntry {

    private boolean isPreChannelsNotification() {
        try {
            mTargetSdkVersion = mPackageManager.getApplicationInfo(
                    mSbn.getPackageName(), 0, mSbn.getUserId()).targetSdkVersion;
            ApplicationInfo info = mPackageManager.getApplicationInfo(
                    mSbn.getPackageName(), PackageManager.MATCH_ALL,
                    mSbn.getUserId());
            if (info != null) {
                mTargetSdkVersion = info.targetSdkVersion;
            }
        } catch (RemoteException e) {
            Log.w(TAG, "Couldn't look up " + mSbn.getPackageName());
        }