Merge "SysUI: Suppress HUNs from non-profile users" into lmp-dev
diff --git a/api/current.txt b/api/current.txt
index fc042d2..c0752d0 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5424,7 +5424,7 @@
method public boolean getCrossProfileCallerIdDisabled(android.content.ComponentName);
method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName);
method public int getCurrentFailedPasswordAttempts();
- method public java.util.List<byte[]> getInstalledCaCerts();
+ method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName);
method public int getKeyguardDisabledFeatures(android.content.ComponentName);
method public int getMaximumFailedPasswordsForWipe(android.content.ComponentName);
method public long getMaximumTimeToLock(android.content.ComponentName);
@@ -5445,7 +5445,7 @@
method public boolean getScreenCaptureDisabled(android.content.ComponentName);
method public boolean getStorageEncryption(android.content.ComponentName);
method public int getStorageEncryptionStatus();
- method public boolean hasCaCertInstalled(byte[]);
+ method public boolean hasCaCertInstalled(android.content.ComponentName, byte[]);
method public boolean hasGrantedPolicy(android.content.ComponentName, int);
method public boolean installCaCert(android.content.ComponentName, byte[]);
method public boolean isActivePasswordSufficient();
@@ -28859,7 +28859,7 @@
method public boolean getAutoPersisting();
method public android.os.Bundle getCarrierConfigValues();
method public static android.telephony.SmsManager getDefault();
- method public static android.telephony.SmsManager getSmsManagerForSubId(long);
+ method public static android.telephony.SmsManager getSmsManagerUsingSubId(long);
method public long getSubId();
method public android.net.Uri importMultimediaMessage(byte[], java.lang.String, long, boolean, boolean);
method public android.net.Uri importTextMessage(java.lang.String, int, java.lang.String, long, boolean, boolean);
@@ -28876,6 +28876,8 @@
method public void updateMmsSendStatus(int, boolean);
method public void updateSmsSendStatus(int, boolean);
method public boolean updateStoredMessageStatus(android.net.Uri, android.content.ContentValues);
+ field public static final java.lang.String MESSAGE_STATUS_READ = "read";
+ field public static final java.lang.String MESSAGE_STATUS_SEEN = "seen";
field public static final java.lang.String MMS_CONFIG_ALIAS_ENABLED = "aliasEnabled";
field public static final java.lang.String MMS_CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
field public static final java.lang.String MMS_CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
@@ -28904,8 +28906,6 @@
field public static final java.lang.String MMS_CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
field public static final java.lang.String MMS_CONFIG_UA_PROF_URL = "uaProfUrl";
field public static final java.lang.String MMS_CONFIG_USER_AGENT = "userAgent";
- field public static final java.lang.String MESSAGE_STATUS_READ = "read";
- field public static final java.lang.String MESSAGE_STATUS_SEEN = "seen";
field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4
field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2
field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3
@@ -32916,6 +32916,7 @@
field public static final int KEYCODE_GUIDE = 172; // 0xac
field public static final int KEYCODE_H = 36; // 0x24
field public static final int KEYCODE_HEADSETHOOK = 79; // 0x4f
+ field public static final int KEYCODE_HELP = 259; // 0x103
field public static final int KEYCODE_HENKAN = 214; // 0xd6
field public static final int KEYCODE_HOME = 3; // 0x3
field public static final int KEYCODE_I = 37; // 0x25
@@ -33016,9 +33017,36 @@
field public static final int KEYCODE_T = 48; // 0x30
field public static final int KEYCODE_TAB = 61; // 0x3d
field public static final int KEYCODE_TV = 170; // 0xaa
+ field public static final int KEYCODE_TV_ANTENNA_CABLE = 242; // 0xf2
+ field public static final int KEYCODE_TV_AUDIO_DESCRIPTION = 252; // 0xfc
+ field public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254; // 0xfe
+ field public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253; // 0xfd
+ field public static final int KEYCODE_TV_CONTENTS_MENU = 256; // 0x100
field public static final int KEYCODE_TV_DATA_SERVICE = 230; // 0xe6
field public static final int KEYCODE_TV_INPUT = 178; // 0xb2
+ field public static final int KEYCODE_TV_INPUT_COMPONENT_1 = 249; // 0xf9
+ field public static final int KEYCODE_TV_INPUT_COMPONENT_2 = 250; // 0xfa
+ field public static final int KEYCODE_TV_INPUT_COMPOSITE_1 = 247; // 0xf7
+ field public static final int KEYCODE_TV_INPUT_COMPOSITE_2 = 248; // 0xf8
+ field public static final int KEYCODE_TV_INPUT_HDMI_1 = 243; // 0xf3
+ field public static final int KEYCODE_TV_INPUT_HDMI_2 = 244; // 0xf4
+ field public static final int KEYCODE_TV_INPUT_HDMI_3 = 245; // 0xf5
+ field public static final int KEYCODE_TV_INPUT_HDMI_4 = 246; // 0xf6
+ field public static final int KEYCODE_TV_INPUT_VGA_1 = 251; // 0xfb
+ field public static final int KEYCODE_TV_MEDIA_CONTEXT_MENU = 257; // 0x101
+ field public static final int KEYCODE_TV_NETWORK = 241; // 0xf1
+ field public static final int KEYCODE_TV_NUMBER_ENTRY = 234; // 0xea
field public static final int KEYCODE_TV_POWER = 177; // 0xb1
+ field public static final int KEYCODE_TV_RADIO_SERVICE = 232; // 0xe8
+ field public static final int KEYCODE_TV_SATELLITE = 237; // 0xed
+ field public static final int KEYCODE_TV_SATELLITE_BS = 238; // 0xee
+ field public static final int KEYCODE_TV_SATELLITE_CS = 239; // 0xef
+ field public static final int KEYCODE_TV_SATELLITE_SERVICE = 240; // 0xf0
+ field public static final int KEYCODE_TV_TELETEXT = 233; // 0xe9
+ field public static final int KEYCODE_TV_TERRESTRIAL_ANALOG = 235; // 0xeb
+ field public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL = 236; // 0xec
+ field public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258; // 0x102
+ field public static final int KEYCODE_TV_ZOOM_MODE = 255; // 0xff
field public static final int KEYCODE_U = 49; // 0x31
field public static final int KEYCODE_UNKNOWN = 0; // 0x0
field public static final int KEYCODE_V = 50; // 0x32
diff --git a/core/java/android/app/ActivityTransitionState.java b/core/java/android/app/ActivityTransitionState.java
index 613e248..ad4a22b 100644
--- a/core/java/android/app/ActivityTransitionState.java
+++ b/core/java/android/app/ActivityTransitionState.java
@@ -151,6 +151,7 @@
mEnterActivityOptions = options;
mIsEnterTriggered = false;
if (mEnterActivityOptions.isReturning()) {
+ restoreExitedViews();
int result = mEnterActivityOptions.getResultCode();
if (result != 0) {
activity.onActivityReenter(result, mEnterActivityOptions.getResultData());
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 47d3fd6..4126647 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -170,7 +170,7 @@
private void sendSharedElementDestination() {
boolean allReady;
- if (allowOverlappingTransitions()) {
+ if (allowOverlappingTransitions() && getEnterViewsTransition() != null) {
allReady = false;
} else {
allReady = !getDecor().isLayoutRequested();
@@ -466,6 +466,7 @@
Drawable background = getDecor().getBackground();
if (background != null) {
background = background.mutate();
+ getWindow().setBackgroundDrawable(background);
mBackgroundAnimator = ObjectAnimator.ofInt(background, "alpha", 255);
mBackgroundAnimator.setDuration(getFadeDuration());
mBackgroundAnimator.addListener(new AnimatorListenerAdapter() {
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 3760b96..231c93f 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -140,7 +140,8 @@
if (getDecor() != null) {
getDecor().suppressLayout(true);
}
- if (!mSharedElements.isEmpty() && getSharedElementTransition() != null) {
+ if (mExitSharedElementBundle != null && !mExitSharedElementBundle.isEmpty() &&
+ !mSharedElements.isEmpty() && getSharedElementTransition() != null) {
startTransition(new Runnable() {
public void run() {
startSharedElementExit();
@@ -259,6 +260,8 @@
ViewGroup decor = getDecor();
Drawable background;
if (decor != null && (background = decor.getBackground()) != null) {
+ background = background.mutate();
+ getWindow().setBackgroundDrawable(background);
mBackgroundAnimator = ObjectAnimator.ofInt(background, "alpha", 0);
mBackgroundAnimator.addListener(new AnimatorListenerAdapter() {
@Override
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 12a94e9..282444a 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -1786,16 +1786,24 @@
* If a user has installed any certificates by other means than device policy these will be
* included too.
*
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @return a List of byte[] arrays, each encoding one user CA certificate.
*/
- public List<byte[]> getInstalledCaCerts() {
- final TrustedCertificateStore certStore = new TrustedCertificateStore();
+ public List<byte[]> getInstalledCaCerts(ComponentName admin) {
List<byte[]> certs = new ArrayList<byte[]>();
- for (String alias : certStore.userAliases()) {
+ if (mService != null) {
try {
- certs.add(certStore.getCertificate(alias).getEncoded());
- } catch (CertificateException ce) {
- Log.w(TAG, "Could not encode certificate: " + alias, ce);
+ mService.enforceCanManageCaCerts(admin);
+ final TrustedCertificateStore certStore = new TrustedCertificateStore();
+ for (String alias : certStore.userAliases()) {
+ try {
+ certs.add(certStore.getCertificate(alias).getEncoded());
+ } catch (CertificateException ce) {
+ Log.w(TAG, "Could not encode certificate: " + alias, ce);
+ }
+ }
+ } catch (RemoteException re) {
+ Log.w(TAG, "Failed talking with device policy service", re);
}
}
return certs;
@@ -1822,13 +1830,19 @@
/**
* Returns whether this certificate is installed as a trusted CA.
*
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param certBuffer encoded form of the certificate to look up.
*/
- public boolean hasCaCertInstalled(byte[] certBuffer) {
- try {
- return getCaCertAlias(certBuffer) != null;
- } catch (CertificateException ce) {
- Log.w(TAG, "Could not parse certificate", ce);
+ public boolean hasCaCertInstalled(ComponentName admin, byte[] certBuffer) {
+ if (mService != null) {
+ try {
+ mService.enforceCanManageCaCerts(admin);
+ return getCaCertAlias(certBuffer) != null;
+ } catch (RemoteException re) {
+ Log.w(TAG, "Failed talking with device policy service", re);
+ } catch (CertificateException ce) {
+ Log.w(TAG, "Could not parse certificate", ce);
+ }
}
return false;
}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index c984cf9..57d8b95 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -124,6 +124,7 @@
boolean installCaCert(in ComponentName admin, in byte[] certBuffer);
void uninstallCaCert(in ComponentName admin, in String alias);
+ void enforceCanManageCaCerts(in ComponentName admin);
void addPersistentPreferredActivity(in ComponentName admin, in IntentFilter filter, in ComponentName activity);
void clearPackagePersistentPreferredActivities(in ComponentName admin, String packageName);
diff --git a/core/java/android/app/job/JobScheduler.java b/core/java/android/app/job/JobScheduler.java
index ca7022d..5edc2a0 100644
--- a/core/java/android/app/job/JobScheduler.java
+++ b/core/java/android/app/job/JobScheduler.java
@@ -21,14 +21,23 @@
import android.content.Context;
/**
- * Class for scheduling various types of jobs with the scheduling framework on the device.
+ * This is an API for scheduling various types of jobs against the framework that will be executed
+ * in your application's own process.
+ * <p>
* See {@link android.app.job.JobInfo} for more description of the types of jobs that can be run
- * and how to construct them.
+ * and how to construct them. You will construct these JobInfo objects and pass them to the
+ * JobScheduler with {@link #schedule(JobInfo)}. When the criteria declared are met, the
+ * system will execute this job on your application's {@link android.app.job.JobService}.
+ * You identify which JobService is meant to execute the logic for your job when you create the
+ * JobInfo with {@link android.app.job.JobInfo.Builder#Builder(int, android.content.ComponentName)}.
+ * </p>
+ * <p>
* The framework will be intelligent about when you receive your callbacks, and attempt to batch
* and defer them as much as possible. Typically if you don't specify a deadline on your job, it
* can be run at any moment depending on the current state of the JobScheduler's internal queue,
* however it might be deferred as long as until the next time the device is connected to a power
* source.
+ * </p>
* <p>You do not
* instantiate this class directly; instead, retrieve it through
* {@link android.content.Context#getSystemService
diff --git a/core/java/android/transition/ChangeTransform.java b/core/java/android/transition/ChangeTransform.java
index d579f54..cb0a875 100644
--- a/core/java/android/transition/ChangeTransform.java
+++ b/core/java/android/transition/ChangeTransform.java
@@ -45,6 +45,10 @@
private static final String PROPNAME_TRANSFORMS = "android:changeTransform:transforms";
private static final String PROPNAME_PARENT = "android:changeTransform:parent";
private static final String PROPNAME_PARENT_MATRIX = "android:changeTransform:parentMatrix";
+ private static final String PROPNAME_INTERMEDIATE_PARENT_MATRIX =
+ "android:changeTransform:intermediateParentMatrix";
+ private static final String PROPNAME_INTERMEDIATE_MATRIX =
+ "android:changeTransform:intermediateMatrix";
private static final String[] sTransitionProperties = {
PROPNAME_MATRIX,
@@ -172,6 +176,10 @@
parent.transformMatrixToGlobal(parentMatrix);
parentMatrix.preTranslate(-parent.getScrollX(), -parent.getScrollY());
transitionValues.values.put(PROPNAME_PARENT_MATRIX, parentMatrix);
+ transitionValues.values.put(PROPNAME_INTERMEDIATE_MATRIX,
+ view.getTag(R.id.transitionTransform));
+ transitionValues.values.put(PROPNAME_INTERMEDIATE_PARENT_MATRIX,
+ view.getTag(R.id.parentMatrix));
}
return;
}
@@ -199,12 +207,13 @@
ViewGroup endParent = (ViewGroup) endValues.values.get(PROPNAME_PARENT);
boolean handleParentChange = mReparent && !parentsMatch(startParent, endParent);
- Matrix startMatrix = (Matrix) startValues.view.getTag(R.id.transitionTransform);
+ Matrix startMatrix = (Matrix) startValues.values.get(PROPNAME_INTERMEDIATE_MATRIX);
if (startMatrix != null) {
startValues.values.put(PROPNAME_MATRIX, startMatrix);
}
- Matrix startParentMatrix = (Matrix) startValues.view.getTag(R.id.parentMatrix);
+ Matrix startParentMatrix = (Matrix)
+ startValues.values.get(PROPNAME_INTERMEDIATE_PARENT_MATRIX);
if (startParentMatrix != null) {
startValues.values.put(PROPNAME_PARENT_MATRIX, startParentMatrix);
}
@@ -250,9 +259,11 @@
ObjectAnimator animator = ObjectAnimator.ofObject(view, ANIMATION_MATRIX_PROPERTY,
new TransitionUtils.MatrixEvaluator(), startMatrix, endMatrix);
+ final Matrix finalEndMatrix = endMatrix;
+
AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
private boolean mIsCanceled;
- private Matrix mTempMatrix;
+ private Matrix mTempMatrix = new Matrix();
@Override
public void onAnimationCancel(Animator animation) {
@@ -262,8 +273,7 @@
@Override
public void onAnimationEnd(Animator animation) {
if (!mIsCanceled) {
- view.setTagInternal(R.id.transitionTransform, null);
- view.setTagInternal(R.id.parentMatrix, null);
+ setCurrentMatrix(finalEndMatrix);
}
ANIMATION_MATRIX_PROPERTY.set(view, null);
transforms.restore(view);
@@ -273,19 +283,19 @@
public void onAnimationPause(Animator animation) {
ValueAnimator animator = (ValueAnimator) animation;
Matrix currentMatrix = (Matrix) animator.getAnimatedValue();
- if (mTempMatrix == null) {
- mTempMatrix = new Matrix(currentMatrix);
- } else {
- mTempMatrix.set(currentMatrix);
- }
- view.setTagInternal(R.id.transitionTransform, mTempMatrix);
- transforms.restore(view);
+ setCurrentMatrix(currentMatrix);
}
@Override
public void onAnimationResume(Animator animation) {
setIdentityTransforms(view);
}
+
+ private void setCurrentMatrix(Matrix currentMatrix) {
+ mTempMatrix.set(currentMatrix);
+ view.setTagInternal(R.id.transitionTransform, mTempMatrix);
+ transforms.restore(view);
+ }
};
animator.addListener(listener);
@@ -423,6 +433,8 @@
public void onTransitionEnd(Transition transition) {
transition.removeListener(this);
GhostView.removeGhost(mView);
+ mView.setTagInternal(R.id.transitionTransform, null);
+ mView.setTagInternal(R.id.parentMatrix, null);
}
@Override
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 964b054..0701b53 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -660,8 +660,96 @@
/** Key code constant: Voice Assist key.
* Launches the global voice assist activity. Not delivered to applications. */
public static final int KEYCODE_VOICE_ASSIST = 231;
+ /** Key code constant: Radio key.
+ * Toggles TV service / Radio service. */
+ public static final int KEYCODE_TV_RADIO_SERVICE = 232;
+ /** Key code constant: Teletext key.
+ * Displays Teletext service. */
+ public static final int KEYCODE_TV_TELETEXT = 233;
+ /** Key code constant: Number entry key.
+ * Initiates to enter multi-digit channel nubmber when each digit key is assigned
+ * for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC
+ * User Control Code. */
+ public static final int KEYCODE_TV_NUMBER_ENTRY = 234;
+ /** Key code constant: Analog Terrestrial key.
+ * Switches to analog terrestrial broadcast service. */
+ public static final int KEYCODE_TV_TERRESTRIAL_ANALOG = 235;
+ /** Key code constant: Digital Terrestrial key.
+ * Switches to digital terrestrial broadcast service. */
+ public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL = 236;
+ /** Key code constant: Satellite key.
+ * Switches to digital satellite broadcast service. */
+ public static final int KEYCODE_TV_SATELLITE = 237;
+ /** Key code constant: BS key.
+ * Switches to BS digital satellite broadcasting service available in Japan. */
+ public static final int KEYCODE_TV_SATELLITE_BS = 238;
+ /** Key code constant: CS key.
+ * Switches to CS digital satellite broadcasting service available in Japan. */
+ public static final int KEYCODE_TV_SATELLITE_CS = 239;
+ /** Key code constant: BS/CS key.
+ * Toggles between BS and CS digital satellite services. */
+ public static final int KEYCODE_TV_SATELLITE_SERVICE = 240;
+ /** Key code constant: Toggle Network key.
+ * Toggles selecting broacast services. */
+ public static final int KEYCODE_TV_NETWORK = 241;
+ /** Key code constant: Antenna/Cable key.
+ * Toggles broadcast input source between antenna and cable. */
+ public static final int KEYCODE_TV_ANTENNA_CABLE = 242;
+ /** Key code constant: HDMI #1 key.
+ * Switches to HDMI input #1. */
+ public static final int KEYCODE_TV_INPUT_HDMI_1 = 243;
+ /** Key code constant: HDMI #2 key.
+ * Switches to HDMI input #2. */
+ public static final int KEYCODE_TV_INPUT_HDMI_2 = 244;
+ /** Key code constant: HDMI #3 key.
+ * Switches to HDMI input #3. */
+ public static final int KEYCODE_TV_INPUT_HDMI_3 = 245;
+ /** Key code constant: HDMI #4 key.
+ * Switches to HDMI input #4. */
+ public static final int KEYCODE_TV_INPUT_HDMI_4 = 246;
+ /** Key code constant: Composite #1 key.
+ * Switches to composite video input #1. */
+ public static final int KEYCODE_TV_INPUT_COMPOSITE_1 = 247;
+ /** Key code constant: Composite #2 key.
+ * Switches to composite video input #2. */
+ public static final int KEYCODE_TV_INPUT_COMPOSITE_2 = 248;
+ /** Key code constant: Component #1 key.
+ * Switches to component video input #1. */
+ public static final int KEYCODE_TV_INPUT_COMPONENT_1 = 249;
+ /** Key code constant: Component #2 key.
+ * Switches to component video input #2. */
+ public static final int KEYCODE_TV_INPUT_COMPONENT_2 = 250;
+ /** Key code constant: VGA #1 key.
+ * Switches to VGA (analog RGB) input #1. */
+ public static final int KEYCODE_TV_INPUT_VGA_1 = 251;
+ /** Key code constant: Audio description key.
+ * Toggles audio description off / on. */
+ public static final int KEYCODE_TV_AUDIO_DESCRIPTION = 252;
+ /** Key code constant: Audio description mixing volume up key.
+ * Louden audio description volume as compared with normal audio volume. */
+ public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253;
+ /** Key code constant: Audio description mixing volume down key.
+ * Lessen audio description volume as compared with normal audio volume. */
+ public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254;
+ /** Key code constant: Zoom mode key.
+ * Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) */
+ public static final int KEYCODE_TV_ZOOM_MODE = 255;
+ /** Key code constant: Contents menu key.
+ * Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control
+ * Code */
+ public static final int KEYCODE_TV_CONTENTS_MENU = 256;
+ /** Key code constant: Media context menu key.
+ * Goes to the context menu of media contents. Corresponds to Media Context-sensitive
+ * Menu (0x11) of CEC User Control Code. */
+ public static final int KEYCODE_TV_MEDIA_CONTEXT_MENU = 257;
+ /** Key code constant: Timer programming key.
+ * Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of
+ * CEC User Control Code. */
+ public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258;
+ /** Key code constant: Help key. */
+ public static final int KEYCODE_HELP = 259;
- private static final int LAST_KEYCODE = KEYCODE_VOICE_ASSIST;
+ private static final int LAST_KEYCODE = KEYCODE_HELP;
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 9b1b7ed..3628355 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1726,6 +1726,34 @@
<enum name="KEYCODE_LAST_CHANNEL" value="229" />
<enum name="KEYCODE_TV_DATA_SERVICE" value="230" />
<enum name="KEYCODE_VOICE_ASSIST" value="231" />
+ <enum name="KEYCODE_TV_RADIO_SERVICE" value="232" />
+ <enum name="KEYCODE_TV_TELETEXT" value="233" />
+ <enum name="KEYCODE_TV_NUMBER_ENTRY" value="234" />
+ <enum name="KEYCODE_TV_TERRESTRIAL_ANALOG" value="235" />
+ <enum name="KEYCODE_TV_TERRESTRIAL_DIGITAL" value="236" />
+ <enum name="KEYCODE_TV_SATELLITE" value="237" />
+ <enum name="KEYCODE_TV_SATELLITE_BS" value="238" />
+ <enum name="KEYCODE_TV_SATELLITE_CS" value="239" />
+ <enum name="KEYCODE_TV_SATELLITE_SERVICE" value="240" />
+ <enum name="KEYCODE_TV_NETWORK" value="241" />
+ <enum name="KEYCODE_TV_ANTENNA_CABLE" value="242" />
+ <enum name="KEYCODE_TV_INPUT_HDMI_1" value="243" />
+ <enum name="KEYCODE_TV_INPUT_HDMI_2" value="244" />
+ <enum name="KEYCODE_TV_INPUT_HDMI_3" value="245" />
+ <enum name="KEYCODE_TV_INPUT_HDMI_4" value="246" />
+ <enum name="KEYCODE_TV_INPUT_COMPOSITE_1" value="247" />
+ <enum name="KEYCODE_TV_INPUT_COMPOSITE_2" value="248" />
+ <enum name="KEYCODE_TV_INPUT_COMPONENT_1" value="249" />
+ <enum name="KEYCODE_TV_INPUT_COMPONENT_2" value="250" />
+ <enum name="KEYCODE_TV_INPUT_VGA_1" value="251" />
+ <enum name="KEYCODE_TV_AUDIO_DESCRIPTION" value="252" />
+ <enum name="KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP" value="253" />
+ <enum name="KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN" value="254" />
+ <enum name="KEYCODE_TV_ZOOM_MODE" value="255" />
+ <enum name="KEYCODE_TV_CONTENTS_MENU" value="256" />
+ <enum name="KEYCODE_TV_MEDIA_CONTEXT_MENU" value="257" />
+ <enum name="KEYCODE_TV_TIMER_PROGRAMMING" value="258" />
+ <enum name="KEYCODE_HELP" value="259" />
</attr>
<!-- ***************************************************************** -->
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 008ec99..2e9df8a 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -8408,6 +8408,10 @@
synchronized(this) {
TaskRecord tr = recentTaskForIdLocked(taskId);
if (tr != null) {
+ if (tr == mStackSupervisor.mLockTaskModeTask) {
+ mStackSupervisor.showLockTaskToast();
+ return;
+ }
if (DEBUG_STACK) Slog.d(TAG, "moveTaskToBack: moving task=" + tr);
ActivityStack stack = tr.stack;
if (stack.mResumedActivity != null && stack.mResumedActivity.task == tr) {
@@ -8440,11 +8444,19 @@
enforceNotIsolatedCaller("moveActivityTaskToBack");
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
- int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot);
- if (taskId >= 0) {
- return ActivityRecord.getStackLocked(token).moveTaskToBackLocked(taskId, null);
+ try {
+ int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot);
+ if (taskId >= 0) {
+ if ((mStackSupervisor.mLockTaskModeTask != null)
+ && (mStackSupervisor.mLockTaskModeTask.taskId == taskId)) {
+ mStackSupervisor.showLockTaskToast();
+ return false;
+ }
+ return ActivityRecord.getStackLocked(token).moveTaskToBackLocked(taskId, null);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(origId);
}
- Binder.restoreCallingIdentity(origId);
}
return false;
}
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 6bc1c9c..780efa1 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -1262,7 +1262,7 @@
if (err == ActivityManager.START_SUCCESS) {
final int userId = aInfo != null ? UserHandle.getUserId(aInfo.applicationInfo.uid) : 0;
Slog.i(TAG, "START u" + userId + " {" + intent.toShortString(true, true, true, false)
- + "} from pid " + (callerApp != null ? callerApp.pid : callingPid)
+ + "} from uid " + callingUid
+ " on display " + (container == null ? (mFocusedStack == null ?
Display.DEFAULT_DISPLAY : mFocusedStack.mDisplayId) :
(container.mActivityDisplay == null ? Display.DEFAULT_DISPLAY :
@@ -2075,6 +2075,7 @@
}
targetStack = inTask.stack;
targetStack.moveTaskToFrontLocked(inTask, r, options);
+ targetStack.moveToFront();
mWindowManager.moveTaskToTop(inTask.taskId);
// Check whether we should actually launch the new activity in to the task,
diff --git a/services/core/java/com/android/server/job/JobSchedulerService.java b/services/core/java/com/android/server/job/JobSchedulerService.java
index c3bc306..30154d7 100644
--- a/services/core/java/com/android/server/job/JobSchedulerService.java
+++ b/services/core/java/com/android/server/job/JobSchedulerService.java
@@ -199,9 +199,6 @@
List<JobStatus> jobsForUser = mJobs.getJobsByUser(userHandle);
for (int i=0; i<jobsForUser.size(); i++) {
JobStatus toRemove = jobsForUser.get(i);
- if (DEBUG) {
- Slog.d(TAG, "Cancelling: " + toRemove);
- }
cancelJobLocked(toRemove);
}
}
@@ -219,9 +216,6 @@
List<JobStatus> jobsForUid = mJobs.getJobsByUid(uid);
for (int i=0; i<jobsForUid.size(); i++) {
JobStatus toRemove = jobsForUid.get(i);
- if (DEBUG) {
- Slog.d(TAG, "Cancelling: " + toRemove);
- }
cancelJobLocked(toRemove);
}
}
@@ -547,14 +541,28 @@
private void queueReadyJobsForExecutionH() {
synchronized (mJobs) {
ArraySet<JobStatus> jobs = mJobs.getJobs();
+ if (DEBUG) {
+ Slog.d(TAG, "queuing all ready jobs for execution:");
+ }
for (int i=0; i<jobs.size(); i++) {
JobStatus job = jobs.valueAt(i);
if (isReadyToBeExecutedLocked(job)) {
+ if (DEBUG) {
+ Slog.d(TAG, " queued " + job.toShortString());
+ }
mPendingJobs.add(job);
} else if (isReadyToBeCancelledLocked(job)) {
stopJobOnServiceContextLocked(job);
}
}
+ if (DEBUG) {
+ final int queuedJobs = mPendingJobs.size();
+ if (queuedJobs == 0) {
+ Slog.d(TAG, "No jobs pending.");
+ } else {
+ Slog.d(TAG, queuedJobs + " jobs queued.");
+ }
+ }
}
}
@@ -657,6 +665,9 @@
private void maybeRunPendingJobsH() {
synchronized (mJobs) {
Iterator<JobStatus> it = mPendingJobs.iterator();
+ if (DEBUG) {
+ Slog.d(TAG, "pending queue: " + mPendingJobs.size() + " jobs.");
+ }
while (it.hasNext()) {
JobStatus nextPending = it.next();
JobServiceContext availableContext = null;
diff --git a/services/core/java/com/android/server/job/JobServiceContext.java b/services/core/java/com/android/server/job/JobServiceContext.java
index 5297911..344c57b 100644
--- a/services/core/java/com/android/server/job/JobServiceContext.java
+++ b/services/core/java/com/android/server/job/JobServiceContext.java
@@ -157,6 +157,7 @@
mExecutionStartTimeElapsed = SystemClock.elapsedRealtime();
mVerb = VERB_BINDING;
+ scheduleOpTimeOut();
final Intent intent = new Intent().setComponent(job.getServiceComponent());
boolean binding = mContext.bindServiceAsUser(intent, this,
Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND,
@@ -253,8 +254,6 @@
return;
}
this.service = IJobService.Stub.asInterface(service);
- // Remove all timeouts.
- mCallbackHandler.removeMessages(MSG_TIMEOUT);
final PowerManager pm =
(PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mRunningJob.getTag());
@@ -299,6 +298,7 @@
public void handleMessage(Message message) {
switch (message.what) {
case MSG_SERVICE_BOUND:
+ removeMessages(MSG_TIMEOUT);
handleServiceBoundH();
break;
case MSG_CALLBACK:
@@ -337,6 +337,9 @@
/** Start the job on the service. */
private void handleServiceBoundH() {
+ if (DEBUG) {
+ Slog.d(TAG, "MSG_SERVICE_BOUND for " + mRunningJob.toShortString());
+ }
if (mVerb != VERB_BINDING) {
Slog.e(TAG, "Sending onStartJob for a job that isn't pending. "
+ VERB_STRINGS[mVerb]);
@@ -456,42 +459,36 @@
/** Process MSG_TIMEOUT here. */
private void handleOpTimeoutH() {
- if (JobSchedulerService.DEBUG) {
- Slog.d(TAG, "MSG_TIMEOUT of " +
- mRunningJob.getServiceComponent().getShortClassName() + " : "
- + mParams.getJobId());
- }
-
- final int jobId = mParams.getJobId();
switch (mVerb) {
+ case VERB_BINDING:
+ Slog.e(TAG, "Time-out while trying to bind " + mRunningJob.toShortString() +
+ ", dropping.");
+ closeAndCleanupJobH(false /* needsReschedule */);
+ break;
case VERB_STARTING:
// Client unresponsive - wedged or failed to respond in time. We don't really
// know what happened so let's log it and notify the JobScheduler
// FINISHED/NO-RETRY.
Slog.e(TAG, "No response from client for onStartJob '" +
- mRunningJob.getServiceComponent().getShortClassName() + "' jId: "
- + jobId);
+ mRunningJob.toShortString());
closeAndCleanupJobH(false /* needsReschedule */);
break;
case VERB_STOPPING:
// At least we got somewhere, so fail but ask the JobScheduler to reschedule.
Slog.e(TAG, "No response from client for onStopJob, '" +
- mRunningJob.getServiceComponent().getShortClassName() + "' jId: "
- + jobId);
+ mRunningJob.toShortString());
closeAndCleanupJobH(true /* needsReschedule */);
break;
case VERB_EXECUTING:
// Not an error - client ran out of time.
Slog.i(TAG, "Client timed out while executing (no jobFinished received)." +
- " sending onStop. " +
- mRunningJob.getServiceComponent().getShortClassName() + "' jId: "
- + jobId);
+ " sending onStop. " + mRunningJob.toShortString());
sendStopMessageH();
break;
default:
- Slog.e(TAG, "Handling timeout for an unknown active job state: "
- + mRunningJob);
- return;
+ Slog.e(TAG, "Handling timeout for an invalid job state: " +
+ mRunningJob.toShortString() + ", dropping.");
+ closeAndCleanupJobH(false /* needsReschedule */);
}
}
@@ -530,7 +527,9 @@
} catch (RemoteException e) {
// Whatever.
}
- mWakeLock.release();
+ if (mWakeLock != null) {
+ mWakeLock.release();
+ }
mContext.unbindService(JobServiceContext.this);
mWakeLock = null;
mRunningJob = null;
@@ -547,25 +546,25 @@
removeMessages(MSG_SHUTDOWN_EXECUTION);
mCompletedListener.onJobCompleted(completedJob, reschedule);
}
+ }
- /**
- * Called when sending a message to the client, over whose execution we have no control. If
- * we haven't received a response in a certain amount of time, we want to give up and carry
- * on with life.
- */
- private void scheduleOpTimeOut() {
- mCallbackHandler.removeMessages(MSG_TIMEOUT);
+ /**
+ * Called when sending a message to the client, over whose execution we have no control. If
+ * we haven't received a response in a certain amount of time, we want to give up and carry
+ * on with life.
+ */
+ private void scheduleOpTimeOut() {
+ mCallbackHandler.removeMessages(MSG_TIMEOUT);
- final long timeoutMillis = (mVerb == VERB_EXECUTING) ?
- EXECUTING_TIMESLICE_MILLIS : OP_TIMEOUT_MILLIS;
- if (DEBUG) {
- Slog.d(TAG, "Scheduling time out for '" +
- mRunningJob.getServiceComponent().getShortClassName() + "' jId: " +
- mParams.getJobId() + ", in " + (timeoutMillis / 1000) + " s");
- }
- Message m = mCallbackHandler.obtainMessage(MSG_TIMEOUT);
- mCallbackHandler.sendMessageDelayed(m, timeoutMillis);
- mTimeoutElapsed = SystemClock.elapsedRealtime() + timeoutMillis;
+ final long timeoutMillis = (mVerb == VERB_EXECUTING) ?
+ EXECUTING_TIMESLICE_MILLIS : OP_TIMEOUT_MILLIS;
+ if (DEBUG) {
+ Slog.d(TAG, "Scheduling time out for '" +
+ mRunningJob.getServiceComponent().getShortClassName() + "' jId: " +
+ mParams.getJobId() + ", in " + (timeoutMillis / 1000) + " s");
}
+ Message m = mCallbackHandler.obtainMessage(MSG_TIMEOUT);
+ mCallbackHandler.sendMessageDelayed(m, timeoutMillis);
+ mTimeoutElapsed = SystemClock.elapsedRealtime() + timeoutMillis;
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 564a3df..cad2772 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -40,7 +40,6 @@
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
-import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
@@ -70,7 +69,6 @@
import android.os.UserManager;
import android.provider.Settings;
import android.security.Credentials;
-import android.security.IKeyChainService;
import android.security.KeyChain;
import android.security.KeyChain.KeyChainConnection;
import android.util.Log;
@@ -2749,7 +2747,8 @@
return !"".equals(state);
}
- public boolean installCaCert(ComponentName who, byte[] certBuffer) throws RemoteException {
+ @Override
+ public void enforceCanManageCaCerts(ComponentName who) {
if (who == null) {
mContext.enforceCallingOrSelfPermission(MANAGE_CA_CERTIFICATES, null);
} else {
@@ -2757,6 +2756,11 @@
getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
}
}
+ }
+
+ @Override
+ public boolean installCaCert(ComponentName admin, byte[] certBuffer) throws RemoteException {
+ enforceCanManageCaCerts(admin);
byte[] pemCert;
try {
@@ -2791,21 +2795,15 @@
return false;
}
- private static X509Certificate parseCert(byte[] certBuffer)
- throws CertificateException, IOException {
+ private static X509Certificate parseCert(byte[] certBuffer) throws CertificateException {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
return (X509Certificate) certFactory.generateCertificate(new ByteArrayInputStream(
certBuffer));
}
- public void uninstallCaCert(ComponentName who, String alias) {
- if (who == null) {
- mContext.enforceCallingOrSelfPermission(MANAGE_CA_CERTIFICATES, null);
- } else {
- synchronized (this) {
- getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
- }
- }
+ @Override
+ public void uninstallCaCert(ComponentName admin, String alias) {
+ enforceCanManageCaCerts(admin);
final UserHandle userHandle = new UserHandle(UserHandle.getCallingUserId());
final long id = Binder.clearCallingIdentity();