diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/Activity.java | 10 | ||||
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 1 | ||||
| -rw-r--r-- | core/java/android/app/FragmentManager.java | 11 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageUserState.java | 8 | ||||
| -rw-r--r-- | core/java/android/hardware/usb/IUsbManager.aidl | 8 | ||||
| -rw-r--r-- | core/java/android/net/CaptivePortalTracker.java | 33 | ||||
| -rw-r--r-- | core/java/android/view/Display.java | 43 | ||||
| -rw-r--r-- | core/java/android/view/DisplayInfo.java | 7 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 4 | ||||
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 16 |
10 files changed, 78 insertions, 63 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 7606d5e..5dc9da2 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -685,6 +685,7 @@ public class Activity extends ContextThemeWrapper private boolean mStopped; boolean mFinished; boolean mStartedActivity; + private boolean mDestroyed; /** true if the activity is going through a transient pause */ /*package*/ boolean mTemporaryPause = false; /** true if the activity is being destroyed in order to recreate it with a new configuration */ @@ -4089,6 +4090,14 @@ public class Activity extends ContextThemeWrapper } /** + * Returns true if the final {@link #onDestroy()} call has been made + * on the Activity, so this instance is now dead. + */ + public boolean isDestroyed() { + return mDestroyed; + } + + /** * Check to see whether this activity is in the process of being destroyed in order to be * recreated with a new configuration. This is often used in * {@link #onStop} to determine whether the state needs to be cleaned up or will be passed @@ -5258,6 +5267,7 @@ public class Activity extends ContextThemeWrapper } final void performDestroy() { + mDestroyed = true; mWindow.destroy(); mFragments.dispatchDestroy(); onDestroy(); diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index c41405b..59fa1e0 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -1703,6 +1703,7 @@ class ContextImpl extends Context { if (packageName.equals("system") || packageName.equals("android")) { final ContextImpl context = new ContextImpl(mMainThread.getSystemContext()); context.mBasePackageName = mBasePackageName; + context.mUser = user; return context; } diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index e983299..10ea109 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -318,6 +318,12 @@ public abstract class FragmentManager { public abstract Fragment.SavedState saveFragmentInstanceState(Fragment f); /** + * Returns true if the final {@link Activity#onDestroy() Activity.onDestroy()} + * call has been made on the FragmentManager's Activity, so this instance is now dead. + */ + public abstract boolean isDestroyed(); + + /** * Print the FragmentManager's state into the given stream. * * @param prefix Text to print at the front of each line. @@ -588,6 +594,11 @@ final class FragmentManagerImpl extends FragmentManager { } @Override + public boolean isDestroyed() { + return mDestroyed; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(128); sb.append("FragmentManager{"); diff --git a/core/java/android/content/pm/PackageUserState.java b/core/java/android/content/pm/PackageUserState.java index 7b3d8cd..3579977 100644 --- a/core/java/android/content/pm/PackageUserState.java +++ b/core/java/android/content/pm/PackageUserState.java @@ -34,14 +34,6 @@ 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/hardware/usb/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl index 98bd4f5..8286686 100644 --- a/core/java/android/hardware/usb/IUsbManager.aidl +++ b/core/java/android/hardware/usb/IUsbManager.aidl @@ -44,12 +44,12 @@ interface IUsbManager /* Sets the default package for a USB device * (or clears it if the package name is null) */ - void setDevicePackage(in UsbDevice device, String packageName); + void setDevicePackage(in UsbDevice device, String packageName, int userId); /* Sets the default package for a USB accessory * (or clears it if the package name is null) */ - void setAccessoryPackage(in UsbAccessory accessory, String packageName); + void setAccessoryPackage(in UsbAccessory accessory, String packageName, int userId); /* Returns true if the caller has permission to access the device. */ boolean hasDevicePermission(in UsbDevice device); @@ -77,10 +77,10 @@ interface IUsbManager void grantAccessoryPermission(in UsbAccessory accessory, int uid); /* Returns true if the USB manager has default preferences or permissions for the package */ - boolean hasDefaults(String packageName); + boolean hasDefaults(String packageName, int userId); /* Clears default preferences and permissions for the package */ - void clearDefaults(String packageName); + void clearDefaults(String packageName, int userId); /* Sets the current USB function. */ void setCurrentFunction(String function, boolean makeDefault); diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java index 9b11094..ce71e6b 100644 --- a/core/java/android/net/CaptivePortalTracker.java +++ b/core/java/android/net/CaptivePortalTracker.java @@ -31,6 +31,7 @@ import android.os.UserHandle; import android.os.Message; import android.os.RemoteException; import android.provider.Settings; +import android.telephony.TelephonyManager; import android.util.Log; import com.android.internal.util.State; @@ -63,6 +64,7 @@ public class CaptivePortalTracker extends StateMachine { private boolean mNotificationShown = false; private boolean mIsCaptivePortalCheckEnabled = false; private IConnectivityManager mConnService; + private TelephonyManager mTelephonyManager; private Context mContext; private NetworkInfo mNetworkInfo; @@ -84,6 +86,7 @@ public class CaptivePortalTracker extends StateMachine { mContext = context; mConnService = cs; + mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); IntentFilter filter = new IntentFilter(); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); @@ -326,17 +329,33 @@ public class CaptivePortalTracker extends StateMachine { if (visible) { CharSequence title; - if (mNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI) { - title = r.getString(R.string.wifi_available_sign_in, 0); - } else { - title = r.getString(R.string.network_available_sign_in, 0); + CharSequence details; + int icon; + switch (mNetworkInfo.getType()) { + case ConnectivityManager.TYPE_WIFI: + title = r.getString(R.string.wifi_available_sign_in, 0); + details = r.getString(R.string.network_available_sign_in_detailed, + mNetworkInfo.getExtraInfo()); + icon = R.drawable.stat_notify_wifi_in_range; + break; + case ConnectivityManager.TYPE_MOBILE: + title = r.getString(R.string.network_available_sign_in, 0); + // TODO: Change this to pull from NetworkInfo once a printable + // name has been added to it + details = mTelephonyManager.getNetworkOperatorName(); + icon = R.drawable.stat_notify_rssi_in_range; + break; + default: + title = r.getString(R.string.network_available_sign_in, 0); + details = r.getString(R.string.network_available_sign_in_detailed, + mNetworkInfo.getExtraInfo()); + icon = R.drawable.stat_notify_rssi_in_range; + break; } - CharSequence details = r.getString(R.string.network_available_sign_in_detailed, - mNetworkInfo.getExtraInfo()); Notification notification = new Notification(); notification.when = 0; - notification.icon = com.android.internal.R.drawable.stat_notify_wifi_in_range; + notification.icon = icon; notification.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUrl)); intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index cf58458..662dc45 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -79,38 +79,23 @@ public final class Display { public static final int DEFAULT_DISPLAY = 0; /** - * Display flag: Indicates that the display supports secure video output. + * Display flag: Indicates that the display supports compositing content + * that is stored in protected graphics buffers. * <p> - * This flag is used to indicate that the display supports content protection - * mechanisms for secure video output at the display interface, such as HDCP. - * These mechanisms may be used to protect secure content as it leaves the device. + * Secure (DRM) video decoders may allocate protected graphics buffers to request that + * a hardware-protected path be provided between the video decoder and the external + * display sink. If a hardware-protected path is not available, then content stored + * in protected graphics buffers may not be composited. * </p><p> - * While mirroring content to multiple displays, it can happen that certain - * display devices support secure video output while other display devices do not. - * The secure content will be shown only on the display devices that support - * secure video output and will be blanked on other display devices that do - * not support secure video output. - * </p><p> - * This flag mainly applies to external display devices such as HDMI or - * Wifi display. Built-in display devices are usually considered secure. - * </p> - * - * @hide pending review - */ - public static final int FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT = 1 << 0; - - /** - * Display flag: Indicates that the display supports secure in-memory video buffers. - * <p> - * This flag is used to indicate that the display supports content protection - * mechanisms for in-memory video buffers, such as secure memory areas. - * These mechanisms may be used to protect secure video buffers in memory from - * the video decoder to the display compositor and the video interface. + * If this flag is not set, then the display device does not support compositing + * protected buffers; the user may see a blank region on the screen instead of + * the protected content. An application can use this flag as a hint that it should + * select an alternate content stream or adopt a different strategy for decoding + * content that does not rely on protected buffers so as to ensure that the user + * can view the content on the display as expected. * </p> - * - * @hide pending review */ - public static final int FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS = 1 << 1; + public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 0; /** * Internal method to create a display. @@ -196,7 +181,7 @@ public final class Display { * * @return The display flags. * - * @hide pending review + * @see #FLAG_SUPPORTS_PROTECTED_BUFFERS */ public int getFlags() { synchronized (this) { diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index c968ec5..fe05634 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -299,11 +299,8 @@ public final class DisplayInfo implements Parcelable { private static String flagsToString(int flags) { StringBuilder result = new StringBuilder(); - if ((flags & Display.FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT) != 0) { - result.append(", FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT"); - } - if ((flags & Display.FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS) != 0) { - result.append(", FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS"); + if ((flags & Display.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) { + result.append(", FLAG_SUPPORTS_PROTECTED_BUFFERS"); } return result.toString(); } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 3ed47ea..2d083b6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5871,6 +5871,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, ((layoutDirection << PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) & PFLAG2_LAYOUT_DIRECTION_MASK); // We need to resolve all RTL properties as they all depend on layout direction resolveRtlPropertiesIfNeeded(); + requestLayout(); + invalidate(true); } } @@ -11568,8 +11570,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (!isDrawablesResolved()) { resolveDrawables(); } - requestLayout(); - invalidate(true); onRtlPropertiesChanged(getLayoutDirection()); } diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 7f0af09..871f752 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -1055,30 +1055,30 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (mChoiceMode == CHOICE_MODE_MULTIPLE || (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode != null)) { - boolean newValue = !mCheckStates.get(position, false); - mCheckStates.put(position, newValue); + boolean checked = !mCheckStates.get(position, false); + mCheckStates.put(position, checked); if (mCheckedIdStates != null && mAdapter.hasStableIds()) { - if (newValue) { + if (checked) { mCheckedIdStates.put(mAdapter.getItemId(position), position); } else { mCheckedIdStates.delete(mAdapter.getItemId(position)); } } - if (newValue) { + if (checked) { mCheckedItemCount++; } else { mCheckedItemCount--; } if (mChoiceActionMode != null) { mMultiChoiceModeCallback.onItemCheckedStateChanged(mChoiceActionMode, - position, id, newValue); + position, id, checked); dispatchItemClick = false; } checkedStateChanged = true; } else if (mChoiceMode == CHOICE_MODE_SINGLE) { - boolean newValue = !mCheckStates.get(position, false); - if (newValue) { - mCheckStates.clear(); + boolean checked = !mCheckStates.get(position, false); + mCheckStates.clear(); + if (checked) { mCheckStates.put(position, true); if (mCheckedIdStates != null && mAdapter.hasStableIds()) { mCheckedIdStates.clear(); |
