Merge "Only allow BROWSABLE && DEFAULT Intents to be always opened" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3c4f0c4946
@@ -35,6 +35,8 @@ import static android.content.Intent.EXTRA_PACKAGE_NAME;
|
|||||||
import static android.content.Intent.EXTRA_VERSION_CODE;
|
import static android.content.Intent.EXTRA_VERSION_CODE;
|
||||||
import static android.content.pm.PackageManager.CERT_INPUT_RAW_X509;
|
import static android.content.pm.PackageManager.CERT_INPUT_RAW_X509;
|
||||||
import static android.content.pm.PackageManager.CERT_INPUT_SHA256;
|
import static android.content.pm.PackageManager.CERT_INPUT_SHA256;
|
||||||
|
import static android.content.Intent.CATEGORY_BROWSABLE;
|
||||||
|
import static android.content.Intent.CATEGORY_DEFAULT;
|
||||||
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
|
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
|
||||||
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||||
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
|
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
|
||||||
@@ -7695,6 +7697,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
Slog.i(TAG, " + always: " + info.activityInfo.packageName
|
Slog.i(TAG, " + always: " + info.activityInfo.packageName
|
||||||
+ " : linkgen=" + linkGeneration);
|
+ " : linkgen=" + linkGeneration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!intent.hasCategory(CATEGORY_BROWSABLE)
|
||||||
|
|| !intent.hasCategory(CATEGORY_DEFAULT)) {
|
||||||
|
undefinedList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Use link-enabled generation as preferredOrder, i.e.
|
// Use link-enabled generation as preferredOrder, i.e.
|
||||||
// prefer newly-enabled over earlier-enabled.
|
// prefer newly-enabled over earlier-enabled.
|
||||||
info.preferredOrder = linkGeneration;
|
info.preferredOrder = linkGeneration;
|
||||||
|
|||||||
Reference in New Issue
Block a user