Skip to content

Commit c7ba771

Browse files
author
Dianne Hackborn
committed
Fix issue #7232952: Settings crash on tapping on Downloaded apps on a secondary user
Also tweak bind flags for new location services so they aren't put so aggressively up in the oom adj list. Change-Id: I9da25a3fea7681013b4d95b7db7e9a808f2d733b
1 parent 13987fb commit c7ba771

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

services/java/com/android/server/ServiceWatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private void bindToPackage(String packageName, int version) {
170170
}
171171
if (D) Log.d(mTag, "binding " + packageName + " (version " + version + ")");
172172
mContext.bindService(intent, this, Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND
173-
| Context.BIND_ALLOW_OOM_MANAGEMENT);
173+
| Context.BIND_ALLOW_OOM_MANAGEMENT | Context.BIND_NOT_VISIBLE);
174174
}
175175

176176
private boolean isSignatureMatch(Signature[] signatures) {

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11514,8 +11514,9 @@ private final int broadcastIntentLocked(ProcessRecord callerApp,
1151411514
* Prevent non-system code (defined here to be non-persistent
1151511515
* processes) from sending protected broadcasts.
1151611516
*/
11517-
if (callingUid == Process.SYSTEM_UID || callingUid == Process.PHONE_UID
11518-
|| callingUid == Process.SHELL_UID || callingUid == Process.BLUETOOTH_UID ||
11517+
int callingAppId = UserHandle.getAppId(callingUid);
11518+
if (callingAppId == Process.SYSTEM_UID || callingAppId == Process.PHONE_UID
11519+
|| callingAppId == Process.SHELL_UID || callingAppId == Process.BLUETOOTH_UID ||
1151911520
callingUid == 0) {
1152011521
// Always okay.
1152111522
} else if (callerApp == null || !callerApp.persistent) {

0 commit comments

Comments
 (0)