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

Commit 58fb1caa authored by Tsung-Mao Fang's avatar Tsung-Mao Fang
Browse files

Tweak the way to get the enabled component

Prior to this cl, we only can get the default value set in the AndroidManifest.xml.
It won't return the real enabled state after we modified the component state.

Test: Install apk and see if the search highlight works.
Bug: 204405245
Change-Id: I9bf0b178c591f2fbbbfc733bb2140a5725a07166
parent d43efc90
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.settingslib.activityembedding;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;

import com.android.settingslib.utils.BuildCompatUtils;

@@ -37,11 +36,10 @@ public class ActivityEmbeddingUtils {
        if (BuildCompatUtils.isAtLeastS()) {
            final Intent intent = new Intent(ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY);
            intent.setPackage(PACKAGE_NAME_SETTINGS);
            final ResolveInfo resolveInfo =
                    context.getPackageManager().resolveActivity(intent, 0 /* flags */);
            return resolveInfo != null
                    && resolveInfo.activityInfo != null
                    && resolveInfo.activityInfo.enabled;
            final boolean isEmbeddingActivityEnabled =
                    intent.resolveActivity(context.getPackageManager()) != null;

            return isEmbeddingActivityEnabled;
        }
        return false;
    }