OSDN Git Service

User action should only stop lock task mode if it is in pinned mode
authorTony Mak <tonymak@google.com>
Mon, 18 Apr 2016 10:43:28 +0000 (11:43 +0100)
committerTony Mak <tonymak@google.com>
Mon, 18 Apr 2016 10:43:28 +0000 (11:43 +0100)
commit2c11dc99632354836281cbe3000b911e72a30d14
tree84072bf05e3fb752cd33db8b718e6c482f5460cf
parent988a20a94b71c7a8fdffcfbfe0b0ee0dd58854cb
User action should only stop lock task mode if it is in pinned mode

There are two lock task modes: pinned and locked.
Pinned mode is the one that one that need users action to accept the pinned
request. For locked mode, it is triggered by DPM.
We should not allow user to stop locked mode by user action.
Please notice that it does not happen before because the action to dismiss
lock task mode is pressing both back and recents button and recents button
is hidden in locked mode. But it becomes a problem after the user action
is changed to long pressing back button.

So changes are as follows:
1. Only stop lock task mode if it is pinned mode in
   stopLockTaskModeOnCurrent
2. Remove the permission checking in stopLockTaskModeOnCurrent. I can't
   see the reason we are having this because there is no permission
   checking to in stopLockTaskMode when it is in pinned mode. So you
   can always stop pinned lock task mode anyway by calling
   stopLockTaskMode directly.

Bug: 28184751
Change-Id: I610cc1dfade7737e0b08fc9a13dad29e62e09a32
services/core/java/com/android/server/am/ActivityManagerService.java