summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-06-10 10:18:22 -0400
committerJason Monk <jmonk@google.com>2015-06-10 10:18:22 -0400
commit6ff98ce2c89f94d47566de3426567748fad97814 (patch)
treef89984de76550d834b61af26aa2da43edf606dae /packages/SettingsLib/src
parent8e095594a640a82b850ff3990bb690920eba921c (diff)
downloadframeworks_base-6ff98ce2c89f94d47566de3426567748fad97814.zip
frameworks_base-6ff98ce2c89f94d47566de3426567748fad97814.tar.gz
frameworks_base-6ff98ce2c89f94d47566de3426567748fad97814.tar.bz2
Fix work apps showing as not installed for owner
Bug: 21717956 Change-Id: Ia00537f3b50f958a2e35094abf1bfc73dc1f79af
Diffstat (limited to 'packages/SettingsLib/src')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
index b5e53c0..6561512 100644
--- a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
+++ b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
@@ -784,6 +784,21 @@ public class ApplicationsState {
numDone++;
getEntryLocked(info);
}
+ if (userId != 0 && mEntriesMap.indexOfKey(0) >= 0) {
+ // If this app is for a profile and we are on the owner, remove
+ // the owner entry if it isn't installed. This will prevent
+ // duplicates of work only apps showing up as 'not installed
+ // for this user'.
+ // Note: This depends on us traversing the users in order, which
+ // happens because of the way we generate the list in
+ // doResumeIfNeededLocked.
+ AppEntry entry = mEntriesMap.get(0).get(info.packageName);
+ if (entry != null &&
+ (entry.info.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
+ mEntriesMap.get(0).remove(info.packageName);
+ mAppEntries.remove(entry);
+ }
+ }
}
if (DEBUG_LOCKING) Log.v(TAG, "MSG_LOAD_ENTRIES releasing lock");
}