diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-09-27 23:20:10 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-09-28 15:37:22 -0700 |
commit | d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1 (patch) | |
tree | 874663abeb7379376c3deeb68081606e6f62d8d3 /core/java | |
parent | 97298cdcc0e699912288191c28bebe895759e75e (diff) | |
download | frameworks_base-d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1.zip frameworks_base-d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1.tar.gz frameworks_base-d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1.tar.bz2 |
Fix issue #7211769 and #7244492, thrash around on #7226656.
Issue #7211769: Crash dialog from background user has non-working "report"
The report button now launches the issue reporter for the correct user.
Also for crashes on background users, either disable the report button,
or simply don't show the dialog depending on the build config.
Issue #7244492: Bugreport button in Quick Settings doesn't actually do anything
Now they do.
Issue #7226656: second user seeing primary user's apps
I haven't had any success at reproducing this. I have tried to tighten up
the path where we create the user to ensure nothing could cause the
user's applications to be accessed before the user it fully created and thus
make them installed... but I can't convince myself that is the actual problem.
Also tightened up the user switch code to use forground broadcasts for all
of the updates about the switch (since this is really a foreground operation),
added a facility to have BOOT_COMPELTED broadcasts not get launched for
secondary users and use that on a few key system receivers, fixed some debug
output.
Change-Id: Iadf8f8e4878a86def2e495e9d0dc40c4fb347021
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; } } |