diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 21 | ||||
| -rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 1 | ||||
| -rw-r--r-- | core/java/android/content/pm/ActivityInfo.java | 9 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 6 | ||||
| -rw-r--r-- | core/java/android/os/IUserManager.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/os/UserManager.java | 12 | ||||
| -rw-r--r-- | core/java/android/text/StaticLayout.java | 2 | ||||
| -rw-r--r-- | core/java/android/transition/TransitionSet.java | 34 |
8 files changed, 82 insertions, 5 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index db08a41..d7170e8 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -1816,6 +1816,27 @@ public class DevicePolicyManager { /** * @hide + * @param userId the userId of a managed profile profile. + * + * @return whether or not the managed profile is enabled. + * @throws IllegalArgumentException if the userId is invalid. + */ + public boolean isProfileEnabled(int userId) throws IllegalArgumentException { + if (mService != null) { + try { + return mService.isProfileEnabled(userId); + } catch (RemoteException re) { + Log.w(TAG, "Failed to get status for owner profile."); + throw new IllegalArgumentException( + "Failed to get status for owner profile.", re); + } + } + return true; + } + + + /** + * @hide * @return the human readable name of the organisation associated with this DPM or null if * one is not set. * @throws IllegalArgumentException if the userId is invalid. diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index 4ed85e9..85ba58b 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -109,6 +109,7 @@ interface IDevicePolicyManager { String getProfileOwner(int userHandle); String getProfileOwnerName(int userHandle); void setProfileEnabled(in ComponentName who); + boolean isProfileEnabled(int userHandle); boolean installCaCert(in byte[] certBuffer); void uninstallCaCert(in byte[] certBuffer); diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 9916476..c53e545 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -198,7 +198,7 @@ public class ActivityInfo extends ComponentInfo /** * @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. + * android.R.attr#primaryUserOnly attribute. */ public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000; /** @@ -210,6 +210,13 @@ public class ActivityInfo extends ComponentInfo */ public static final int FLAG_SINGLE_USER = 0x40000000; /** + * @hide Bit in {@link #flags}: If set, this activity may be launched into an + * owned ActivityContainer such as that within an ActivityView. If not set and + * this activity is launched into such a container a SecurityExcception will be + * thrown. Set from the {@link android.R.attr#allowEmbedded} attribute. + */ + public static final int FLAG_ALLOW_EMBEDDED = 0x80000000; + /** * Options that have been set in the activity declaration in the * manifest. * These include: diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 8d8d220..8b6ca83 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -2452,6 +2452,12 @@ public class PackageParser { a.info.flags |= ActivityInfo.FLAG_PERSISTABLE; } + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestActivity_allowEmbedded, + false)) { + a.info.flags |= ActivityInfo.FLAG_ALLOW_EMBEDDED; + } + if (!receiver) { if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestActivity_hardwareAccelerated, diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl index 1192a45..c3f7370 100644 --- a/core/java/android/os/IUserManager.aidl +++ b/core/java/android/os/IUserManager.aidl @@ -34,7 +34,7 @@ interface IUserManager { void setUserIcon(int userHandle, in Bitmap icon); Bitmap getUserIcon(int userHandle); List<UserInfo> getUsers(boolean excludeDying); - List<UserInfo> getProfiles(int userHandle); + List<UserInfo> getProfiles(int userHandle, boolean enabledOnly); UserInfo getUserInfo(int userHandle); boolean isRestricted(); void setGuestEnabled(boolean enable); diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 7bac3af..63de9a0 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -466,6 +466,8 @@ public class UserManager { /** * Returns list of the profiles of userHandle including * userHandle itself. + * Note that it this returns both enabled and not enabled profiles. See + * {@link #getUserProfiles()} if you need only the enabled ones. * * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. * @param userHandle profiles of this user will be returned. @@ -474,7 +476,7 @@ public class UserManager { */ public List<UserInfo> getProfiles(int userHandle) { try { - return mService.getProfiles(userHandle); + return mService.getProfiles(userHandle, false /* enabledOnly */); } catch (RemoteException re) { Log.w(TAG, "Could not get user list", re); return null; @@ -488,7 +490,13 @@ public class UserManager { */ public List<UserHandle> getUserProfiles() { ArrayList<UserHandle> profiles = new ArrayList<UserHandle>(); - List<UserInfo> users = getProfiles(UserHandle.myUserId()); + List<UserInfo> users = new ArrayList<UserInfo>(); + try { + users = mService.getProfiles(UserHandle.myUserId(), true /* enabledOnly */); + } catch (RemoteException re) { + Log.w(TAG, "Could not get user list", re); + return null; + } for (UserInfo info : users) { UserHandle userHandle = new UserHandle(info.id); profiles.add(userHandle); diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 638ef22..f7ac75a 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -653,7 +653,7 @@ public class StaticLayout extends Layout { int extra; - if (needMultiply) { + if (needMultiply && end != bufEnd) { double ex = (below - above) * (spacingmult - 1) + spacingadd; if (ex >= 0) { extra = (int)(ex + EXTRA_ROUNDING); diff --git a/core/java/android/transition/TransitionSet.java b/core/java/android/transition/TransitionSet.java index 966b24d..9081234 100644 --- a/core/java/android/transition/TransitionSet.java +++ b/core/java/android/transition/TransitionSet.java @@ -256,11 +256,45 @@ public class TransitionSet extends Transition { @Override protected void createAnimators(ViewGroup sceneRoot, TransitionValuesMaps startValues, TransitionValuesMaps endValues) { + startValues = removeExcludes(startValues); + endValues = removeExcludes(endValues); for (Transition childTransition : mTransitions) { childTransition.createAnimators(sceneRoot, startValues, endValues); } } + private TransitionValuesMaps removeExcludes(TransitionValuesMaps values) { + if (mTargetIds.isEmpty() && mTargetIdExcludes == null && mTargetTypeExcludes == null + && mTargets.isEmpty()) { + return values; + } + TransitionValuesMaps included = new TransitionValuesMaps(); + int numValues = values.viewValues.size(); + for (int i = 0; i < numValues; i++) { + View view = values.viewValues.keyAt(i); + if (isValidTarget(view, view.getId())) { + included.viewValues.put(view, values.viewValues.valueAt(i)); + } + } + numValues = values.idValues.size(); + for (int i = 0; i < numValues; i++) { + int id = values.idValues.keyAt(i); + TransitionValues transitionValues = values.idValues.valueAt(i); + if (isValidTarget(transitionValues.view, id)) { + included.idValues.put(id, transitionValues); + } + } + numValues = values.itemIdValues.size(); + for (int i = 0; i < numValues; i++) { + long id = values.itemIdValues.keyAt(i); + TransitionValues transitionValues = values.itemIdValues.valueAt(i); + if (isValidTarget(transitionValues.view, id)) { + included.itemIdValues.put(id, transitionValues); + } + } + return included; + } + /** * @hide */ |
