summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/Activity.java10
-rw-r--r--core/java/android/app/ContextImpl.java1
-rw-r--r--core/java/android/app/FragmentManager.java11
-rw-r--r--core/java/android/content/Intent.java6
-rw-r--r--core/java/android/content/pm/PackageUserState.java8
-rw-r--r--core/java/android/hardware/usb/IUsbManager.aidl8
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java4
-rw-r--r--core/java/android/net/CaptivePortalTracker.java33
-rw-r--r--core/java/android/provider/Settings.java209
-rw-r--r--core/java/android/view/Display.java43
-rw-r--r--core/java/android/view/DisplayInfo.java7
-rw-r--r--core/java/android/view/View.java9
-rw-r--r--core/java/android/widget/AbsListView.java16
13 files changed, 231 insertions, 134 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/Intent.java b/core/java/android/content/Intent.java
index d4f6c06..c14a703 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2414,6 +2414,12 @@ public class Intent implements Parcelable, Cloneable {
public static final String ACTION_USER_INFO_CHANGED =
"android.intent.action.USER_INFO_CHANGED";
+ /**
+ * Sent when the user taps on the clock widget in the system's "quick settings" area.
+ */
+ public static final String ACTION_QUICK_CLOCK =
+ "android.intent.action.QUICK_CLOCK";
+
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Standard intent categories (see addCategory()).
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/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index cf3b802..f07002e 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -683,8 +683,8 @@ public class InputMethodService extends AbstractInputMethodService {
com.android.internal.R.layout.input_method, null);
mWindow.setContentView(mRootView);
mRootView.getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsComputer);
- if (Settings.System.getInt(getContentResolver(),
- Settings.System.FANCY_IME_ANIMATIONS, 0) != 0) {
+ if (Settings.Global.getInt(getContentResolver(),
+ Settings.Global.FANCY_IME_ANIMATIONS, 0) != 0) {
mWindow.getWindow().setWindowAnimations(
com.android.internal.R.style.Animation_InputMethodFancy);
}
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/provider/Settings.java b/core/java/android/provider/Settings.java
index 8f1210b..2a8cf21 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -19,6 +19,7 @@ package android.provider;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.SearchManager;
+import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -940,6 +941,17 @@ public final class Settings {
MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
+ MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
+ MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
+ MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
+ MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
+ MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
+ MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
+ MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
+ MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
}
/**
@@ -1608,14 +1620,20 @@ public final class Settings {
/**
* Name of an application package to be debugged.
+ *
+ * @deprecated Use {@link Global#DEBUG_APP} instead
*/
- public static final String DEBUG_APP = "debug_app";
+ @Deprecated
+ public static final String DEBUG_APP = Global.DEBUG_APP;
/**
* If 1, when launching DEBUG_APP it will wait for the debugger before
* starting user code. If 0, it will run normally.
+ *
+ * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
*/
- public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
+ @Deprecated
+ public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
/**
* Whether or not to dim the screen. 0=no 1=yes
@@ -1630,14 +1648,6 @@ public final class Settings {
public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
/**
- * If 0, the compatibility mode is off for all applications.
- * If 1, older applications run under compatibility mode.
- * TODO: remove this settings before code freeze (bug/1907571)
- * @hide
- */
- public static final String COMPATIBILITY_MODE = "compatibility_mode";
-
- /**
* The screen backlight brightness between 0 and 255.
*/
public static final String SCREEN_BRIGHTNESS = "screen_brightness";
@@ -1666,16 +1676,21 @@ public final class Settings {
/**
* Control whether the process CPU usage meter should be shown.
+ *
+ * @deprecated Use {@link Global#SHOW_PROCESSES} instead
*/
- public static final String SHOW_PROCESSES = "show_processes";
+ @Deprecated
+ public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
/**
* If 1, the activity manager will aggressively finish activities and
* processes as soon as they are no longer needed. If 0, the normal
* extended lifetime is used.
+ *
+ * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
*/
- public static final String ALWAYS_FINISH_ACTIVITIES =
- "always_finish_activities";
+ @Deprecated
+ public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
/**
* Determines which streams are affected by ringer mode changes. The
@@ -1899,7 +1914,10 @@ public final class Settings {
/**
* Name of activity to use for wallpaper on the home screen.
+ *
+ * @deprecated Use {@link WallpaperManager} instead.
*/
+ @Deprecated
public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
/**
@@ -1943,28 +1961,30 @@ public final class Settings {
/**
* Scaling factor for normal window animations. Setting to 0 will disable window
* animations.
+ *
+ * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
*/
- public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
+ @Deprecated
+ public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
/**
* Scaling factor for activity transition animations. Setting to 0 will disable window
* animations.
+ *
+ * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
*/
- public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
+ @Deprecated
+ public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
/**
* Scaling factor for Animator-based animations. This affects both the start delay and
* duration of all such animations. Setting to 0 will cause animations to end immediately.
* The default value is 1.
+ *
+ * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
*/
- public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
-
- /**
- * Scaling factor for normal window animations. Setting to 0 will disable window
- * animations.
- * @hide
- */
- public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
+ @Deprecated
+ public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
/**
* Control whether the accelerometer will be used to change screen
@@ -2028,23 +2048,6 @@ public final class Settings {
public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
/**
- * CDMA only settings
- * Emergency Tone 0 = Off
- * 1 = Alert
- * 2 = Vibrate
- * @hide
- */
- public static final String EMERGENCY_TONE = "emergency_tone";
-
- /**
- * CDMA only settings
- * Whether the auto retry is enabled. The value is
- * boolean (1 or 0).
- * @hide
- */
- public static final String CALL_AUTO_RETRY = "call_auto_retry";
-
- /**
* Whether the hearing aid is enabled. The value is
* boolean (1 or 0).
* @hide
@@ -2296,8 +2299,8 @@ public final class Settings {
DATE_FORMAT,
DTMF_TONE_WHEN_DIALING,
DTMF_TONE_TYPE_WHEN_DIALING,
- EMERGENCY_TONE,
- CALL_AUTO_RETRY,
+ Global.EMERGENCY_TONE,
+ Global.CALL_AUTO_RETRY,
HEARING_AID,
TTY_MODE,
SOUND_EFFECTS_ENABLED,
@@ -2695,6 +2698,8 @@ public final class Settings {
MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
+ MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
+ MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_CDMA_SUBSCRIPTION);
}
/**
@@ -3653,20 +3658,6 @@ public final class Settings {
= "allowed_geolocation_origins";
/**
- * The preferred network mode 7 = Global
- * 6 = EvDo only
- * 5 = CDMA w/o EvDo
- * 4 = CDMA / EvDo auto
- * 3 = GSM / WCDMA auto
- * 2 = WCDMA only
- * 1 = GSM only
- * 0 = GSM / WCDMA preferred
- * @hide
- */
- public static final String PREFERRED_NETWORK_MODE =
- "preferred_network_mode";
-
- /**
* The preferred TTY mode 0 = TTy Off, CDMA default
* 1 = TTY Full
* 2 = TTY HCO
@@ -3677,14 +3668,6 @@ public final class Settings {
"preferred_tty_mode";
/**
- * The cdma subscription 0 = Subscription from RUIM, when available
- * 1 = Subscription from NV
- * @hide
- */
- public static final String PREFERRED_CDMA_SUBSCRIPTION =
- "preferred_cdma_subscription";
-
- /**
* Whether the enhanced voice privacy mode is enabled.
* 0 = normal voice privacy
* 1 = enhanced voice privacy
@@ -5170,6 +5153,104 @@ public final class Settings {
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
}
+ /**
+ * Scaling factor for normal window animations. Setting to 0 will
+ * disable window animations.
+ */
+ public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
+
+ /**
+ * Scaling factor for activity transition animations. Setting to 0 will
+ * disable window animations.
+ */
+ public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
+
+ /**
+ * Scaling factor for Animator-based animations. This affects both the
+ * start delay and duration of all such animations. Setting to 0 will
+ * cause animations to end immediately. The default value is 1.
+ */
+ public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
+
+ /**
+ * Scaling factor for normal window animations. Setting to 0 will
+ * disable window animations.
+ *
+ * @hide
+ */
+ public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
+
+ /**
+ * If 0, the compatibility mode is off for all applications.
+ * If 1, older applications run under compatibility mode.
+ * TODO: remove this settings before code freeze (bug/1907571)
+ * @hide
+ */
+ public static final String COMPATIBILITY_MODE = "compatibility_mode";
+
+ /**
+ * CDMA only settings
+ * Emergency Tone 0 = Off
+ * 1 = Alert
+ * 2 = Vibrate
+ * @hide
+ */
+ public static final String EMERGENCY_TONE = "emergency_tone";
+
+ /**
+ * CDMA only settings
+ * Whether the auto retry is enabled. The value is
+ * boolean (1 or 0).
+ * @hide
+ */
+ public static final String CALL_AUTO_RETRY = "call_auto_retry";
+
+ /**
+ * The preferred network mode 7 = Global
+ * 6 = EvDo only
+ * 5 = CDMA w/o EvDo
+ * 4 = CDMA / EvDo auto
+ * 3 = GSM / WCDMA auto
+ * 2 = WCDMA only
+ * 1 = GSM only
+ * 0 = GSM / WCDMA preferred
+ * @hide
+ */
+ public static final String PREFERRED_NETWORK_MODE =
+ "preferred_network_mode";
+
+ /**
+ * The cdma subscription 0 = Subscription from RUIM, when available
+ * 1 = Subscription from NV
+ * @hide
+ */
+ public static final String PREFERRED_CDMA_SUBSCRIPTION =
+ "preferred_cdma_subscription";
+
+ /**
+ * Name of an application package to be debugged.
+ */
+ public static final String DEBUG_APP = "debug_app";
+
+ /**
+ * If 1, when launching DEBUG_APP it will wait for the debugger before
+ * starting user code. If 0, it will run normally.
+ */
+ public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
+
+ /**
+ * Control whether the process CPU usage meter should be shown.
+ */
+ public static final String SHOW_PROCESSES = "show_processes";
+
+ /**
+ * If 1, the activity manager will aggressively finish activities and
+ * processes as soon as they are no longer needed. If 0, the normal
+ * extended lifetime is used.
+ */
+ public static final String ALWAYS_FINISH_ACTIVITIES =
+ "always_finish_activities";
+
// Populated lazily, guarded by class object:
private static NameValueCache sNameValueCache = new NameValueCache(
SYS_PROP_SETTING_VERSION,
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 63ec577..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);
}
}
@@ -6466,11 +6468,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (viewRootImpl != null) {
viewRootImpl.setAccessibilityFocus(this, null);
}
- if (mAttachInfo != null) {
- Rect rectangle = mAttachInfo.mTmpInvalRect;
- getDrawingRect(rectangle);
- requestRectangleOnScreen(rectangle);
- }
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
notifyAccessibilityStateChanged();
@@ -11573,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();