Skip to content

Commit

Permalink
Block app starting from smart cover
Browse files Browse the repository at this point in the history
Change-Id: I41ebc5b489fc3475f5714f991fa2f0bdda4e13a7
  • Loading branch information
fire855 committed Apr 24, 2016
1 parent a45e763 commit 78657da
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,13 @@ final int startActivityLocked(IApplicationThread caller,
}
}

/* Block starting of browser or mail app while opening/closing the smart cover */
if (err == ActivityManager.START_SUCCESS && callingUid == 1000 && intent.getFlags() == 0x10000000 && intent.getSelector() != null) {
if (intent.getSelector().hasCategory(Intent.CATEGORY_APP_EMAIL) || intent.getSelector().hasCategory(Intent.CATEGORY_APP_BROWSER)) {
err = ActivityManager.START_PERMISSION_DENIED;
}
}

final int userId = aInfo != null ? UserHandle.getUserId(aInfo.applicationInfo.uid) : 0;

if (err == ActivityManager.START_SUCCESS) {
Expand Down

0 comments on commit 78657da

Please sign in to comment.