Multi-user - 1st major checkin

Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
This commit is contained in:
Amith Yamasani 2011-05-04 14:49:28 -07:00
parent e08b48632b
commit 4e975bb488
2 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,7 @@ public:
int getCallingPid(); int getCallingPid();
int getCallingUid(); int getCallingUid();
int getOrigCallingUid();
void setStrictModePolicy(int32_t policy); void setStrictModePolicy(int32_t policy);
int32_t getStrictModePolicy() const; int32_t getStrictModePolicy() const;
@ -116,6 +117,7 @@ private:
status_t mLastError; status_t mLastError;
pid_t mCallingPid; pid_t mCallingPid;
uid_t mCallingUid; uid_t mCallingUid;
uid_t mOrigCallingUid;
int32_t mStrictModePolicy; int32_t mStrictModePolicy;
int32_t mLastTransactionBinderFlags; int32_t mLastTransactionBinderFlags;
}; };

View File

@ -371,6 +371,11 @@ int IPCThreadState::getCallingUid()
return mCallingUid; return mCallingUid;
} }
int IPCThreadState::getOrigCallingUid()
{
return mOrigCallingUid;
}
int64_t IPCThreadState::clearCallingIdentity() int64_t IPCThreadState::clearCallingIdentity()
{ {
int64_t token = ((int64_t)mCallingUid<<32) | mCallingPid; int64_t token = ((int64_t)mCallingUid<<32) | mCallingPid;
@ -641,6 +646,7 @@ IPCThreadState::IPCThreadState()
{ {
pthread_setspecific(gTLS, this); pthread_setspecific(gTLS, this);
clearCaller(); clearCaller();
mOrigCallingUid = mCallingUid;
mIn.setDataCapacity(256); mIn.setDataCapacity(256);
mOut.setDataCapacity(256); mOut.setDataCapacity(256);
} }
@ -987,6 +993,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
mCallingPid = tr.sender_pid; mCallingPid = tr.sender_pid;
mCallingUid = tr.sender_euid; mCallingUid = tr.sender_euid;
mOrigCallingUid = tr.sender_euid;
int curPrio = getpriority(PRIO_PROCESS, mMyThreadId); int curPrio = getpriority(PRIO_PROCESS, mMyThreadId);
if (gDisableBackgroundScheduling) { if (gDisableBackgroundScheduling) {
@ -1045,6 +1052,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
mCallingPid = origPid; mCallingPid = origPid;
mCallingUid = origUid; mCallingUid = origUid;
mOrigCallingUid = origUid;
IF_LOG_TRANSACTIONS() { IF_LOG_TRANSACTIONS() {
TextOutput::Bundle _b(alog); TextOutput::Bundle _b(alog);