Merge "Includes both direct boot aware and unaware apps in Apps default view" into nyc-dev
am: 25c43b7
* commit '25c43b78d11f74e98ba9d5f541647aa5ed44ebce':
Includes both direct boot aware and unaware apps in Apps default view
Change-Id: I23eeef915a4607aa387e826056056cb7632a4542
This commit is contained in:
@@ -87,6 +87,11 @@ public class PackageUserState {
|
|||||||
/**
|
/**
|
||||||
* Test if the given component is considered installed, enabled and a match
|
* Test if the given component is considered installed, enabled and a match
|
||||||
* for the given flags.
|
* for the given flags.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Expects at least one of {@link PackageManager#MATCH_DIRECT_BOOT_AWARE} and
|
||||||
|
* {@link PackageManager#MATCH_DIRECT_BOOT_UNAWARE} are specified in {@code flags}.
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
public boolean isMatch(ComponentInfo componentInfo, int flags) {
|
public boolean isMatch(ComponentInfo componentInfo, int flags) {
|
||||||
if (!isInstalled(flags)) return false;
|
if (!isInstalled(flags)) return false;
|
||||||
|
|||||||
@@ -839,8 +839,18 @@ public class ApplicationsState {
|
|||||||
|
|
||||||
for (int i = 0; i < mEntriesMap.size(); i++) {
|
for (int i = 0; i < mEntriesMap.size(); i++) {
|
||||||
int userId = mEntriesMap.keyAt(i);
|
int userId = mEntriesMap.keyAt(i);
|
||||||
List<ResolveInfo> intents = mPm.queryIntentActivitiesAsUser(launchIntent,
|
// If we do not specify MATCH_DIRECT_BOOT_AWARE or
|
||||||
PackageManager.GET_DISABLED_COMPONENTS, userId);
|
// MATCH_DIRECT_BOOT_UNAWARE, system will derive and update the flags
|
||||||
|
// according to the user's lock state. When the user is locked, components
|
||||||
|
// with ComponentInfo#directBootAware == false will be filtered. We should
|
||||||
|
// explicitly include both direct boot aware and unaware components here.
|
||||||
|
List<ResolveInfo> intents = mPm.queryIntentActivitiesAsUser(
|
||||||
|
launchIntent,
|
||||||
|
PackageManager.GET_DISABLED_COMPONENTS
|
||||||
|
| PackageManager.MATCH_DIRECT_BOOT_AWARE
|
||||||
|
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
|
||||||
|
userId
|
||||||
|
);
|
||||||
synchronized (mEntriesMap) {
|
synchronized (mEntriesMap) {
|
||||||
if (DEBUG_LOCKING) Log.v(TAG, "MSG_LOAD_LAUNCHER acquired lock");
|
if (DEBUG_LOCKING) Log.v(TAG, "MSG_LOAD_LAUNCHER acquired lock");
|
||||||
HashMap<String, AppEntry> userEntries = mEntriesMap.valueAt(i);
|
HashMap<String, AppEntry> userEntries = mEntriesMap.valueAt(i);
|
||||||
@@ -1116,6 +1126,10 @@ public class ApplicationsState {
|
|||||||
|
|
||||||
public boolean mounted;
|
public boolean mounted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setting this to {@code true} prevents the entry to be filtered by
|
||||||
|
* {@link #FILTER_DOWNLOADED_AND_LAUNCHER}.
|
||||||
|
*/
|
||||||
public boolean hasLauncherEntry;
|
public boolean hasLauncherEntry;
|
||||||
|
|
||||||
public String getNormalizedLabel() {
|
public String getNormalizedLabel() {
|
||||||
@@ -1286,6 +1300,9 @@ public class ApplicationsState {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays a combined list with "downloaded" and "visible in launcher" apps only.
|
||||||
|
*/
|
||||||
public static final AppFilter FILTER_DOWNLOADED_AND_LAUNCHER = new AppFilter() {
|
public static final AppFilter FILTER_DOWNLOADED_AND_LAUNCHER = new AppFilter() {
|
||||||
public void init() {
|
public void init() {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user