diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-09-28 15:53:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-28 15:54:44 -0700 |
commit | 3ff8e1a80058e5557d13693d3223e1aa011c0038 (patch) | |
tree | 62d3c43fa2261c2aec17b76f08b7c8cc784c81fc /core/java | |
parent | 1d3527354396d3aa48b494fb409d680cce32dc8b (diff) | |
parent | d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1 (diff) | |
download | frameworks_base-3ff8e1a80058e5557d13693d3223e1aa011c0038.zip frameworks_base-3ff8e1a80058e5557d13693d3223e1aa011c0038.tar.gz frameworks_base-3ff8e1a80058e5557d13693d3223e1aa011c0038.tar.bz2 |
Merge "Fix issue #7211769 and #7244492, thrash around on #7226656." into jb-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 16 | ||||
-rw-r--r-- | core/java/android/app/IActivityManager.java | 3 | ||||
-rw-r--r-- | core/java/android/content/pm/ActivityInfo.java | 8 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 7 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageUserState.java | 8 | ||||
-rw-r--r-- | core/java/android/content/pm/UserInfo.java | 6 |
6 files changed, 46 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 9874b0b..83acb4d 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1783,6 +1783,12 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } + case REQUEST_BUG_REPORT_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + requestBugReport(); + return true; + } + } return super.onTransact(code, data, reply, flags); @@ -4066,5 +4072,15 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } + public void requestBugReport() throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); + reply.readException(); + data.recycle(); + reply.recycle(); + } + private IBinder mRemote; } diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index 9454636..3124671 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -361,6 +361,8 @@ public interface IActivityManager extends IInterface { public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException; public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException; + public void requestBugReport() throws RemoteException; + /* * Private non-Binder interfaces */ @@ -613,4 +615,5 @@ public interface IActivityManager extends IInterface { int REGISTER_USER_SWITCH_OBSERVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+154; int UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+155; int GET_RUNNING_USER_IDS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+156; + int REQUEST_BUG_REPORT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+157; } diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 0b320f0..b884b98 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -172,10 +172,16 @@ public class ActivityInfo extends ComponentInfo */ public static final int FLAG_IMMERSIVE = 0x0400; /** + * @hide Bit in {@link #flags}: If set, this component will only be seen + * by the primary user. Only works with broadcast receivers. Set from the + * {@link android.R.attr#primaryUserOnly} attribute. + */ + public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000; + /** * Bit in {@link #flags}: If set, a single instance of the receiver will * run for all users on the device. Set from the * {@link android.R.attr#singleUser} attribute. Note that this flag is - * only relevent for ActivityInfo structures that are describiner receiver + * only relevant for ActivityInfo structures that are describing receiver * components; it is not applied to activities. */ public static final int FLAG_SINGLE_USER = 0x40000000; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 0a22fca..c2b75f4 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -2193,7 +2193,7 @@ public class PackageParser { if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestActivity_singleUser, false)) { - a.info.flags |= ServiceInfo.FLAG_SINGLE_USER; + a.info.flags |= ActivityInfo.FLAG_SINGLE_USER; if (a.info.exported) { Slog.w(TAG, "Activity exported request ignored due to singleUser: " + a.className + " at " + mArchiveSourcePath + " " @@ -2202,6 +2202,11 @@ public class PackageParser { } setExported = true; } + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestActivity_primaryUserOnly, + false)) { + a.info.flags |= ActivityInfo.FLAG_PRIMARY_USER_ONLY; + } } sa.recycle(); diff --git a/core/java/android/content/pm/PackageUserState.java b/core/java/android/content/pm/PackageUserState.java index 3579977..7b3d8cd 100644 --- a/core/java/android/content/pm/PackageUserState.java +++ b/core/java/android/content/pm/PackageUserState.java @@ -34,6 +34,14 @@ public class PackageUserState { public HashSet<String> enabledComponents; public PackageUserState() { + this(true); + } + + /** @hide */ + public PackageUserState(boolean isSystem) { + if (!isSystem) { + stopped = notLaunched = true; + } installed = true; enabled = COMPONENT_ENABLED_STATE_DEFAULT; } diff --git a/core/java/android/content/pm/UserInfo.java b/core/java/android/content/pm/UserInfo.java index ab32523..593f826 100644 --- a/core/java/android/content/pm/UserInfo.java +++ b/core/java/android/content/pm/UserInfo.java @@ -71,6 +71,9 @@ public class UserInfo implements Parcelable { public long creationTime; public long lastLoggedInTime; + /** User is only partially created. */ + public boolean partial; + public UserInfo(int id, String name, int flags) { this(id, name, null, flags); } @@ -105,6 +108,7 @@ public class UserInfo implements Parcelable { serialNumber = orig.serialNumber; creationTime = orig.creationTime; lastLoggedInTime = orig.lastLoggedInTime; + partial = orig.partial; } public UserHandle getUserHandle() { @@ -128,6 +132,7 @@ public class UserInfo implements Parcelable { dest.writeInt(serialNumber); dest.writeLong(creationTime); dest.writeLong(lastLoggedInTime); + dest.writeInt(partial ? 1 : 0); } public static final Parcelable.Creator<UserInfo> CREATOR @@ -148,5 +153,6 @@ public class UserInfo implements Parcelable { serialNumber = source.readInt(); creationTime = source.readLong(); lastLoggedInTime = source.readLong(); + partial = source.readInt() != 0; } } |