Merge "Updated documentation for setScreenCaptureDisabled()" into lmp-dev
diff --git a/api/current.txt b/api/current.txt
index 6f07cd4..73f10b8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5412,7 +5412,6 @@
method public java.lang.String[] getAccountTypesWithManagementDisabled();
method public java.util.List<android.content.ComponentName> getActiveAdmins();
method public android.os.Bundle getApplicationRestrictions(android.content.ComponentName, java.lang.String);
- method public boolean getBlockUninstall(android.content.ComponentName, java.lang.String);
method public boolean getCameraDisabled(android.content.ComponentName);
method public boolean getCrossProfileCallerIdDisabled(android.content.ComponentName);
method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName);
@@ -5433,10 +5432,13 @@
method public int getPasswordMinimumSymbols(android.content.ComponentName);
method public int getPasswordMinimumUpperCase(android.content.ComponentName);
method public int getPasswordQuality(android.content.ComponentName);
+ method public java.util.List<java.lang.String> getPermittedAccessibilityServices(android.content.ComponentName);
+ method public java.util.List<java.lang.String> getPermittedInputMethods(android.content.ComponentName);
method public boolean getScreenCaptureDisabled(android.content.ComponentName);
method public boolean getStorageEncryption(android.content.ComponentName);
method public int getStorageEncryptionStatus();
method public java.util.List<java.lang.String> getTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName);
+ method public boolean getUninstallBlocked(android.content.ComponentName, java.lang.String);
method public boolean hasCaCertInstalled(byte[]);
method public boolean hasGrantedPolicy(android.content.ComponentName, int);
method public boolean installCaCert(android.content.ComponentName, byte[]);
@@ -5455,8 +5457,6 @@
method public void setAccountManagementDisabled(android.content.ComponentName, java.lang.String, boolean);
method public boolean setApplicationHidden(android.content.ComponentName, java.lang.String, boolean);
method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
- method public int setApplicationsHidden(android.content.ComponentName, android.content.Intent, boolean);
- method public void setBlockUninstall(android.content.ComponentName, java.lang.String, boolean);
method public void setCameraDisabled(android.content.ComponentName, boolean);
method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean);
method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String);
@@ -5475,6 +5475,8 @@
method public void setPasswordMinimumSymbols(android.content.ComponentName, int);
method public void setPasswordMinimumUpperCase(android.content.ComponentName, int);
method public void setPasswordQuality(android.content.ComponentName, int);
+ method public boolean setPermittedAccessibilityServices(android.content.ComponentName, java.util.List<java.lang.String>);
+ method public boolean setPermittedInputMethods(android.content.ComponentName, java.util.List<java.lang.String>);
method public void setProfileEnabled(android.content.ComponentName);
method public void setProfileName(android.content.ComponentName, java.lang.String);
method public void setRecommendedGlobalProxy(android.content.ComponentName, android.net.ProxyInfo);
@@ -5483,6 +5485,7 @@
method public void setSecureSetting(android.content.ComponentName, java.lang.String, java.lang.String);
method public int setStorageEncryption(android.content.ComponentName, boolean);
method public void setTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName, java.util.List<java.lang.String>);
+ method public void setUninstallBlocked(android.content.ComponentName, java.lang.String, boolean);
method public boolean switchUser(android.content.ComponentName, android.os.UserHandle);
method public void uninstallAllUserCaCerts(android.content.ComponentName);
method public void uninstallCaCert(android.content.ComponentName, byte[]);
@@ -5524,6 +5527,7 @@
field public static final int KEYGUARD_DISABLE_TRUST_AGENTS = 16; // 0x10
field public static final int KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS = 8; // 0x8
field public static final int KEYGUARD_DISABLE_WIDGETS_ALL = 1; // 0x1
+ field public static final java.lang.String MIME_TYPE_PROVISIONING_NFC = "application/com.android.managedprovisioning";
field public static final int PASSWORD_QUALITY_ALPHABETIC = 262144; // 0x40000
field public static final int PASSWORD_QUALITY_ALPHANUMERIC = 327680; // 0x50000
field public static final int PASSWORD_QUALITY_BIOMETRIC_WEAK = 32768; // 0x8000
@@ -5532,7 +5536,6 @@
field public static final int PASSWORD_QUALITY_NUMERIC_COMPLEX = 196608; // 0x30000
field public static final int PASSWORD_QUALITY_SOMETHING = 65536; // 0x10000
field public static final int PASSWORD_QUALITY_UNSPECIFIED = 0; // 0x0
- field public static final java.lang.String PROVISIONING_NFC_MIME_TYPE = "application/com.android.managedprovisioning";
field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
}
@@ -31510,7 +31513,7 @@
field public static final java.lang.String CASE_GENITIVE = "android.genitive";
field public static final java.lang.String CASE_INSTRUMENTAL = "android.instrumental";
field public static final java.lang.String CASE_LOCATIVE = "android.locative";
- field public static final java.lang.String CASE_NOMINATIVE = "android.nomative";
+ field public static final java.lang.String CASE_NOMINATIVE = "android.nominative";
field public static final java.lang.String CASE_VOCATIVE = "android.vocative";
field public static final java.lang.String GENDER_FEMALE = "android.female";
field public static final java.lang.String GENDER_MALE = "android.male";
diff --git a/core/java/android/animation/Animator.java b/core/java/android/animation/Animator.java
index 5f80ed7..3720c81 100644
--- a/core/java/android/animation/Animator.java
+++ b/core/java/android/animation/Animator.java
@@ -370,6 +370,7 @@
* @hide
*/
public void reverse() {
+ throw new IllegalStateException("Reverse is not supported");
}
/**
diff --git a/core/java/android/animation/RevealAnimator.java b/core/java/android/animation/RevealAnimator.java
index e363a77..0f85f49 100644
--- a/core/java/android/animation/RevealAnimator.java
+++ b/core/java/android/animation/RevealAnimator.java
@@ -26,148 +26,21 @@
*
* @hide
*/
-public class RevealAnimator extends ValueAnimator {
+public class RevealAnimator extends RenderNodeAnimator {
private View mClipView;
- private int mX, mY;
- private float mStartRadius, mEndRadius;
- private float mDelta;
- private boolean mMayRunAsync;
-
- // If this is null, we are running on the UI thread driven by the base
- // ValueAnimator class. If this is not null, forward requests on to this
- // Animator instead.
- private RenderNodeAnimator mRtAnimator;
public RevealAnimator(View clipView, int x, int y,
float startRadius, float endRadius) {
+ super(x, y, startRadius, endRadius);
mClipView = clipView;
- mStartRadius = startRadius;
- mEndRadius = endRadius;
- mDelta = endRadius - startRadius;
- mX = x;
- mY = y;
- super.setValues(PropertyValuesHolder.ofFloat("radius", startRadius, endRadius));
+ setTarget(mClipView);
}
@Override
- void animateValue(float fraction) {
- super.animateValue(fraction);
- fraction = getAnimatedFraction();
- float radius = mStartRadius + (mDelta * fraction);
- mClipView.setRevealClip(true, mX, mY, radius);
- }
-
- @Override
- protected void endAnimation(AnimationHandler handler) {
+ protected void onFinished() {
mClipView.setRevealClip(false, 0, 0, 0);
- super.endAnimation(handler);
+ super.onFinished();
}
- @Override
- public void setAllowRunningAsynchronously(boolean mayRunAsync) {
- mMayRunAsync = mayRunAsync;
- }
-
- private boolean canRunAsync() {
- if (!mMayRunAsync) {
- return false;
- }
- if (mUpdateListeners != null && mUpdateListeners.size() > 0) {
- return false;
- }
- // TODO: Have RNA support this
- if (getRepeatCount() != 0) {
- return false;
- }
- return true;
- }
-
- @Override
- public void start() {
- if (mRtAnimator != null) {
- mRtAnimator.end();
- mRtAnimator = null;
- }
- if (canRunAsync()) {
- mRtAnimator = new RenderNodeAnimator(mX, mY, mStartRadius, mEndRadius);
- mRtAnimator.setDuration(getDuration());
- mRtAnimator.setInterpolator(getInterpolator());
- mRtAnimator.setTarget(mClipView);
- // TODO: Listeners
- mRtAnimator.start();
- } else {
- super.start();
- }
- }
-
- @Override
- public void cancel() {
- if (mRtAnimator != null) {
- mRtAnimator.cancel();
- } else {
- super.cancel();
- }
- }
-
- @Override
- public void end() {
- if (mRtAnimator != null) {
- mRtAnimator.end();
- } else {
- super.end();
- }
- }
-
- @Override
- public void resume() {
- if (mRtAnimator != null) {
- // TODO: Support? Reject?
- } else {
- super.resume();
- }
- }
-
- @Override
- public void pause() {
- if (mRtAnimator != null) {
- // TODO: see resume()
- } else {
- super.pause();
- }
- }
-
- @Override
- public boolean isRunning() {
- if (mRtAnimator != null) {
- return mRtAnimator.isRunning();
- } else {
- return super.isRunning();
- }
- }
-
- @Override
- public boolean isStarted() {
- if (mRtAnimator != null) {
- return mRtAnimator.isStarted();
- } else {
- return super.isStarted();
- }
- }
-
- @Override
- public void reverse() {
- if (mRtAnimator != null) {
- // TODO support
- } else {
- super.reverse();
- }
- }
-
- @Override
- public RevealAnimator clone() {
- RevealAnimator anim = (RevealAnimator) super.clone();
- anim.mRtAnimator = null;
- return anim;
- }
}
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 70ba8ea..47967ba 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -40,6 +40,7 @@
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
+import android.util.MathUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
@@ -1755,6 +1756,7 @@
*/
public static class Builder {
private static final int MAX_ACTION_BUTTONS = 3;
+ private static final float LARGE_TEXT_SCALE = 1.3f;
/**
* @hide
@@ -2577,28 +2579,14 @@
return bitmap;
}
- private RemoteViews applyStandardTemplate(int resId, boolean fitIn1U) {
- final boolean largeFontScale
- = mContext.getResources().getConfiguration().fontScale >= 1.25f;
-
+ private RemoteViews applyStandardTemplate(int resId) {
Bitmap profileIcon = getProfileBadge();
RemoteViews contentView = new BuilderRemoteViews(mContext.getPackageName(),
mOriginatingUserId, resId);
- if (largeFontScale) {
- // Make a little extra room for the bigger text.
- final int margin = (int) mContext.getResources()
- .getDimensionPixelSize(R.dimen.notification_large_font_vert_pad);
- contentView.setViewPadding(R.id.line1, 0, margin, 0, 0);
- contentView.setViewPadding(R.id.line3, 0, 0, 0, margin);
- }
-
boolean showLine3 = false;
boolean showLine2 = false;
- if (mPriority < PRIORITY_LOW) {
- // TODO: Low priority presentation
- }
if (profileIcon != null) {
contentView.setImageViewBitmap(R.id.profile_icon, profileIcon);
contentView.setViewVisibility(R.id.profile_icon, View.VISIBLE);
@@ -2666,15 +2654,12 @@
}
}
if (showLine2) {
- if (fitIn1U) {
- // need to shrink all the type to make sure everything fits
- final Resources res = mContext.getResources();
- final float subTextSize = res.getDimensionPixelSize(
- R.dimen.notification_subtext_size);
- contentView.setTextViewTextSize(R.id.text, TypedValue.COMPLEX_UNIT_PX, subTextSize);
- }
- // vertical centering
- contentView.setViewPadding(R.id.line1, 0, 0, 0, 0);
+
+ // need to shrink all the type to make sure everything fits
+ final Resources res = mContext.getResources();
+ final float subTextSize = res.getDimensionPixelSize(
+ R.dimen.notification_subtext_size);
+ contentView.setTextViewTextSize(R.id.text, TypedValue.COMPLEX_UNIT_PX, subTextSize);
}
if (mWhen != 0 && mShowWhen) {
@@ -2691,13 +2676,51 @@
contentView.setViewVisibility(R.id.time, View.GONE);
}
+ // Adjust padding depending on line count and font size.
+ contentView.setViewPadding(R.id.line1, 0, calculateTopPadding(mContext,
+ hasThreeLines(), mContext.getResources().getConfiguration().fontScale),
+ 0, 0);
+
contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE);
contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE);
return contentView;
}
+ /**
+ * Logic to find out whether the notification is going to have three lines in the contracted
+ * layout. This is used to adjust the top padding.
+ *
+ * @return true if the notification is going to have three lines; false if the notification
+ * is going to have one or two lines
+ */
+ private boolean hasThreeLines() {
+ boolean hasLine3 = mContentText != null || mContentInfo != null || mNumber > 0;
+ boolean hasLine2 = (mSubText != null && mContentText != null) ||
+ (mSubText == null && (mProgressMax != 0 || mProgressIndeterminate));
+ return hasLine2 && hasLine3;
+ }
+
+ /**
+ * @hide
+ */
+ public static int calculateTopPadding(Context ctx, boolean hasThreeLines,
+ float fontScale) {
+ int padding = ctx.getResources().getDimensionPixelSize(hasThreeLines
+ ? R.dimen.notification_top_pad_narrow
+ : R.dimen.notification_top_pad);
+ int largePadding = ctx.getResources().getDimensionPixelSize(hasThreeLines
+ ? R.dimen.notification_top_pad_large_text_narrow
+ : R.dimen.notification_top_pad_large_text);
+ float largeFactor = (MathUtils.constrain(fontScale, 1.0f, LARGE_TEXT_SCALE) - 1f)
+ / (LARGE_TEXT_SCALE - 1f);
+
+ // Linearly interpolate the padding between large and normal with the font scale ranging
+ // from 1f to LARGE_TEXT_SCALE
+ return Math.round((1 - largeFactor) * padding + largeFactor * largePadding);
+ }
+
private RemoteViews applyStandardTemplateWithActions(int layoutId) {
- RemoteViews big = applyStandardTemplate(layoutId, false);
+ RemoteViews big = applyStandardTemplate(layoutId);
int N = mActions.size();
if (N > 0) {
@@ -2717,7 +2740,7 @@
if (mContentView != null) {
return mContentView;
} else {
- return applyStandardTemplate(getBaseLayoutResource(), true); // no more special large_icon flavor
+ return applyStandardTemplate(getBaseLayoutResource());
}
}
@@ -2810,7 +2833,7 @@
*/
private void applyLargeIconBackground(RemoteViews contentView) {
contentView.setInt(R.id.icon, "setBackgroundResource",
- R.drawable.notification_icon_legacy_bg_inset);
+ R.drawable.notification_icon_legacy_bg);
contentView.setDrawableParameters(
R.id.icon,
@@ -2819,6 +2842,10 @@
resolveColor(),
PorterDuff.Mode.SRC_ATOP,
-1);
+
+ int padding = mContext.getResources().getDimensionPixelSize(
+ R.dimen.notification_large_icon_circle_padding);
+ contentView.setViewPadding(R.id.icon, padding, padding, padding, padding);
}
private void removeLargeIconBackground(RemoteViews contentView) {
@@ -3234,7 +3261,7 @@
}
private int getBigTextLayoutResource() {
- return getBigBaseLayoutResource();
+ return R.layout.notification_template_material_big_text;
}
private int getInboxLayoutResource() {
@@ -3328,6 +3355,19 @@
}
/**
+ * Changes the padding of the first line such that the big and small content view have the
+ * same top padding.
+ *
+ * @hide
+ */
+ protected void applyTopPadding(RemoteViews contentView) {
+ int topPadding = Builder.calculateTopPadding(mBuilder.mContext,
+ mBuilder.hasThreeLines(),
+ mBuilder.mContext.getResources().getConfiguration().fontScale);
+ contentView.setViewPadding(R.id.line1, 0, topPadding, 0, 0);
+ }
+
+ /**
* @hide
*/
public void addExtras(Bundle extras) {
@@ -3465,6 +3505,8 @@
contentView.setImageViewBitmap(R.id.big_picture, mPicture);
+ applyTopPadding(contentView);
+
return contentView;
}
@@ -3575,8 +3617,6 @@
}
private RemoteViews makeBigContentView() {
- // Remove the content text so line3 only shows if you have a summary
- final boolean hadThreeLines = (mBuilder.mContentText != null && mBuilder.mSubText != null);
// Nasty
CharSequence oldBuilderContentText = mBuilder.mContentText;
@@ -3586,15 +3626,12 @@
mBuilder.mContentText = oldBuilderContentText;
- if (hadThreeLines) {
- // vertical centering
- contentView.setViewPadding(R.id.line1, 0, 0, 0, 0);
- }
-
contentView.setTextViewText(R.id.big_text, mBuilder.processLegacyText(mBigText));
contentView.setViewVisibility(R.id.big_text, View.VISIBLE);
contentView.setViewVisibility(R.id.text2, View.GONE);
+ applyTopPadding(contentView);
+
return contentView;
}
@@ -3706,13 +3743,20 @@
contentView.setViewVisibility(rowId, View.GONE);
}
-
+ final boolean largeText =
+ mBuilder.mContext.getResources().getConfiguration().fontScale > 1f;
+ final float subTextSize = mBuilder.mContext.getResources().getDimensionPixelSize(
+ R.dimen.notification_subtext_size);
int i=0;
while (i < mTexts.size() && i < rowIds.length) {
CharSequence str = mTexts.get(i);
if (str != null && !str.equals("")) {
contentView.setViewVisibility(rowIds[i], View.VISIBLE);
contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str));
+ if (largeText) {
+ contentView.setTextViewTextSize(rowIds[i], TypedValue.COMPLEX_UNIT_PX,
+ subTextSize);
+ }
}
i++;
}
@@ -3723,6 +3767,8 @@
contentView.setViewVisibility(R.id.inbox_more,
mTexts.size() > rowIds.length ? View.VISIBLE : View.GONE);
+ applyTopPadding(contentView);
+
return contentView;
}
@@ -3876,7 +3922,7 @@
private RemoteViews makeMediaContentView() {
RemoteViews view = mBuilder.applyStandardTemplate(
- R.layout.notification_template_material_media, true /* 1U */);
+ R.layout.notification_template_material_media);
final int numActions = mBuilder.mActions.size();
final int N = mActionsToShowInCompact == null
@@ -3901,7 +3947,7 @@
private RemoteViews makeMediaBigContentView() {
RemoteViews big = mBuilder.applyStandardTemplate(
- R.layout.notification_template_material_big_media, false);
+ R.layout.notification_template_material_big_media);
final int N = Math.min(mBuilder.mActions.size(), MAX_MEDIA_BUTTONS);
if (N > 0) {
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index e14f497..8545e99 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -123,7 +123,7 @@
* application that started provisioning. The package will be set as profile owner in that case.
*
* <p>This package is set as device owner when device owner provisioning is started by an Nfc
- * message containing an Nfc record with MIME type {@link #PROVISIONING_NFC_MIME_TYPE}.
+ * message containing an Nfc record with MIME type {@link #MIME_TYPE_PROVISIONING_NFC}.
*/
public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
= "android.app.extra.deviceAdminPackageName";
@@ -155,7 +155,7 @@
* A String extra holding the time zone {@link android.app.AlarmManager} that the device
* will be set to.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_TIME_ZONE
@@ -165,7 +165,7 @@
* A Long extra holding the local time {@link android.app.AlarmManager} that the device
* will be set to.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_LOCAL_TIME
@@ -175,7 +175,7 @@
* A String extra holding the {@link java.util.Locale} that the device will be set to.
* Format: xx_yy, where xx is the language code, and yy the country code.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_LOCALE
@@ -185,7 +185,7 @@
* A String extra holding the ssid of the wifi network that should be used during nfc device
* owner provisioning for downloading the mobile device management application.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_SSID
@@ -195,7 +195,7 @@
* A boolean extra indicating whether the wifi network in {@link #EXTRA_PROVISIONING_WIFI_SSID}
* is hidden or not.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_HIDDEN
@@ -205,7 +205,7 @@
* A String extra indicating the security type of the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE
@@ -215,7 +215,7 @@
* A String extra holding the password of the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_PASSWORD
@@ -225,7 +225,7 @@
* A String extra holding the proxy host for the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_PROXY_HOST
@@ -235,7 +235,7 @@
* An int extra holding the proxy port for the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_PROXY_PORT
@@ -245,7 +245,7 @@
* A String extra holding the proxy bypass for the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_PROXY_BYPASS
@@ -255,7 +255,7 @@
* A String extra holding the proxy auto-config (PAC) URL for the wifi network in
* {@link #EXTRA_PROVISIONING_WIFI_SSID}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_WIFI_PAC_URL
@@ -265,7 +265,7 @@
* A String extra holding a url that specifies the download location of the device admin
* package. When not provided it is assumed that the device admin package is already installed.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION
@@ -275,7 +275,7 @@
* A String extra holding a http cookie header which should be used in the http request to the
* url specified in {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION}.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER
@@ -287,7 +287,7 @@
* the file at the download location an error will be shown to the user and the user will be
* asked to factory reset the device.
*
- * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * <p>Use in an Nfc record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner
* provisioning via an Nfc bump.
*/
public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM
@@ -335,7 +335,7 @@
* <p>Input: Nothing.</p>
* <p>Output: Nothing</p>
*/
- public static final String PROVISIONING_NFC_MIME_TYPE
+ public static final String MIME_TYPE_PROVISIONING_NFC
= "application/com.android.managedprovisioning";
/**
@@ -2646,6 +2646,161 @@
}
/**
+ * Called by a profile or device owner to set the permitted accessibility services. When
+ * set by a device owner or profile owner the restriction applies to all profiles of the
+ * user the device owner or profile owner is an admin for.
+ *
+ * By default the user can use any accessiblity service. When zero or more packages have
+ * been added, accessiblity services that are not in the list and not part of the system
+ * can not be enabled by the user.
+ *
+ * <p> Calling with a null value for the list disables the restriction so that all services
+ * can be used, calling with an empty list only allows the builtin system's services.
+ *
+ * <p> System accesibility services are always available to the user the list can't modify
+ * this.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
+ * @param packageNames List of accessibility service package names.
+ *
+ * @return true if setting the restriction succeeded. It fail if there is
+ * one or more non-system accessibility services enabled, that are not in the list.
+ */
+ public boolean setPermittedAccessibilityServices(ComponentName admin,
+ List<String> packageNames) {
+ if (mService != null) {
+ try {
+ return mService.setPermittedAccessibilityServices(admin, packageNames);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the list of permitted accessibility services set by this device or profile owner.
+ *
+ * <p>An empty list means no accessibility services except system services are allowed.
+ * Null means all accessibility services are allowed.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
+ * @return List of accessiblity service package names.
+ */
+ public List<String> getPermittedAccessibilityServices(ComponentName admin) {
+ if (mService != null) {
+ try {
+ return mService.getPermittedAccessibilityServices(admin);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the list of accessibility services permitted by the device or profiles
+ * owners of this user.
+ *
+ * <p>Null means all accessibility services are allowed, if a non-null list is returned
+ * it will contain the intersection of the permitted lists for any device or profile
+ * owners that apply to this user. It will also include any system accessibility services.
+ *
+ * @param userId which user to check for.
+ * @return List of accessiblity service package names.
+ * @hide
+ */
+ @SystemApi
+ public List<String> getPermittedAccessibilityServices(int userId) {
+ if (mService != null) {
+ try {
+ return mService.getPermittedAccessibilityServicesForUser(userId);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Called by a profile or device owner to set the permitted input methods services. When
+ * set by a device owner or profile owner the restriction applies to all profiles of the
+ * user the device owner or profile owner is an admin for.
+ *
+ * By default the user can use any input method. When zero or more packages have
+ * been added, input method that are not in the list and not part of the system
+ * can not be enabled by the user.
+ *
+ * This method will fail if it is called for a admin that is not for the foreground user
+ * or a profile of the foreground user.
+ *
+ * <p> Calling with a null value for the list disables the restriction so that all input methods
+ * can be used, calling with an empty list disables all but the system's own input methods.
+ *
+ * <p> System input methods are always available to the user this method can't modify this.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
+ * @param packageNames List of input method package names.
+ * @return true if setting the restriction succeeded. It will fail if there is
+ * one or more input method enabled, that are not in the list or user if the foreground
+ * user.
+ */
+ public boolean setPermittedInputMethods(ComponentName admin, List<String> packageNames) {
+ if (mService != null) {
+ try {
+ return mService.setPermittedInputMethods(admin, packageNames);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Returns the list of permitted input methods set by this device or profile owner.
+ *
+ * <p>An empty list means no input methods except system input methods are allowed.
+ * Null means all input methods are allowed.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
+ * @return List of input method package names.
+ */
+ public List<String> getPermittedInputMethods(ComponentName admin) {
+ if (mService != null) {
+ try {
+ return mService.getPermittedInputMethods(admin);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the list of input methods permitted by the device or profiles
+ * owners of the current user.
+ *
+ * <p>Null means all input methods are allowed, if a non-null list is returned
+ * it will contain the intersection of the permitted lists for any device or profile
+ * owners that apply to this user. It will also include any system input methods.
+ *
+ * @return List of input method package names.
+ * @hide
+ */
+ @SystemApi
+ public List<String> getPermittedInputMethodsForCurrentUser() {
+ if (mService != null) {
+ try {
+ return mService.getPermittedInputMethodsForCurrentUser();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return null;
+ }
+
+ /**
* Called by a device owner to create a user with the specified name. The UserHandle returned
* by this method should not be persisted as user handles are recycled as users are removed and
* created. If you need to persist an identifier for this user, use
@@ -2826,28 +2981,6 @@
}
/**
- * Called by profile or device owner to hide or unhide currently installed packages. This
- * should only be called by a profile or device owner running within a managed profile.
- *
- * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
- * @param intent An intent matching the app(s) to be updated. All apps that resolve for this
- * intent will be updated in the current profile.
- * @param hidden {@code true} if the packages should be hidden, {@code false} if they should
- * be unhidden.
- * @return int The number of activities that matched the intent and were updated.
- */
- public int setApplicationsHidden(ComponentName admin, Intent intent, boolean hidden) {
- if (mService != null) {
- try {
- return mService.setApplicationsHidden(admin, intent, hidden);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
- }
- }
- return 0;
- }
-
- /**
* Called by device or profile owner to determine if a package is hidden.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
@@ -3113,12 +3246,13 @@
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param packageName package to change.
- * @param blockUninstall true if the user shouldn't be able to uninstall the package.
+ * @param uninstallBlocked true if the user shouldn't be able to uninstall the package.
*/
- public void setBlockUninstall(ComponentName admin, String packageName, boolean blockUninstall) {
+ public void setUninstallBlocked(ComponentName admin, String packageName,
+ boolean uninstallBlocked) {
if (mService != null) {
try {
- mService.setBlockUninstall(admin, packageName, blockUninstall);
+ mService.setUninstallBlocked(admin, packageName, uninstallBlocked);
} catch (RemoteException re) {
Log.w(TAG, "Failed to call block uninstall on device policy service");
}
@@ -3133,10 +3267,10 @@
* @param packageName package to check.
* @return true if the user shouldn't be able to uninstall the package.
*/
- public boolean getBlockUninstall(ComponentName admin, String packageName) {
+ public boolean getUninstallBlocked(ComponentName admin, String packageName) {
if (mService != null) {
try {
- return mService.getBlockUninstall(admin, packageName);
+ return mService.getUninstallBlocked(admin, packageName);
} catch (RemoteException re) {
Log.w(TAG, "Failed to call block uninstall on device policy service");
}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index 324b963..1e17bb6 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -24,6 +24,7 @@
import android.os.Bundle;
import android.os.RemoteCallback;
import android.os.UserHandle;
+import java.util.List;
/**
* Internal IPC interface to the device policy service.
@@ -137,8 +138,15 @@
void addCrossProfileIntentFilter(in ComponentName admin, in IntentFilter filter, int flags);
void clearCrossProfileIntentFilters(in ComponentName admin);
+ boolean setPermittedAccessibilityServices(in ComponentName admin,in List packageList);
+ List getPermittedAccessibilityServices(in ComponentName admin);
+ List getPermittedAccessibilityServicesForUser(int userId);
+
+ boolean setPermittedInputMethods(in ComponentName admin,in List packageList);
+ List getPermittedInputMethods(in ComponentName admin);
+ List getPermittedInputMethodsForCurrentUser();
+
boolean setApplicationHidden(in ComponentName admin, in String packageName, boolean hidden);
- int setApplicationsHidden(in ComponentName admin, in Intent intent, boolean hidden);
boolean isApplicationHidden(in ComponentName admin, in String packageName);
UserHandle createUser(in ComponentName who, in String name);
@@ -165,8 +173,8 @@
void notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId);
- void setBlockUninstall(in ComponentName admin, in String packageName, boolean blockUninstall);
- boolean getBlockUninstall(in ComponentName admin, in String packageName);
+ void setUninstallBlocked(in ComponentName admin, in String packageName, boolean uninstallBlocked);
+ boolean getUninstallBlocked(in ComponentName admin, in String packageName);
void setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled);
boolean getCrossProfileCallerIdDisabled(in ComponentName who);
diff --git a/core/java/android/text/style/TtsSpan.java b/core/java/android/text/style/TtsSpan.java
index cb447fd..342a183 100644
--- a/core/java/android/text/style/TtsSpan.java
+++ b/core/java/android/text/style/TtsSpan.java
@@ -26,10 +26,14 @@
/**
* A span that supplies additional meta-data for the associated text intended
- * for text-to-speech engines. If the text is being processed by a
+ * for text-to-speech engines. If the text is being processed by a
* text-to-speech engine, the engine may use the data in this span in addition
* to or instead of its associated text.
*
+ * Each instance of a TtsSpan has a type, for example {@link #TYPE_DATE}
+ * or {@link #TYPE_MEASURE}. And a list of arguments, provided as
+ * key-value pairs in a bundle.
+ *
* The inner classes are there for convenience and provide builders for each
* TtsSpan type.
*/
@@ -39,7 +43,7 @@
/**
* This span type can be used to add morphosyntactic features to the text it
- * spans over, or synthesize a something else than the spanned text. Use
+ * spans over, or synthesize a something else than the spanned text. Use
* the argument {@link #ARG_TEXT} to set a different text.
* Accepts the arguments {@link #ARG_GENDER},
* {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
@@ -48,7 +52,7 @@
public static final String TYPE_TEXT = "android.type.text";
/**
- * The text associated with this span is a cardinal. Must include the
+ * The text associated with this span is a cardinal. Must include the
* number to be synthesized with {@link #ARG_NUMBER}.
* Also accepts the arguments {@link #ARG_GENDER},
* {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
@@ -108,12 +112,12 @@
public static final String TYPE_TIME = "android.type.time";
/**
- * The text associated with this span is a date. All arguments are optional,
- * but at least one has to be provided: {@link #ARG_WEEKDAY},
- * {@link #ARG_DAY}, {@link #ARG_MONTH} and {@link #ARG_YEAR}.
- * Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * The text associated with this span is a date. At least one of the
+ * arguments {@link #ARG_MONTH} and {@link #ARG_YEAR} has to be provided.
+ * The argument {@link #ARG_DAY} is optional if {@link #ARG_MONTH} is set.
+ * The argument {@link #ARG_WEEKDAY} is optional if {@link #ARG_DAY} is set.
+ * Also accepts the arguments {@link #ARG_GENDER}, {@link #ARG_ANIMACY},
+ * {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_DATE = "android.type.date";
@@ -121,13 +125,11 @@
* The text associated with this span is a telephone number. The argument
* {@link #ARG_NUMBER_PARTS} is required. {@link #ARG_COUNTRY_CODE} and
* {@link #ARG_EXTENSION} are optional.
- * Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * Also accepts the arguments {@link #ARG_GENDER}, {@link #ARG_ANIMACY},
+ * {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_TELEPHONE = "android.type.telephone";
-
/**
* The text associated with this span is a URI (can be used for URLs and
* email addresses). The full schema for URLs, which email addresses can
@@ -138,9 +140,8 @@
* {@link #ARG_PROTOCOL}, {@link #ARG_USERNAME}, {@link #ARG_PASSWORD},
* {@link #ARG_DOMAIN}, {@link #ARG_PORT}, {@link #ARG_PATH},
* {@link #ARG_QUERY_STRING} and {@link #ARG_FRAGMENT_ID}.
- * Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * Also accepts the arguments {@link #ARG_GENDER}, {@link #ARG_ANIMACY},
+ * {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_ELECTRONIC = "android.type.electronic";
@@ -149,18 +150,16 @@
* with the same arguments as {@link #TYPE_DECIMAL}.
* {@link #ARG_CURRENCY} is used to set the currency. {@link #ARG_QUANTITY}
* is optional.
- * Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * Also accepts the arguments {@link #ARG_GENDER}, {@link #ARG_ANIMACY},
+ * {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_MONEY = "android.type.money";
/**
* The text associated with this span is a series of digits that have to be
- * read sequentially. {@link #ARG_DIGITS} is required.
- * Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * read sequentially. The digits can be set with {@link #ARG_DIGITS}.
+ * Also accepts the arguments {@link #ARG_GENDER}, {@link #ARG_ANIMACY},
+ * {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_DIGITS = "android.type.digits";
@@ -169,13 +168,12 @@
* be read verbatim. The engine will attempt to ready out any character like
* punctuation but excluding whitespace. {@link #ARG_VERBATIM} is required.
* Also accepts the arguments {@link #ARG_GENDER},
- * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
- * {@link #ARG_CASE}.
+ * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}.
*/
public static final String TYPE_VERBATIM = "android.type.verbatim";
/**
- * String argument supplying gender information. Can be any of
+ * String argument supplying gender information. Can be any of
* {@link #GENDER_NEUTRAL}, {@link #GENDER_MALE} and
* {@link #GENDER_FEMALE}.
*/
@@ -186,7 +184,7 @@
public static final String GENDER_FEMALE = "android.female";
/**
- * String argument supplying animacy information. Can be
+ * String argument supplying animacy information. Can be
* {@link #ANIMACY_ANIMATE} or
* {@link #ANIMACY_INANIMATE}
*/
@@ -196,9 +194,8 @@
public static final String ANIMACY_INANIMATE = "android.inanimate";
/**
- * String argument supplying multiplicity information. Can be any of
- * {@link #MULTIPLICITY_SINGLE},
- * {@link #MULTIPLICITY_DUAL} and
+ * String argument supplying multiplicity information. Can be any of
+ * {@link #MULTIPLICITY_SINGLE}, {@link #MULTIPLICITY_DUAL} and
* {@link #MULTIPLICITY_PLURAL}
*/
public static final String ARG_MULTIPLICITY = "android.arg.multiplicity";
@@ -208,16 +205,14 @@
public static final String MULTIPLICITY_PLURAL = "android.plural";
/**
- * String argument supplying case information. Can be any of
- * {@link #CASE_NOMINATIVE}, {@link #CASE_ACCUSATIVE},
- * {@link #CASE_DATIVE}, {@link #CASE_ABLATIVE},
- * {@link #CASE_GENITIVE}, {@link #CASE_VOCATIVE},
- * {@link #CASE_LOCATIVE} and
- * {@link #CASE_INSTRUMENTAL}
+ * String argument supplying case information. Can be any of
+ * {@link #CASE_NOMINATIVE}, {@link #CASE_ACCUSATIVE}, {@link #CASE_DATIVE},
+ * {@link #CASE_ABLATIVE}, {@link #CASE_GENITIVE}, {@link #CASE_VOCATIVE},
+ * {@link #CASE_LOCATIVE} and {@link #CASE_INSTRUMENTAL}
*/
public static final String ARG_CASE = "android.arg.case";
- public static final String CASE_NOMINATIVE = "android.nomative";
+ public static final String CASE_NOMINATIVE = "android.nominative";
public static final String CASE_ACCUSATIVE = "android.accusative";
public static final String CASE_DATIVE = "android.dative";
public static final String CASE_ABLATIVE = "android.ablative";
@@ -227,14 +222,14 @@
public static final String CASE_INSTRUMENTAL = "android.instrumental";
/**
- * String supplying the text to be synthesized. The synthesizer is free
+ * String supplying the text to be synthesized. The synthesizer is free
* to decide how to interpret the text.
* Can be used with {@link #TYPE_TEXT}.
*/
public static final String ARG_TEXT = "android.arg.text";
/**
- * Argument used to specify a whole number. The value can be a string of
+ * Argument used to specify a whole number. The value can be a string of
* digits of any size optionally prefixed with a - or +.
* Can be used with {@link #TYPE_CARDINAL} and {@link #TYPE_ORDINAL}.
*/
@@ -293,7 +288,7 @@
* specified in English singular form. Prefixes may be used. Engines will do
* their best to pronounce them correctly in the language used. Engines are
* expected to at least support the most common ones like "meter", "second",
- * "degree celcius" and "degree fahrenheit" with some common prefixes like
+ * "degree celsius" and "degree fahrenheit" with some common prefixes like
* "milli" and "kilo".
* Can be used with {@link #TYPE_MEASURE}.
*/
@@ -589,8 +584,8 @@
/**
* Sets the gender information for this instance.
- * @param gender Can any of {@link TtsSpan#GENDER_NEUTRAL},
- * {@link TtsSpan#GENDER_MALE} and {@link TtsSpan#GENDER_FEMALE}.
+ * @param gender Can any of {@link #GENDER_NEUTRAL},
+ * {@link #GENDER_MALE} and {@link #GENDER_FEMALE}.
* @return This instance.
*/
public C setGender(String gender) {
@@ -599,8 +594,8 @@
/**
* Sets the animacy information for this instance.
- * @param animacy Can be any of {@link TtsSpan#ANIMACY_ANIMATE} and
- * {@link TtsSpan#ANIMACY_INANIMATE}.
+ * @param animacy Can be any of {@link #ANIMACY_ANIMATE} and
+ * {@link #ANIMACY_INANIMATE}.
* @return This instance.
*/
public C setAnimacy(String animacy) {
@@ -610,9 +605,8 @@
/**
* Sets the multiplicity information for this instance.
* @param multiplicity Can be any of
- * {@link TtsSpan#MULTIPLICITY_SINGLE},
- * {@link TtsSpan#MULTIPLICITY_DUAL} and
- * {@link TtsSpan#MULTIPLICITY_PLURAL}.
+ * {@link #MULTIPLICITY_SINGLE}, {@link #MULTIPLICITY_DUAL} and
+ * {@link #MULTIPLICITY_PLURAL}.
* @return This instance.
*/
public C setMultiplicity(String multiplicity) {
@@ -621,11 +615,11 @@
/**
* Sets the grammatical case information for this instance.
- * @param grammaticalCase Can be any of {@link TtsSpan#CASE_NOMINATIVE},
- * {@link TtsSpan#CASE_ACCUSATIVE}, {@link TtsSpan#CASE_DATIVE},
- * {@link TtsSpan#CASE_ABLATIVE}, {@link TtsSpan#CASE_GENITIVE},
- * {@link TtsSpan#CASE_VOCATIVE}, {@link TtsSpan#CASE_LOCATIVE} and
- * {@link TtsSpan#CASE_INSTRUMENTAL}.
+ * @param grammaticalCase Can be any of {@link #CASE_NOMINATIVE},
+ * {@link #CASE_ACCUSATIVE}, {@link #CASE_DATIVE},
+ * {@link #CASE_ABLATIVE}, {@link #CASE_GENITIVE},
+ * {@link #CASE_VOCATIVE}, {@link #CASE_LOCATIVE} and
+ * {@link #CASE_INSTRUMENTAL}.
* @return This instance.
*/
public C setCase(String grammaticalCase) {
@@ -634,20 +628,20 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_TEXT}.
+ * A builder for TtsSpans of type {@link #TYPE_TEXT}.
*/
public static class TextBuilder extends SemioticClassBuilder<TextBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TEXT}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_TEXT}.
*/
public TextBuilder() {
super(TtsSpan.TYPE_TEXT);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_TEXT} and sets the
- * {@link TtsSpan#ARG_TEXT} argument.
+ * Creates a TtsSpan of type {@link #TYPE_TEXT} and sets the
+ * {@link #ARG_TEXT} argument.
* @param text The text to be synthesized.
* @see #setText(String)
*/
@@ -657,8 +651,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_TEXT} argument, the text to be
- * synthesized.
+ * Sets the {@link #ARG_TEXT} argument, the text to be synthesized.
* @param text The string that will be synthesized.
* @return This instance.
*/
@@ -668,22 +661,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_CARDINAL}.
+ * A builder for TtsSpans of type {@link #TYPE_CARDINAL}.
*/
public static class CardinalBuilder
extends SemioticClassBuilder<CardinalBuilder> {
/**
- * Creates a builder for a TtsSpan of type
- * {@link TtsSpan#TYPE_CARDINAL}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_CARDINAL}.
*/
public CardinalBuilder() {
super(TtsSpan.TYPE_CARDINAL);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_CARDINAL} and sets the
- * {@link TtsSpan#ARG_NUMBER} argument.
+ * Creates a TtsSpan of type {@link #TYPE_CARDINAL} and sets the
+ * {@link #ARG_NUMBER} argument.
* @param number The number to synthesize.
* @see #setNumber(long)
*/
@@ -693,8 +685,8 @@
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_CARDINAL} and sets the
- * {@link TtsSpan#ARG_NUMBER} argument.
+ * Creates a TtsSpan of type {@link #TYPE_CARDINAL} and sets the
+ * {@link #ARG_NUMBER} argument.
* @param number The number to synthesize.
* @see #setNumber(String)
*/
@@ -705,7 +697,7 @@
/**
* Convenience method that converts the number to a String and set it to
- * the value for {@link TtsSpan#ARG_NUMBER}.
+ * the value for {@link #ARG_NUMBER}.
* @param number The number that will be synthesized.
* @return This instance.
*/
@@ -714,7 +706,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMBER} argument.
+ * Sets the {@link #ARG_NUMBER} argument.
* @param number A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -725,21 +717,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan#TYPE_ORDINAL}.
+ * A builder for TtsSpans of type {@link #TYPE_ORDINAL}.
*/
public static class OrdinalBuilder
extends SemioticClassBuilder<OrdinalBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_ORDINAL}.
*/
public OrdinalBuilder() {
super(TtsSpan.TYPE_ORDINAL);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL} and sets the
- * {@link TtsSpan#ARG_NUMBER} argument.
+ * Creates a TtsSpan of type {@link #TYPE_ORDINAL} and sets the
+ * {@link #ARG_NUMBER} argument.
* @param number The ordinal number to synthesize.
* @see #setNumber(long)
*/
@@ -749,8 +741,8 @@
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL} and sets the
- * {@link TtsSpan#ARG_NUMBER} argument.
+ * Creates a TtsSpan of type {@link #TYPE_ORDINAL} and sets the
+ * {@link #ARG_NUMBER} argument.
* @param number The number to synthesize.
* @see #setNumber(String)
*/
@@ -761,7 +753,7 @@
/**
* Convenience method that converts the number to a String and sets it
- * to the value for {@link TtsSpan#ARG_NUMBER}.
+ * to the value for {@link #ARG_NUMBER}.
* @param number The ordinal number that will be synthesized.
* @return This instance.
*/
@@ -770,7 +762,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMBER} argument.
+ * Sets the {@link #ARG_NUMBER} argument.
* @param number A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -781,22 +773,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan#TYPE_DECIMAL}.
+ * A builder for TtsSpans of type {@link #TYPE_DECIMAL}.
*/
public static class DecimalBuilder
extends SemioticClassBuilder<DecimalBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_DECIMAL}.
*/
public DecimalBuilder() {
super(TtsSpan.TYPE_DECIMAL);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL} and sets the
- * {@link TtsSpan#ARG_INTEGER_PART} and
- * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ * Creates a TtsSpan of type {@link #TYPE_DECIMAL} and sets the
+ * {@link #ARG_INTEGER_PART} and {@link #ARG_FRACTIONAL_PART} arguments.
* @see {@link #setArgumentsFromDouble(double, int, int)
*/
public DecimalBuilder(double number,
@@ -809,9 +800,8 @@
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL} and sets the
- * {@link TtsSpan#ARG_INTEGER_PART} and
- * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ * Creates a TtsSpan of type {@link #TYPE_DECIMAL} and sets the
+ * {@link #ARG_INTEGER_PART} and {@link #ARG_FRACTIONAL_PART} arguments.
*/
public DecimalBuilder(String integerPart, String fractionalPart) {
this();
@@ -821,8 +811,8 @@
/**
* Convenience method takes a double and a maximum number of fractional
- * digits, it sets the {@link TtsSpan#ARG_INTEGER_PART} and
- * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ * digits, it sets the {@link #ARG_INTEGER_PART} and
+ * {@link #ARG_FRACTIONAL_PART} arguments.
* @param number The number to be synthesized.
* @param minimumFractionDigits The minimum number of fraction digits
* that are pronounced.
@@ -856,7 +846,7 @@
/**
* Convenience method that converts the number to a String and sets it
- * to the value for {@link TtsSpan#ARG_INTEGER_PART}.
+ * to the value for {@link #ARG_INTEGER_PART}.
* @param integerPart The integer part of the decimal.
* @return This instance.
*/
@@ -865,7 +855,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * Sets the {@link #ARG_INTEGER_PART} argument.
* @param integerPart A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -875,7 +865,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_FRACTIONAL_PART} argument.
+ * Sets the {@link #ARG_FRACTIONAL_PART} argument.
* @param fractionalPart A non-empty string of digits.
* @return This instance.
*/
@@ -886,23 +876,22 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan#TYPE_FRACTION}.
+ * A builder for TtsSpans of type {@link #TYPE_FRACTION}.
*/
public static class FractionBuilder
extends SemioticClassBuilder<FractionBuilder> {
/**
- * Creates a builder for a TtsSpan of type
- * {@link TtsSpan#TYPE_FRACTION}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_FRACTION}.
*/
public FractionBuilder() {
super(TtsSpan.TYPE_FRACTION);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_FRACTION} and sets the
- * {@link TtsSpan#ARG_INTEGER_PART}, {@link TtsSpan#ARG_NUMERATOR}, and
- * {@link TtsSpan#ARG_DENOMINATOR} arguments.
+ * Creates a TtsSpan of type {@link #TYPE_FRACTION} and sets the
+ * {@link #ARG_INTEGER_PART}, {@link #ARG_NUMERATOR}, and
+ * {@link #ARG_DENOMINATOR} arguments.
*/
public FractionBuilder(long integerPart,
long numerator,
@@ -913,10 +902,9 @@
setDenominator(denominator);
}
-
/**
* Convenience method that converts the integer to a String and sets the
- * argument {@link TtsSpan#ARG_NUMBER}.
+ * argument {@link #ARG_NUMBER}.
* @param integerPart The integer part.
* @return This instance.
*/
@@ -925,7 +913,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * Sets the {@link #ARG_INTEGER_PART} argument.
* @param integerPart A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -936,7 +924,7 @@
/**
* Convenience method that converts the numerator to a String and sets
- * the argument {@link TtsSpan#ARG_NUMERATOR}.
+ * the argument {@link #ARG_NUMERATOR}.
* @param numerator The numerator.
* @return This instance.
*/
@@ -945,7 +933,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMERATOR} argument.
+ * Sets the {@link #ARG_NUMERATOR} argument.
* @param numerator A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -956,7 +944,7 @@
/**
* Convenience method that converts the denominator to a String and sets
- * the argument {@link TtsSpan#ARG_DENOMINATOR}.
+ * the argument {@link #ARG_DENOMINATOR}.
* @param denominator The denominator.
* @return This instance.
*/
@@ -965,7 +953,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_DENOMINATOR} argument.
+ * Sets the {@link #ARG_DENOMINATOR} argument.
* @param denominator A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -976,13 +964,13 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_MEASURE}.
+ * A builder for TtsSpans of type {@link #TYPE_MEASURE}.
*/
public static class MeasureBuilder
extends SemioticClassBuilder<MeasureBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_MEASURE}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_MEASURE}.
*/
public MeasureBuilder() {
super(TtsSpan.TYPE_MEASURE);
@@ -990,7 +978,7 @@
/**
* Convenience method that converts the number to a String and set it to
- * the value for {@link TtsSpan#ARG_NUMBER}.
+ * the value for {@link #ARG_NUMBER}.
* @param number The amount of the measure.
* @return This instance.
*/
@@ -999,7 +987,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMBER} argument.
+ * Sets the {@link #ARG_NUMBER} argument.
* @param number A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -1010,7 +998,7 @@
/**
* Convenience method that converts the integer part to a String and set
- * it to the value for {@link TtsSpan#ARG_INTEGER_PART}.
+ * it to the value for {@link #ARG_INTEGER_PART}.
* @param integerPart The integer part of a decimal or fraction.
* @return This instance.
*/
@@ -1019,7 +1007,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * Sets the {@link #ARG_INTEGER_PART} argument.
* @param integerPart The integer part of a decimal or fraction; a
* non-empty string of digits with an optional
* leading + or -.
@@ -1030,10 +1018,9 @@
}
/**
- * Sets the {@link TtsSpan#ARG_FRACTIONAL_PART} argument.
+ * Sets the {@link #ARG_FRACTIONAL_PART} argument.
* @param fractionalPart The fractional part of a decimal; a non-empty
- * string of digits with an optional
- * leading + or -.
+ * string of digits with an optional leading + or -.
* @return This instance.
*/
public MeasureBuilder setFractionalPart(String fractionalPart) {
@@ -1043,7 +1030,7 @@
/**
* Convenience method that converts the numerator to a String and set it
- * to the value for {@link TtsSpan#ARG_NUMERATOR}.
+ * to the value for {@link #ARG_NUMERATOR}.
* @param numerator The numerator of a fraction.
* @return This instance.
*/
@@ -1052,7 +1039,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMERATOR} argument.
+ * Sets the {@link #ARG_NUMERATOR} argument.
* @param numerator The numerator of a fraction; a non-empty string of
* digits with an optional leading + or -.
* @return This instance.
@@ -1063,7 +1050,7 @@
/**
* Convenience method that converts the denominator to a String and set
- * it to the value for {@link TtsSpan#ARG_DENOMINATOR}.
+ * it to the value for {@link #ARG_DENOMINATOR}.
* @param denominator The denominator of a fraction.
* @return This instance.
*/
@@ -1072,7 +1059,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_DENOMINATOR} argument.
+ * Sets the {@link #ARG_DENOMINATOR} argument.
* @param denominator The denominator of a fraction; a non-empty string
* of digits with an optional leading + or -.
* @return This instance.
@@ -1082,7 +1069,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_UNIT} argument.
+ * Sets the {@link #ARG_UNIT} argument.
* @param unit The unit of the measure.
* @return This instance.
* @see {@link TtsSpan.ARG_UNIT}
@@ -1093,22 +1080,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_TIME}.
+ * A builder for TtsSpans of type {@link #TYPE_TIME}.
*/
public static class TimeBuilder
extends SemioticClassBuilder<TimeBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_TIME}.
*/
public TimeBuilder() {
super(TtsSpan.TYPE_TIME);
}
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME} and
- * sets the {@link TtsSpan#ARG_HOURS} and {@link TtsSpan#ARG_MINUTES}
- * arguments.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_TIME} and
+ * sets the {@link #ARG_HOURS} and {@link #ARG_MINUTES} arguments.
*/
public TimeBuilder(int hours, int minutes) {
this();
@@ -1117,22 +1103,21 @@
}
/**
- * Sets the {@link TtsSpan#ARG_HOURS} argument.
- * @param hours The value to be set for hours. See
- * {@link TtsSpan#ARG_HOURS}.
+ * Sets the {@link #ARG_HOURS} argument.
+ * @param hours The value to be set for hours. See {@link #ARG_HOURS}.
* @return This instance.
- * @see {@link TtsSpan#ARG_HOURS}
+ * @see {@link #ARG_HOURS}
*/
public TimeBuilder setHours(int hours) {
return setIntArgument(TtsSpan.ARG_HOURS, hours);
}
/**
- * Sets the {@link TtsSpan#ARG_MINUTES} argument.
+ * Sets the {@link #ARG_MINUTES} argument.
* @param minutes The value to be set for minutes. See
- * {@link TtsSpan#ARG_MINUTES}.
+ * {@link #ARG_MINUTES}.
* @return This instance.
- * @see {@link TtsSpan#ARG_MINUTES}
+ * @see {@link #ARG_MINUTES}
*/
public TimeBuilder setMinutes(int minutes) {
return setIntArgument(TtsSpan.ARG_MINUTES, minutes);
@@ -1140,24 +1125,23 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_DATE}.
+ * A builder for TtsSpans of type {@link #TYPE_DATE}.
*/
public static class DateBuilder
extends SemioticClassBuilder<DateBuilder> {
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DATE}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_DATE}.
*/
public DateBuilder() {
super(TtsSpan.TYPE_DATE);
}
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME} and
- * possibly sets the {@link TtsSpan#ARG_WEEKDAY},
- * {@link TtsSpan#ARG_DAY}, {@link TtsSpan#ARG_MONTH} and
- * {@link TtsSpan#ARG_YEAR} arguments. Pass null to any argument to
- * leave it unset.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_TIME} and
+ * possibly sets the {@link #ARG_WEEKDAY}, {@link #ARG_DAY},
+ * {@link #ARG_MONTH} and {@link #ARG_YEAR} arguments. Pass null to any
+ * argument to leave it unset.
*/
public DateBuilder(Integer weekday,
Integer day,
@@ -1179,44 +1163,41 @@
}
/**
- * Sets the {@link TtsSpan#ARG_WEEKDAY} argument.
+ * Sets the {@link #ARG_WEEKDAY} argument.
* @param weekday The value to be set for weekday. See
- * {@link TtsSpan#ARG_WEEKDAY}.
+ * {@link #ARG_WEEKDAY}.
* @return This instance.
- * @see {@link TtsSpan#ARG_WEEKDAY}
+ * @see {@link #ARG_WEEKDAY}
*/
public DateBuilder setWeekday(int weekday) {
return setIntArgument(TtsSpan.ARG_WEEKDAY, weekday);
}
/**
- * Sets the {@link TtsSpan#ARG_DAY} argument.
- * @param day The value to be set for day. See
- * {@link TtsSpan#ARG_DAY}.
+ * Sets the {@link #ARG_DAY} argument.
+ * @param day The value to be set for day. See {@link #ARG_DAY}.
* @return This instance.
- * @see {@link TtsSpan#ARG_DAY}
+ * @see {@link #ARG_DAY}
*/
public DateBuilder setDay(int day) {
return setIntArgument(TtsSpan.ARG_DAY, day);
}
/**
- * Sets the {@link TtsSpan#ARG_MONTH} argument.
- * @param month The value to be set for month. See
- * {@link TtsSpan#ARG_MONTH}.
+ * Sets the {@link #ARG_MONTH} argument.
+ * @param month The value to be set for month. See {@link #ARG_MONTH}.
* @return This instance.
- * @see {@link TtsSpan#ARG_MONTH}
+ * @see {@link #ARG_MONTH}
*/
public DateBuilder setMonth(int month) {
return setIntArgument(TtsSpan.ARG_MONTH, month);
}
/**
- * Sets the {@link TtsSpan#ARG_YEAR} argument.
- * @param year The value to be set for year. See
- * {@link TtsSpan#ARG_YEAR}.
+ * Sets the {@link #ARG_YEAR} argument.
+ * @param year The value to be set for year. See {@link #ARG_YEAR}.
* @return This instance.
- * @see {@link TtsSpan#ARG_YEAR}
+ * @see {@link #ARG_YEAR}
*/
public DateBuilder setYear(int year) {
return setIntArgument(TtsSpan.ARG_YEAR, year);
@@ -1224,13 +1205,13 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_MONEY}.
+ * A builder for TtsSpans of type {@link #TYPE_MONEY}.
*/
public static class MoneyBuilder
extends SemioticClassBuilder<MoneyBuilder> {
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_MONEY}.
+ * Creates a TtsSpan of type {@link #TYPE_MONEY}.
*/
public MoneyBuilder() {
super(TtsSpan.TYPE_MONEY);
@@ -1238,7 +1219,7 @@
/**
* Convenience method that converts the number to a String and set it to
- * the value for {@link TtsSpan#ARG_INTEGER_PART}.
+ * the value for {@link #ARG_INTEGER_PART}.
* @param integerPart The integer part of the amount.
* @return This instance.
*/
@@ -1247,7 +1228,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * Sets the {@link #ARG_INTEGER_PART} argument.
* @param integerPart A non-empty string of digits with an optional
* leading + or -.
* @return This instance.
@@ -1257,7 +1238,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_FRACTIONAL_PART} argument.
+ * Sets the {@link #ARG_FRACTIONAL_PART} argument.
* @param fractionalPart Can be a string of digits of any size.
* @return This instance.
*/
@@ -1266,7 +1247,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_CURRENCY} argument.
+ * Sets the {@link #ARG_CURRENCY} argument.
* @param currency Should be a ISO4217 currency code, e.g. "USD".
* @return This instance.
*/
@@ -1275,7 +1256,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_QUANTITY} argument.
+ * Sets the {@link #ARG_QUANTITY} argument.
* @param quantity
* @return This instance.
*/
@@ -1285,21 +1266,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_TELEPHONE}.
+ * A builder for TtsSpans of type {@link #TYPE_TELEPHONE}.
*/
public static class TelephoneBuilder
extends SemioticClassBuilder<TelephoneBuilder> {
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_TELEPHONE}.
+ * Creates a TtsSpan of type {@link #TYPE_TELEPHONE}.
*/
public TelephoneBuilder() {
super(TtsSpan.TYPE_TELEPHONE);
}
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_TELEPHONE} and sets the
- * {@link TtsSpan#ARG_NUMBER_PARTS} argument.
+ * Creates a TtsSpan of type {@link #TYPE_TELEPHONE} and sets the
+ * {@link #ARG_NUMBER_PARTS} argument.
*/
public TelephoneBuilder(String numberParts) {
this();
@@ -1307,7 +1288,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_COUNTRY_CODE} argument.
+ * Sets the {@link #ARG_COUNTRY_CODE} argument.
* @param countryCode The country code can be a series of digits
* optionally prefixed with a "+".
* @return This instance.
@@ -1317,7 +1298,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_NUMBER_PARTS} argument.
+ * Sets the {@link #ARG_NUMBER_PARTS} argument.
* @param numberParts The main telephone number. Can be a series of
* digits and letters separated by spaces, "/", "-" or ".".
* @return This instance.
@@ -1327,7 +1308,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_EXTENSION} argument.
+ * Sets the {@link #ARG_EXTENSION} argument.
* @param extension The extension can be a series of digits.
* @return This instance.
*/
@@ -1337,20 +1318,20 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_ELECTRONIC}.
+ * A builder for TtsSpans of type {@link #TYPE_ELECTRONIC}.
*/
public static class ElectronicBuilder
extends SemioticClassBuilder<ElectronicBuilder> {
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_ELECTRONIC}.
+ * Creates a TtsSpan of type {@link #TYPE_ELECTRONIC}.
*/
public ElectronicBuilder() {
super(TtsSpan.TYPE_ELECTRONIC);
}
/**
- * Sets the {@link TtsSpan#ARG_USERNAME} and {@link TtsSpan#ARG_DOMAIN}
+ * Sets the {@link #ARG_USERNAME} and {@link #ARG_DOMAIN}
* arguments, representing an email address.
* @param username The part before the @ in the email address.
* @param domain The part after the @ in the email address.
@@ -1362,7 +1343,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_PROTOCOL} argument.
+ * Sets the {@link #ARG_PROTOCOL} argument.
* @param protocol The protocol of the URI. Examples are "http" and
* "ftp".
* @return This instance.
@@ -1372,7 +1353,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_USERNAME} argument.
+ * Sets the {@link #ARG_USERNAME} argument.
* @return This instance.
*/
public ElectronicBuilder setUsername(String username) {
@@ -1380,7 +1361,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_PASSWORD} argument.
+ * Sets the {@link #ARG_PASSWORD} argument.
* @return This instance.
*/
public ElectronicBuilder setPassword(String password) {
@@ -1388,7 +1369,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_DOMAIN} argument.
+ * Sets the {@link #ARG_DOMAIN} argument.
* @param domain The domain, for example "source.android.com".
* @return This instance.
*/
@@ -1397,7 +1378,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_PORT} argument.
+ * Sets the {@link #ARG_PORT} argument.
* @return This instance.
*/
public ElectronicBuilder setPort(int port) {
@@ -1405,7 +1386,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_PATH} argument.
+ * Sets the {@link #ARG_PATH} argument.
* @param path For example "source/index.html".
* @return This instance.
*/
@@ -1414,7 +1395,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_QUERY_STRING} argument.
+ * Sets the {@link #ARG_QUERY_STRING} argument.
* @param queryString For example "arg=value&argtwo=value".
* @return This instance.
*/
@@ -1423,7 +1404,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_FRAGMENT_ID} argument.
+ * Sets the {@link #ARG_FRAGMENT_ID} argument.
* @return This instance.
*/
public ElectronicBuilder setFragmentId(String fragmentId) {
@@ -1432,22 +1413,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_DIGITS}.
+ * A builder for TtsSpans of type {@link #TYPE_DIGITS}.
*/
public static class DigitsBuilder
extends SemioticClassBuilder<DigitsBuilder> {
/**
- * Creates a builder for a TtsSpan of type
- * {@link TtsSpan#TYPE_VERBATIM}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_DIGITS}.
*/
public DigitsBuilder() {
super(TtsSpan.TYPE_DIGITS);
}
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DIGITS}
- * and sets the {@link TtsSpan#ARG_DIGITS} argument.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_DIGITS}
+ * and sets the {@link #ARG_DIGITS} argument.
*/
public DigitsBuilder(String digits) {
this();
@@ -1455,7 +1435,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_DIGITS} argument.
+ * Sets the {@link #ARG_DIGITS} argument.
* @param digits A string of digits.
* @return This instance.
*/
@@ -1465,22 +1445,21 @@
}
/**
- * A builder for TtsSpans of type {@link TtsSpan #TYPE_VERBATIM}.
+ * A builder for TtsSpans of type {@link #TYPE_VERBATIM}.
*/
public static class VerbatimBuilder
extends SemioticClassBuilder<VerbatimBuilder> {
/**
- * Creates a builder for a TtsSpan of type
- * {@link TtsSpan#TYPE_VERBATIM}.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_VERBATIM}.
*/
public VerbatimBuilder() {
super(TtsSpan.TYPE_VERBATIM);
}
/**
- * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_VERBATIM}
- * and sets the {@link TtsSpan#ARG_VERBATIM} argument.
+ * Creates a builder for a TtsSpan of type {@link #TYPE_VERBATIM}
+ * and sets the {@link #ARG_VERBATIM} argument.
*/
public VerbatimBuilder(String verbatim) {
this();
@@ -1488,7 +1467,7 @@
}
/**
- * Sets the {@link TtsSpan#ARG_VERBATIM} argument.
+ * Sets the {@link #ARG_VERBATIM} argument.
* @param verbatim A string of characters that will be read verbatim,
* except whitespace.
* @return This instance.
diff --git a/core/java/android/view/RenderNodeAnimator.java b/core/java/android/view/RenderNodeAnimator.java
index c7f16e0..a56d448 100644
--- a/core/java/android/view/RenderNodeAnimator.java
+++ b/core/java/android/view/RenderNodeAnimator.java
@@ -93,6 +93,14 @@
private long mUnscaledDuration = 300;
private long mUnscaledStartDelay = 0;
+ // If this is true, we will run any start delays on the UI thread. This is
+ // the safe default, and is necessary to ensure start listeners fire at
+ // the correct time. Animators created by RippleDrawable (the
+ // CanvasProperty<> ones) do not have this expectation, and as such will
+ // set this to false so that the renderthread handles the startdelay instead
+ private final boolean mUiThreadHandlesDelay;
+ private long mStartDelay = 0;
+ private long mStartTime;
public static int mapViewPropertyToRenderProperty(int viewProperty) {
return sViewPropertyAnimatorMap.get(viewProperty);
@@ -101,6 +109,7 @@
public RenderNodeAnimator(int property, float finalValue) {
mRenderProperty = property;
mFinalValue = finalValue;
+ mUiThreadHandlesDelay = true;
init(nCreateAnimator(new WeakReference<RenderNodeAnimator>(this),
property, finalValue));
}
@@ -109,6 +118,7 @@
init(nCreateCanvasPropertyFloatAnimator(
new WeakReference<RenderNodeAnimator>(this),
property.getNativeContainer(), finalValue));
+ mUiThreadHandlesDelay = false;
}
/**
@@ -123,11 +133,13 @@
init(nCreateCanvasPropertyPaintAnimator(
new WeakReference<RenderNodeAnimator>(this),
property.getNativeContainer(), paintField, finalValue));
+ mUiThreadHandlesDelay = false;
}
public RenderNodeAnimator(int x, int y, float startRadius, float endRadius) {
init(nCreateRevealAnimator(new WeakReference<RenderNodeAnimator>(this),
x, y, startRadius, endRadius));
+ mUiThreadHandlesDelay = true;
}
private void init(long ptr) {
@@ -169,6 +181,16 @@
mStarted = true;
applyInterpolator();
+
+ if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
+ nSetStartDelay(mNativePtr.get(), mStartDelay);
+ doStart();
+ } else {
+ getHelper().addDelayedAnimation(this);
+ }
+ }
+
+ private void doStart() {
nStart(mNativePtr.get());
// Alpha is a special snowflake that has the canonical value stored
@@ -195,6 +217,7 @@
@Override
public void cancel() {
if (!mFinished) {
+ getHelper().removeDelayedAnimation(this);
nEnd(mNativePtr.get());
final ArrayList<AnimatorListener> listeners = getListeners();
@@ -258,7 +281,7 @@
throw new IllegalArgumentException("startDelay must be positive; " + startDelay);
}
mUnscaledStartDelay = startDelay;
- nSetStartDelay(mNativePtr.get(), (long) (startDelay * ValueAnimator.getDurationScale()));
+ mStartDelay = (long) (ValueAnimator.getDurationScale() * startDelay);
}
@Override
@@ -303,7 +326,7 @@
return mInterpolator;
}
- private void onFinished() {
+ protected void onFinished() {
mFinished = true;
final ArrayList<AnimatorListener> listeners = getListeners();
@@ -317,6 +340,82 @@
return mNativePtr.get();
}
+ /**
+ * @return true if the animator was started, false if still delayed
+ */
+ private boolean processDelayed(long frameTimeMs) {
+ if (mStartTime == 0) {
+ mStartTime = frameTimeMs;
+ } else if ((frameTimeMs - mStartTime) >= mStartDelay) {
+ doStart();
+ return true;
+ }
+ return false;
+ }
+
+ private static DelayedAnimationHelper getHelper() {
+ DelayedAnimationHelper helper = sAnimationHelper.get();
+ if (helper == null) {
+ helper = new DelayedAnimationHelper();
+ sAnimationHelper.set(helper);
+ }
+ return helper;
+ }
+
+ private static ThreadLocal<DelayedAnimationHelper> sAnimationHelper =
+ new ThreadLocal<DelayedAnimationHelper>();
+
+ private static class DelayedAnimationHelper implements Runnable {
+
+ private ArrayList<RenderNodeAnimator> mDelayedAnims = new ArrayList<RenderNodeAnimator>();
+ private final Choreographer mChoreographer;
+ private boolean mCallbackScheduled;
+
+ public DelayedAnimationHelper() {
+ mChoreographer = Choreographer.getInstance();
+ }
+
+ public void addDelayedAnimation(RenderNodeAnimator animator) {
+ mDelayedAnims.add(animator);
+ scheduleCallback();
+ }
+
+ public void removeDelayedAnimation(RenderNodeAnimator animator) {
+ mDelayedAnims.remove(animator);
+ }
+
+ private void scheduleCallback() {
+ if (!mCallbackScheduled) {
+ mCallbackScheduled = true;
+ mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
+ }
+ }
+
+ @Override
+ public void run() {
+ long frameTimeMs = mChoreographer.getFrameTime();
+ mCallbackScheduled = false;
+
+ int end = 0;
+ for (int i = 0; i < mDelayedAnims.size(); i++) {
+ RenderNodeAnimator animator = mDelayedAnims.get(i);
+ if (!animator.processDelayed(frameTimeMs)) {
+ if (end != i) {
+ mDelayedAnims.set(end, animator);
+ }
+ end++;
+ }
+ }
+ while (mDelayedAnims.size() > end) {
+ mDelayedAnims.remove(mDelayedAnims.size() - 1);
+ }
+
+ if (mDelayedAnims.size() > 0) {
+ scheduleCallback();
+ }
+ }
+ }
+
// Called by native
private static void callOnFinished(WeakReference<RenderNodeAnimator> weakThis) {
RenderNodeAnimator animator = weakThis.get();
@@ -325,6 +424,11 @@
}
}
+ @Override
+ public Animator clone() {
+ throw new IllegalStateException("Cannot clone this animator");
+ }
+
private static native long nCreateAnimator(WeakReference<RenderNodeAnimator> weakThis,
int property, float finalValue);
private static native long nCreateCanvasPropertyFloatAnimator(WeakReference<RenderNodeAnimator> weakThis,
diff --git a/core/java/android/view/RenderNodeAnimatorCompat.java b/core/java/android/view/RenderNodeAnimatorCompat.java
deleted file mode 100644
index 8103f47..0000000
--- a/core/java/android/view/RenderNodeAnimatorCompat.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.view;
-
-import android.animation.ValueAnimator;
-
-import java.util.ArrayList;
-
-/**
- * This class provides compatibility for things like start listeners &
- * start delays for use by ViewPropertyAnimator and ObjectAnimator
- * @hide
- */
-public class RenderNodeAnimatorCompat extends RenderNodeAnimator {
-
- private long mUnscaledStartDelay = 0;
- private long mStartDelay = 0;
- private long mStartTime;
- private boolean mCanceled;
- private boolean mStarted;
-
- public RenderNodeAnimatorCompat(int property, float finalValue) {
- super(property, finalValue);
- }
-
- @Override
- public void setStartDelay(long startDelay) {
- mUnscaledStartDelay = startDelay;
- mStartDelay = (long) (ValueAnimator.getDurationScale() * startDelay);
- }
-
- @Override
- public long getStartDelay() {
- return mUnscaledStartDelay;
- }
-
- @Override
- public void start() {
- mStarted = true;
- if (mStartDelay <= 0) {
- doStart();
- } else {
- getHelper().addDelayedAnimation(this);
- }
- }
-
- @Override
- public boolean isStarted() {
- return mStarted;
- }
-
- private void doStart() {
- if (!mCanceled) {
- super.start();
- }
- }
-
- @Override
- public void cancel() {
- mCanceled = true;
- super.cancel();
- }
-
- /**
- * @return true if the animator was started, false if still delayed
- */
- private boolean processDelayed(long frameTimeMs) {
- if (mCanceled) return true;
-
- if (mStartTime == 0) {
- mStartTime = frameTimeMs;
- } else if ((frameTimeMs - mStartTime) >= mStartDelay) {
- doStart();
- return true;
- }
- return false;
- }
-
- private static AnimationHelper getHelper() {
- AnimationHelper helper = sAnimationHelper.get();
- if (helper == null) {
- helper = new AnimationHelper();
- sAnimationHelper.set(helper);
- }
- return helper;
- }
-
- private static ThreadLocal<AnimationHelper> sAnimationHelper =
- new ThreadLocal<AnimationHelper>();
-
- private static class AnimationHelper implements Runnable {
-
- private ArrayList<RenderNodeAnimatorCompat> mDelayedAnims = new ArrayList<RenderNodeAnimatorCompat>();
- private final Choreographer mChoreographer;
- private boolean mCallbackScheduled;
-
- public AnimationHelper() {
- mChoreographer = Choreographer.getInstance();
- }
-
- public void addDelayedAnimation(RenderNodeAnimatorCompat animator) {
- mDelayedAnims.add(animator);
- scheduleCallback();
- }
-
- private void scheduleCallback() {
- if (!mCallbackScheduled) {
- mCallbackScheduled = true;
- mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
- }
- }
-
- @Override
- public void run() {
- long frameTimeMs = mChoreographer.getFrameTime();
- mCallbackScheduled = false;
-
- int end = 0;
- for (int i = 0; i < mDelayedAnims.size(); i++) {
- RenderNodeAnimatorCompat animator = mDelayedAnims.get(i);
- if (!animator.processDelayed(frameTimeMs)) {
- if (end != i) {
- mDelayedAnims.set(end, animator);
- }
- end++;
- }
- }
- while (mDelayedAnims.size() > end) {
- mDelayedAnims.remove(mDelayedAnims.size() - 1);
- }
-
- if (mDelayedAnims.size() > 0) {
- scheduleCallback();
- }
- }
- }
-}
diff --git a/core/java/android/view/ViewAnimationUtils.java b/core/java/android/view/ViewAnimationUtils.java
index ea3efb1..eeff90a 100644
--- a/core/java/android/view/ViewAnimationUtils.java
+++ b/core/java/android/view/ViewAnimationUtils.java
@@ -30,6 +30,9 @@
*
* Any shadow cast by the View will respect the circular clip from this animator.
*
+ * Note that the animation returned here is a one-shot animation. It cannot
+ * be re-used, and once started it cannot be paused or resumed.
+ *
* @param view The View will be clipped to the animating circle.
* @param centerX The x coordinate of the center of the animating circle.
* @param centerY The y coordinate of the center of the animating circle.
diff --git a/core/java/android/view/ViewPropertyAnimatorRT.java b/core/java/android/view/ViewPropertyAnimatorRT.java
index 20f5182..de96887 100644
--- a/core/java/android/view/ViewPropertyAnimatorRT.java
+++ b/core/java/android/view/ViewPropertyAnimatorRT.java
@@ -81,7 +81,7 @@
int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
final float finalValue = holder.mFromValue + holder.mDeltaValue;
- RenderNodeAnimator animator = new RenderNodeAnimatorCompat(property, finalValue);
+ RenderNodeAnimator animator = new RenderNodeAnimator(property, finalValue);
animator.setStartDelay(startDelay);
animator.setDuration(duration);
animator.setInterpolator(interpolator);
diff --git a/core/res/res/drawable-hdpi/title_bar_shadow.9.png b/core/res/res/drawable-hdpi/title_bar_shadow.9.png
deleted file mode 100644
index e6dab63..0000000
--- a/core/res/res/drawable-hdpi/title_bar_shadow.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/title_bar_shadow.9.png b/core/res/res/drawable-mdpi/title_bar_shadow.9.png
deleted file mode 100644
index dbcefee..0000000
--- a/core/res/res/drawable-mdpi/title_bar_shadow.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/title_bar_shadow.9.png b/core/res/res/drawable-xhdpi/title_bar_shadow.9.png
deleted file mode 100644
index 45b5456..0000000
--- a/core/res/res/drawable-xhdpi/title_bar_shadow.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/notification_icon_legacy_bg_inset.xml b/core/res/res/drawable/title_bar_shadow.xml
similarity index 69%
rename from core/res/res/drawable/notification_icon_legacy_bg_inset.xml
rename to core/res/res/drawable/title_bar_shadow.xml
index 96c5573..37b0b8f 100644
--- a/core/res/res/drawable/notification_icon_legacy_bg_inset.xml
+++ b/core/res/res/drawable/title_bar_shadow.xml
@@ -14,8 +14,12 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/notification_icon_legacy_bg" android:insetBottom="8dp"
- android:insetLeft="8dp" android:insetRight="8dp" android:insetTop="8dp"
- android:visible="true"/>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <gradient
+ android:startColor="#44000000"
+ android:centerColor="#1C000000"
+ android:endColor="#00000000"
+ android:centerY="0.3"
+ android:centerX="0.5"
+ android:angle="270"/>
+</shape>
\ No newline at end of file
diff --git a/core/res/res/layout/notification_material_action.xml b/core/res/res/layout/notification_material_action.xml
index 8f8c4fb..637d941 100644
--- a/core/res/res/layout/notification_material_action.xml
+++ b/core/res/res/layout/notification_material_action.xml
@@ -25,8 +25,8 @@
android:gravity="start|center_vertical"
android:drawablePadding="8dp"
android:paddingStart="8dp"
- android:textColor="#555555"
- android:textSize="@dimen/notification_text_size"
+ android:textColor="@color/secondary_text_material_light"
+ android:textSize="13sp"
android:singleLine="true"
android:ellipsize="end"
/>
diff --git a/core/res/res/layout/notification_material_action_list.xml b/core/res/res/layout/notification_material_action_list.xml
index ec4919b..2a36949 100644
--- a/core/res/res/layout/notification_material_action_list.xml
+++ b/core/res/res/layout/notification_material_action_list.xml
@@ -22,9 +22,6 @@
android:orientation="horizontal"
android:visibility="gone"
android:layout_marginBottom="8dp"
- android:showDividers="middle"
- android:divider="@drawable/list_divider_holo_light"
- android:dividerPadding="12dp"
>
<!-- actions will be added here -->
</LinearLayout>
diff --git a/core/res/res/layout/notification_template_icon_group.xml b/core/res/res/layout/notification_template_icon_group.xml
index 2ad6f9e..fa66163 100644
--- a/core/res/res/layout/notification_template_icon_group.xml
+++ b/core/res/res/layout/notification_template_icon_group.xml
@@ -23,20 +23,23 @@
android:id="@+id/icon_group"
>
<ImageView android:id="@+id/icon"
- android:layout_width="@dimen/notification_large_icon_width"
- android:layout_height="@dimen/notification_large_icon_height"
- android:padding="8dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+ android:layout_marginStart="12dp"
+ android:layout_marginEnd="12dp"
android:scaleType="centerInside"
/>
<ImageView android:id="@+id/right_icon"
- android:layout_width="24dp"
- android:layout_height="24dp"
- android:padding="4dp"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:padding="3dp"
android:layout_gravity="end|bottom"
android:scaleType="centerInside"
android:visibility="gone"
- android:layout_marginEnd="3dp"
- android:layout_marginBottom="3dp"
+ android:layout_marginEnd="8dp"
+ android:layout_marginBottom="8dp"
/>
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_base.xml b/core/res/res/layout/notification_template_material_base.xml
index 5e51db9..674d7b8 100644
--- a/core/res/res/layout/notification_template_material_base.xml
+++ b/core/res/res/layout/notification_template_material_base.xml
@@ -31,25 +31,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
- android:layout_marginEnd="8dp"
android:layout_marginStart="@dimen/notification_large_icon_width"
android:minHeight="@dimen/notification_large_icon_height"
android:orientation="vertical"
>
- <include layout="@layout/notification_template_part_line1"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- />
- <include layout="@layout/notification_template_part_line2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- />
- <include layout="@layout/notification_template_part_line3"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- />
+ <include layout="@layout/notification_template_part_line1" />
+ <include layout="@layout/notification_template_part_line2" />
+ <include layout="@layout/notification_template_part_line3" />
</LinearLayout>
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml
index 2243a09..3d8a527 100644
--- a/core/res/res/layout/notification_template_material_big_base.xml
+++ b/core/res/res/layout/notification_template_material_big_base.xml
@@ -31,7 +31,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
- android:layout_marginEnd="8dp"
android:layout_marginStart="@dimen/notification_large_icon_width"
android:minHeight="@dimen/notification_large_icon_height"
android:orientation="vertical"
@@ -42,22 +41,26 @@
android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="@dimen/notification_large_icon_height"
- android:layout_weight="1"
+ android:layout_marginEnd="8dp"
android:singleLine="false"
android:visibility="gone"
/>
- <include layout="@layout/notification_template_part_line3" />
+ <include
+ layout="@layout/notification_template_part_line3"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ />
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
+ android:layout_marginTop="10dp"
android:id="@+id/action_divider"
android:visibility="gone"
- android:background="@drawable/list_divider_holo_light" />
+ android:background="@drawable/notification_template_divider" />
<include
layout="@layout/notification_material_action_list"
- android:layout_marginLeft="-8dp"
- android:layout_marginRight="-8dp"
+ android:layout_marginStart="-8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml
new file mode 100644
index 0000000..36f8701
--- /dev/null
+++ b/core/res/res/layout/notification_template_material_big_text.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:internal="http://schemas.android.com/apk/prv/res/android"
+ android:id="@+id/status_bar_latest_event_content"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ internal:layout_minHeight="65dp"
+ internal:layout_maxHeight="unbounded"
+ >
+ <include layout="@layout/notification_template_icon_group"
+ android:layout_width="@dimen/notification_large_icon_width"
+ android:layout_height="@dimen/notification_large_icon_height"
+ />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginStart="@dimen/notification_large_icon_width"
+ android:minHeight="@dimen/notification_large_icon_height"
+ android:orientation="vertical"
+ >
+ <include layout="@layout/notification_template_part_line1" />
+ <include layout="@layout/notification_template_part_line2" />
+ <TextView android:id="@+id/big_text"
+ android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ android:layout_marginBottom="10dp"
+ android:visibility="gone"
+ />
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:id="@+id/action_divider"
+ android:visibility="gone"
+ android:background="@drawable/notification_template_divider" />
+ <include
+ layout="@layout/notification_material_action_list"
+ android:layout_marginStart="-8dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:id="@+id/overflow_divider"
+ android:visibility="visible"
+ android:background="@drawable/notification_template_divider" />
+ <include
+ layout="@layout/notification_template_part_line3"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="10dp" />
+ </LinearLayout>
+</FrameLayout>
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index 6133791..ef6cbd0 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -113,7 +113,7 @@
<FrameLayout
android:id="@+id/inbox_end_pad"
android:layout_width="match_parent"
- android:layout_height="8dip"
+ android:layout_height="10dp"
android:visibility="gone"
android:layout_weight="0"
/>
@@ -122,7 +122,7 @@
android:layout_height="1dip"
android:id="@+id/action_divider"
android:visibility="gone"
- android:background="@drawable/list_divider_holo_light" />
+ android:background="@drawable/notification_template_divider" />
<include
layout="@layout/notification_material_action_list"
android:layout_width="match_parent"
@@ -136,7 +136,13 @@
android:layout_height="1dip"
android:id="@+id/overflow_divider"
android:visibility="visible"
- android:background="@drawable/list_divider_holo_light" />
- <include layout="@layout/notification_template_part_line3" />
+ android:background="@drawable/notification_template_divider" />
+ <include
+ layout="@layout/notification_template_part_line3"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="10dp" />
</LinearLayout>
</FrameLayout>
diff --git a/core/res/res/layout/notification_template_part_line1.xml b/core/res/res/layout/notification_template_part_line1.xml
index d652959..c6ea6bf 100644
--- a/core/res/res/layout/notification_template_part_line1.xml
+++ b/core/res/res/layout/notification_template_part_line1.xml
@@ -19,9 +19,8 @@
android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
android:orientation="horizontal"
- android:paddingTop="@dimen/notification_vert_pad"
- android:layout_weight="0"
>
<TextView android:id="@+id/title"
android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Title"
diff --git a/core/res/res/layout/notification_template_part_line2.xml b/core/res/res/layout/notification_template_part_line2.xml
index 1e19df1..d3f202f 100644
--- a/core/res/res/layout/notification_template_part_line2.xml
+++ b/core/res/res/layout/notification_template_part_line2.xml
@@ -21,8 +21,9 @@
android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Line2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="-2dp"
- android:layout_marginBottom="-2dp"
+ android:layout_marginEnd="8dp"
+ android:layout_marginTop="-1dp"
+ android:layout_marginBottom="-1dp"
android:singleLine="true"
android:fadingEdge="horizontal"
android:ellipsize="marquee"
@@ -32,7 +33,8 @@
<ProgressBar
android:id="@android:id/progress"
android:layout_width="match_parent"
- android:layout_height="8dp"
+ android:layout_height="15dp"
+ android:layout_marginEnd="8dp"
android:visibility="gone"
android:layout_weight="0"
style="@style/Widget.Material.Light.ProgressBar.Horizontal"
diff --git a/core/res/res/layout/notification_template_part_line3.xml b/core/res/res/layout/notification_template_part_line3.xml
index 2c8c704c..dd2779d 100644
--- a/core/res/res/layout/notification_template_part_line3.xml
+++ b/core/res/res/layout/notification_template_part_line3.xml
@@ -19,10 +19,9 @@
android:id="@+id/line3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
android:orientation="horizontal"
- android:layout_weight="0"
android:gravity="center_vertical"
- android:paddingBottom="@dimen/notification_vert_pad"
>
<TextView android:id="@+id/text"
android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index d538352..0360460 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -127,6 +127,7 @@
<drawable name="notification_template_icon_bg">#3333B5E5</drawable>
<drawable name="notification_template_icon_low_bg">#0cffffff</drawable>
+ <drawable name="notification_template_divider">#29000000</drawable>
<color name="notification_icon_bg_color">#ff9e9e9e</color>
<color name="notification_action_legacy_color_filter">#ff555555</color>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index e58bc6f..6022bdc 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -215,17 +215,26 @@
<dimen name="action_bar_stacked_tab_max_width">180dp</dimen>
<!-- Size of notification text (see TextAppearance.StatusBar.EventContent) -->
- <dimen name="notification_text_size">13sp</dimen>
+ <dimen name="notification_text_size">14sp</dimen>
<!-- Size of notification text titles (see TextAppearance.StatusBar.EventContent.Title) -->
<dimen name="notification_title_text_size">16sp</dimen>
<!-- Size of smaller notification text (see TextAppearance.StatusBar.EventContent.Line2, Info, Time) -->
<dimen name="notification_subtext_size">12sp</dimen>
- <!-- 8dp at the top/bottom of the notification view -->
- <dimen name="notification_vert_pad">10dp</dimen>
+ <!-- Top padding for notifications in the standard layout. -->
+ <dimen name="notification_top_pad">10dp</dimen>
- <!-- Replacement for @dimen/notification_vert_pad when the text is large -->
- <dimen name="notification_large_font_vert_pad">3dp</dimen>
+ <!-- Top padding for notifications when narrow (i.e. it has 3 lines) -->
+ <dimen name="notification_top_pad_narrow">4dp</dimen>
+
+ <!-- Top padding for notification when text is large -->
+ <dimen name="notification_top_pad_large_text">5dp</dimen>
+
+ <!-- Top padding for notification when text is large and narrow (i.e. it has 3 lines -->
+ <dimen name="notification_top_pad_large_text_narrow">-4dp</dimen>
+
+ <!-- Padding for notification icon when drawn with circle around it -->
+ <dimen name="notification_large_icon_circle_padding">11dp</dimen>
<!-- Keyguard dimensions -->
<!-- TEMP -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 9d71859..b198329 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3958,9 +3958,9 @@
<string name="permission_request_notification_with_subtitle">Permission requested\nfor account <xliff:g id="account" example="foo@gmail.com">%s</xliff:g>.</string>
<!-- Message to show when an intent automatically switches users into the personal profile. -->
- <string name="forward_intent_to_owner">You\'re using this app in your personal space</string>
+ <string name="forward_intent_to_owner">You\'re using this app in your personal profile</string>
<!-- Message to show when an intent automatically switches users into a work profile. -->
- <string name="forward_intent_to_work">You\'re using this app in your work space</string>
+ <string name="forward_intent_to_work">You\'re using this app in your work profile</string>
<!-- Label to show for a service that is running because it is an input method. -->
<string name="input_method_binding_label">Input method</string>
@@ -4859,15 +4859,12 @@
<!-- Exting lock-to-app indication. -->
<string name="lock_to_app_exit">Screen unpinned</string>
- <!-- Lock-to-app checkbox for lock on exit -->
- <string name="lock_to_app_use_screen_lock">Ask for %1$s before unpinning</string>
-
<!-- Lock-to-app unlock pin string -->
- <string name="lock_to_app_unlock_pin">PIN</string>
+ <string name="lock_to_app_unlock_pin">Ask for PIN before unpinning</string>
<!-- Lock-to-app unlock pattern string -->
- <string name="lock_to_app_unlock_pattern">unlock pattern</string>
+ <string name="lock_to_app_unlock_pattern">Ask for unlock pattern before unpinning</string>
<!-- Lock-to-app unlock password string -->
- <string name="lock_to_app_unlock_password">password</string>
+ <string name="lock_to_app_unlock_password">Ask for password before unpinning</string>
<!-- [CHAR_LIMIT=NONE] Battery saver: Feature description -->
<string name="battery_saver_description">To help improve battery life, battery saver reduces your device’s performance and limits vibration and most background data. Email, messaging, and other apps that rely on syncing may not update unless you open them.\n\nBattery saver turns off automatically when your device is charging</string>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index c8ea699..fb70d6b 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -413,12 +413,12 @@
<style name="TextAppearance.StatusBar.Material" />
<style name="TextAppearance.StatusBar.Material.EventContent">
- <item name="textColor">#90000000</item>
+ <item name="textColor">@color/secondary_text_material_light</item>
<item name="textSize">@dimen/notification_text_size</item>
</style>
<style name="TextAppearance.StatusBar.Material.EventContent.Title">
- <item name="textColor">#DD000000</item>
+ <item name="textColor">@color/primary_text_default_material_light</item>
<item name="textSize">@dimen/notification_title_text_size</item>
</style>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 1f862fd..af73c02 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -350,7 +350,11 @@
<java-symbol type="dimen" name="notification_text_size" />
<java-symbol type="dimen" name="notification_title_text_size" />
<java-symbol type="dimen" name="notification_subtext_size" />
- <java-symbol type="dimen" name="notification_large_font_vert_pad" />
+ <java-symbol type="dimen" name="notification_top_pad" />
+ <java-symbol type="dimen" name="notification_top_pad_narrow" />
+ <java-symbol type="dimen" name="notification_top_pad_large_text" />
+ <java-symbol type="dimen" name="notification_top_pad_large_text_narrow" />
+ <java-symbol type="dimen" name="notification_large_icon_circle_padding" />
<java-symbol type="dimen" name="immersive_mode_cling_width" />
<java-symbol type="dimen" name="circular_display_mask_offset" />
@@ -622,7 +626,6 @@
<java-symbol type="id" name="lock_to_app_checkbox" />
<java-symbol type="string" name="lock_to_app_start" />
<java-symbol type="string" name="lock_to_app_exit" />
- <java-symbol type="string" name="lock_to_app_use_screen_lock" />
<java-symbol type="string" name="lock_to_app_unlock_pin" />
<java-symbol type="string" name="lock_to_app_unlock_pattern" />
<java-symbol type="string" name="lock_to_app_unlock_password" />
@@ -1705,12 +1708,12 @@
<java-symbol type="layout" name="notification_template_material_inbox" />
<java-symbol type="layout" name="notification_template_material_media" />
<java-symbol type="layout" name="notification_template_material_big_media" />
+ <java-symbol type="layout" name="notification_template_material_big_text" />
<java-symbol type="layout" name="notification_template_icon_group" />
<java-symbol type="layout" name="notification_material_media_action" />
<java-symbol type="color" name="notification_action_legacy_color_filter" />
<java-symbol type="color" name="notification_icon_bg_color" />
<java-symbol type="drawable" name="notification_icon_legacy_bg" />
- <java-symbol type="drawable" name="notification_icon_legacy_bg_inset" />
<java-symbol type="drawable" name="notification_material_media_progress" />
<java-symbol type="color" name="notification_media_action_bg" />
<java-symbol type="color" name="notification_media_progress" />
diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java
index f348b9b..7110db9 100644
--- a/media/java/android/media/tv/TvView.java
+++ b/media/java/android/media/tv/TvView.java
@@ -38,6 +38,7 @@
import android.view.ViewGroup;
import android.view.ViewRootImpl;
+import java.lang.ref.WeakReference;
import java.util.List;
/**
@@ -69,8 +70,10 @@
private static final int CAPTION_ENABLED = 1;
private static final int CAPTION_DISABLED = 2;
+ private static final WeakReference<TvView> NULL_TV_VIEW = new WeakReference(null);
+
private static final Object sMainTvViewLock = new Object();
- private static TvView sMainTvView;
+ private static WeakReference<TvView> sMainTvView = NULL_TV_VIEW;
private final Handler mHandler = new Handler();
private Session mSession;
@@ -186,16 +189,16 @@
* (including the tuner, composite, S-Video, etc.), the internal device (= TV itself) becomes
* the active source.
* </p><p>
- * First tuned {@link TvView} becomes main automatically, and keeps to be main until {@link
- * #setMain} is called for other {@link TvView}. Note that main {@link TvView} won't be reset
- * even when current main {@link TvView} is removed from view hierarchy.
+ * First tuned {@link TvView} becomes main automatically, and keeps to be main until either
+ * {@link #reset} is called for the main {@link TvView} or {@link #setMain} is called for other
+ * {@link TvView}.
* </p>
* @hide
*/
@SystemApi
public void setMain() {
synchronized (sMainTvViewLock) {
- sMainTvView = this;
+ sMainTvView = new WeakReference(this);
if (hasWindowFocus() && mSession != null) {
mSession.setMain();
}
@@ -288,8 +291,8 @@
throw new IllegalArgumentException("inputId cannot be null or an empty string");
}
synchronized (sMainTvViewLock) {
- if (sMainTvView == null) {
- sMainTvView = this;
+ if (sMainTvView.get() == null) {
+ sMainTvView = new WeakReference(this);
}
}
if (mSessionCallback != null && mSessionCallback.mInputId.equals(inputId)) {
@@ -320,6 +323,11 @@
*/
public void reset() {
if (DEBUG) Log.d(TAG, "reset()");
+ synchronized (sMainTvViewLock) {
+ if (this == sMainTvView.get()) {
+ sMainTvView = NULL_TV_VIEW;
+ }
+ }
if (mSession != null) {
release();
resetSurfaceView();
@@ -530,7 +538,7 @@
// Other app may have shown its own main TvView.
// Set main again to regain main session.
synchronized (sMainTvViewLock) {
- if (hasFocus && this == sMainTvView && mSession != null) {
+ if (hasFocus && this == sMainTvView.get() && mSession != null) {
mSession.setMain();
}
}
@@ -828,7 +836,7 @@
mSession = session;
if (session != null) {
synchronized (sMainTvViewLock) {
- if (hasWindowFocus() && TvView.this == sMainTvView) {
+ if (hasWindowFocus() && TvView.this == sMainTvView.get()) {
mSession.setMain();
}
}
diff --git a/packages/SystemUI/res/drawable-xxhdpi/title_bar_shadow.9.png b/packages/SystemUI/res/drawable-xxhdpi/title_bar_shadow.9.png
deleted file mode 100644
index e86f891..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/title_bar_shadow.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_qs_vpn.xml b/packages/SystemUI/res/drawable/ic_qs_vpn.xml
index e9141ef..e7ef02a 100644
--- a/packages/SystemUI/res/drawable/ic_qs_vpn.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_vpn.xml
@@ -18,8 +18,7 @@
android:height="12.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
-
<path
android:fillColor="#4DFFFFFF"
- android:pathData="M22.000000,4.000000L22.000000,3.500000C22.000000,2.100000 20.900000,1.000000 19.500000,1.000000C18.100000,1.000000 17.000000,2.100000 17.000000,3.500000L17.000000,4.000000c-0.600000,0.000000 -1.000000,0.400000 -1.000000,1.000000l0.000000,4.000000c0.000000,0.600000 0.400000,1.000000 1.000000,1.000000l5.000000,0.000000c0.600000,0.000000 1.000000,-0.400000 1.000000,-1.000000L23.000000,5.000000C23.000000,4.400000 22.600000,4.000000 22.000000,4.000000zM21.200001,4.000000l-3.400000,0.000000L17.800001,3.500000c0.000000,-0.900000 0.800000,-1.700000 1.700000,-1.700000c0.900000,0.000000 1.700000,0.800000 1.700000,1.700000L21.200003,4.000000zM18.900000,12.000000c0.000000,0.300000 0.100000,0.700000 0.100000,1.000000c0.000000,2.100000 -0.800000,4.000000 -2.100000,5.400000c-0.300000,-0.800000 -1.000000,-1.400000 -1.900000,-1.400000l-1.000000,0.000000l0.000000,-3.000000c0.000000,-0.600000 -0.400000,-1.000000 -1.000000,-1.000000L7.000000,13.000000l0.000000,-2.000000l2.000000,0.000000c0.600000,0.000000 1.000000,-0.400000 1.000000,-1.000000L10.000000,8.000000l2.000000,0.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000L14.000000,3.500000C13.100000,3.200000 12.000000,3.000000 11.000000,3.000000C5.500000,3.000000 1.000000,7.500000 1.000000,13.000000c0.000000,5.500000 4.500000,10.000000 10.000000,10.000000c5.500000,0.000000 10.000000,-4.500000 10.000000,-10.000000c0.000000,-0.300000 0.000000,-0.700000 -0.100000,-1.000000L18.900000,12.000000zM10.000000,20.900000c-3.900000,-0.500000 -7.000000,-3.900000 -7.000000,-7.900000c0.000000,-0.600000 0.100000,-1.200000 0.200000,-1.800000L8.000000,16.000000l0.000000,1.000000c0.000000,1.100000 0.900000,2.000000 2.000000,2.000000L10.000000,20.900000z"/>
+ android:pathData="M12.700000,10.000000c-0.800000,-2.300000 -3.000000,-4.000000 -5.700000,-4.000000c-3.300000,0.000000 -6.000000,2.700000 -6.000000,6.000000s2.700000,6.000000 6.000000,6.000000c2.600000,0.000000 4.800000,-1.700000 5.700000,-4.000000L17.000000,14.000000l0.000000,4.000000l4.000000,0.000000l0.000000,-4.000000l2.000000,0.000000l0.000000,-4.000000L12.700000,10.000000zM7.000000,14.000000c-1.100000,0.000000 -2.000000,-0.900000 -2.000000,-2.000000c0.000000,-1.100000 0.900000,-2.000000 2.000000,-2.000000s2.000000,0.900000 2.000000,2.000000C9.000000,13.100000 8.100000,14.000000 7.000000,14.000000z"/>
</vector>
diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml
index 365a7d2..09e541f 100644
--- a/packages/SystemUI/res/layout/super_status_bar.xml
+++ b/packages/SystemUI/res/layout/super_status_bar.xml
@@ -38,7 +38,9 @@
android:layout_height="match_parent"
android:elevation="2dp"
android:background="@drawable/brightness_mirror_background">
- <include layout="@layout/quick_settings_brightness_dialog" />
+ <include layout="@layout/quick_settings_brightness_dialog"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
</FrameLayout>
</FrameLayout>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 53bdcbf..3a20b00 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1183,7 +1183,10 @@
icon.setImageDrawable(iconDrawable);
if (mNotificationColorUtil.isGrayscale(iconDrawable)) {
icon.setBackgroundResource(
- com.android.internal.R.drawable.notification_icon_legacy_bg_inset);
+ com.android.internal.R.drawable.notification_icon_legacy_bg);
+ int padding = mContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.notification_large_icon_circle_padding);
+ icon.setPadding(padding, padding, padding, padding);
}
if (profileIcon != null) {
@@ -1214,6 +1217,11 @@
R.style.TextAppearance_StatusBar_Material_EventContent_Parenthetical);
}
+ int topPadding = Notification.Builder.calculateTopPadding(mContext,
+ false /* hasThreeLines */,
+ mContext.getResources().getConfiguration().fontScale);
+ title.setPadding(0, topPadding, 0, 0);
+
entry.autoRedacted = true;
}
diff --git a/services/core/java/com/android/server/am/LockTaskNotify.java b/services/core/java/com/android/server/am/LockTaskNotify.java
index cf65243..5768ddb 100644
--- a/services/core/java/com/android/server/am/LockTaskNotify.java
+++ b/services/core/java/com/android/server/am/LockTaskNotify.java
@@ -34,6 +34,7 @@
private final Context mContext;
private final H mHandler;
private AccessibilityManager mAccessibilityManager;
+ private Toast mLastToast;
public LockTaskNotify(Context context) {
mContext = context;
@@ -52,7 +53,11 @@
if (!isLocked && mAccessibilityManager.isEnabled()) {
text = mContext.getString(R.string.lock_to_app_toast_accessible);
}
- Toast.makeText(mContext, text, Toast.LENGTH_LONG).show();
+ if (mLastToast != null) {
+ mLastToast.cancel();
+ }
+ mLastToast = Toast.makeText(mContext, text, Toast.LENGTH_LONG);
+ mLastToast.show();
}
public void show(boolean starting) {
diff --git a/services/core/java/com/android/server/am/LockToAppRequestDialog.java b/services/core/java/com/android/server/am/LockToAppRequestDialog.java
index 12dcf7e..5abf699 100644
--- a/services/core/java/com/android/server/am/LockToAppRequestDialog.java
+++ b/services/core/java/com/android/server/am/LockToAppRequestDialog.java
@@ -102,8 +102,7 @@
if (unlockStringId != 0) {
String unlockString = mContext.getString(unlockStringId);
mCheckbox = (CheckBox) mDialog.findViewById(R.id.lock_to_app_checkbox);
- mCheckbox.setText(mContext.getString(R.string.lock_to_app_use_screen_lock,
- unlockString));
+ mCheckbox.setText(unlockString);
// Remember state.
try {
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 5f3da07..da11387 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -430,10 +430,10 @@
}
try {
- radioOff = phone == null || !phone.isRadioOn();
+ radioOff = phone == null || !phone.needMobileRadioShutdown();
if (!radioOff) {
- Log.w(TAG, "Turning off radio...");
- phone.setRadio(false);
+ Log.w(TAG, "Turning off cellular radios...");
+ phone.shutdownMobileRadios();
}
} catch (RemoteException ex) {
Log.e(TAG, "RemoteException during radio shutdown", ex);
@@ -456,7 +456,7 @@
}
if (!radioOff) {
try {
- radioOff = !phone.isRadioOn();
+ radioOff = !phone.needMobileRadioShutdown();
} catch (RemoteException ex) {
Log.e(TAG, "RemoteException during radio shutdown", ex);
radioOff = true;
@@ -472,7 +472,7 @@
Log.e(TAG, "RemoteException during NFC shutdown", ex);
nfcOff = true;
}
- if (radioOff) {
+ if (nfcOff) {
Log.i(TAG, "NFC turned off.");
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 21ba31e..7baa258 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -18,6 +18,7 @@
import static android.Manifest.permission.MANAGE_CA_CERTIFICATES;
+import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.AlarmManager;
@@ -39,14 +40,15 @@
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;
import android.content.pm.UserInfo;
import android.media.AudioManager;
import android.media.IAudioService;
import android.net.ConnectivityManager;
import android.net.Uri;
-import android.content.pm.PackageManager.NameNotFoundException;
import android.database.ContentObserver;
import android.hardware.usb.UsbManager;
import android.net.ProxyInfo;
@@ -77,6 +79,10 @@
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
+import android.view.accessibility.AccessibilityManager;
+import android.view.accessibility.IAccessibilityManager;
+import android.view.inputmethod.InputMethodInfo;
+import android.view.inputmethod.InputMethodManager;
import android.view.IWindowManager;
import com.android.internal.R;
@@ -282,6 +288,8 @@
private static final String TAG_DISABLE_SCREEN_CAPTURE = "disable-screen-capture";
private static final String TAG_DISABLE_ACCOUNT_MANAGEMENT = "disable-account-management";
private static final String TAG_ACCOUNT_TYPE = "account-type";
+ private static final String TAG_PERMITTED_ACCESSIBILITY_SERVICES
+ = "permitted-accessiblity-services";
private static final String TAG_ENCRYPTION_REQUESTED = "encryption-requested";
private static final String TAG_MANAGE_TRUST_AGENT_FEATURES = "manage-trust-agent-features";
private static final String TAG_TRUST_AGENT_FEATURE = "feature";
@@ -291,6 +299,7 @@
private static final String TAG_GLOBAL_PROXY_EXCLUSION_LIST = "global-proxy-exclusion-list";
private static final String TAG_GLOBAL_PROXY_SPEC = "global-proxy-spec";
private static final String TAG_SPECIFIES_GLOBAL_PROXY = "specifies-global-proxy";
+ private static final String TAG_PERMITTED_IMES = "permitted-imes";
private static final String TAG_MAX_FAILED_PASSWORD_WIPE = "max-failed-password-wipe";
private static final String TAG_MAX_TIME_TO_UNLOCK = "max-time-to-unlock";
private static final String TAG_MIN_PASSWORD_NONLETTER = "min-password-nonletter";
@@ -307,6 +316,7 @@
private static final String TAG_CROSS_PROFILE_WIDGET_PROVIDERS =
"cross-profile-widget-providers";
private static final String TAG_PROVIDER = "provider";
+ private static final String TAG_PACKAGE_LIST_ITEM = "item";
final DeviceAdminInfo info;
@@ -358,6 +368,16 @@
Set<String> accountTypesWithManagementDisabled = new HashSet<String>();
+ // The list of permitted accessibility services package namesas set by a profile
+ // or device owner. Null means all accessibility services are allowed, empty means
+ // none except system services are allowed.
+ List<String> permittedAccessiblityServices;
+
+ // The list of permitted input methods package names as set by a profile or device owner.
+ // Null means all input methods are allowed, empty means none except system imes are
+ // allowed.
+ List<String> permittedInputMethods;
+
// TODO: review implementation decisions with frameworks team
boolean specifiesGlobalProxy = false;
String globalProxySpec = null;
@@ -521,6 +541,25 @@
}
out.endTag(null, TAG_CROSS_PROFILE_WIDGET_PROVIDERS);
}
+ writePackageListToXml(out, TAG_PERMITTED_ACCESSIBILITY_SERVICES,
+ permittedAccessiblityServices);
+ writePackageListToXml(out, TAG_PERMITTED_IMES, permittedInputMethods);
+ }
+
+ void writePackageListToXml(XmlSerializer out, String outerTag,
+ List<String> packageList)
+ throws IllegalArgumentException, IllegalStateException, IOException {
+ if (packageList == null) {
+ return;
+ }
+
+ out.startTag(null, outerTag);
+ for (String packageName : packageList) {
+ out.startTag(null, TAG_PACKAGE_LIST_ITEM);
+ out.attribute(null, ATTR_VALUE, packageName);
+ out.endTag(null, TAG_PACKAGE_LIST_ITEM);
+ }
+ out.endTag(null, outerTag);
}
void readFromXml(XmlPullParser parser)
@@ -604,6 +643,10 @@
trustAgentFeatures = getAllTrustAgentFeatures(parser, tag);
} else if (TAG_CROSS_PROFILE_WIDGET_PROVIDERS.equals(tag)) {
crossProfileWidgetProviders = getCrossProfileWidgetProviders(parser, tag);
+ } else if (TAG_PERMITTED_ACCESSIBILITY_SERVICES.equals(tag)) {
+ permittedAccessiblityServices = readPackageList(parser, tag);
+ } else if (TAG_PERMITTED_IMES.equals(tag)) {
+ permittedInputMethods = readPackageList(parser, tag);
} else {
Slog.w(LOG_TAG, "Unknown admin tag: " + tag);
}
@@ -611,6 +654,31 @@
}
}
+ private List<String> readPackageList(XmlPullParser parser,
+ String tag) throws XmlPullParserException, IOException {
+ List<String> result = new ArrayList<String>();
+ int outerDepth = parser.getDepth();
+ int outerType;
+ while ((outerType=parser.next()) != XmlPullParser.END_DOCUMENT
+ && (outerType != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
+ if (outerType == XmlPullParser.END_TAG || outerType == XmlPullParser.TEXT) {
+ continue;
+ }
+ String outerTag = parser.getName();
+ if (TAG_PACKAGE_LIST_ITEM.equals(outerTag)) {
+ String packageName = parser.getAttributeValue(null, ATTR_VALUE);
+ if (packageName != null) {
+ result.add(packageName);
+ } else {
+ Slog.w(LOG_TAG, "Package name missing under " + outerTag);
+ }
+ } else {
+ Slog.w(LOG_TAG, "Unknown tag under " + tag + ": " + outerTag);
+ }
+ }
+ return result;
+ }
+
private Set<String> readDisableAccountInfo(XmlPullParser parser, String tag)
throws XmlPullParserException, IOException {
int outerDepthDAM = parser.getDepth();
@@ -754,6 +822,14 @@
pw.println(disabledKeyguardFeatures);
pw.print(prefix); pw.print("crossProfileWidgetProviders=");
pw.println(crossProfileWidgetProviders);
+ if (!(permittedAccessiblityServices == null)) {
+ pw.print(prefix); pw.print("permittedAccessibilityServices=");
+ pw.println(permittedAccessiblityServices.toString());
+ }
+ if (!(permittedInputMethods == null)) {
+ pw.print(prefix); pw.print("permittedInputMethods=");
+ pw.println(permittedInputMethods.toString());
+ }
}
}
@@ -3971,6 +4047,343 @@
}
}
+ /**
+ * @return true if all packages in enabledPackages are either in the list
+ * permittedList or are a system app.
+ */
+ private boolean checkPackagesInPermittedListOrSystem(List<String> enabledPackages,
+ List<String> permittedList) {
+ int userIdToCheck = UserHandle.getCallingUserId();
+ long id = Binder.clearCallingIdentity();
+ try {
+ // If we have an enabled packages list for a managed profile the packages
+ // we should check are installed for the parent user.
+ UserInfo user = mUserManager.getUserInfo(userIdToCheck);
+ if (user.isManagedProfile()) {
+ userIdToCheck = user.profileGroupId;
+ }
+
+ IPackageManager pm = AppGlobals.getPackageManager();
+ for (String enabledPackage : enabledPackages) {
+ boolean systemService = false;
+ try {
+ ApplicationInfo applicationInfo = pm.getApplicationInfo(enabledPackage,
+ PackageManager.GET_UNINSTALLED_PACKAGES, userIdToCheck);
+ systemService = (applicationInfo.flags
+ & ApplicationInfo.FLAG_SYSTEM) != 0;
+ } catch (RemoteException e) {
+ Log.i(LOG_TAG, "Can't talk to package managed", e);
+ }
+ if (!systemService && !permittedList.contains(enabledPackage)) {
+ return false;
+ }
+ }
+ } finally {
+ restoreCallingIdentity(id);
+ }
+ return true;
+ }
+
+ private AccessibilityManager getAccessibilityManagerForUser(int userId) {
+ // Not using AccessibilityManager.getInstance because that guesses
+ // at the user you require based on callingUid and caches for a given
+ // process.
+ IBinder iBinder = ServiceManager.getService(Context.ACCESSIBILITY_SERVICE);
+ IAccessibilityManager service = iBinder == null
+ ? null : IAccessibilityManager.Stub.asInterface(iBinder);
+ return new AccessibilityManager(mContext, service, userId);
+ }
+
+ @Override
+ public boolean setPermittedAccessibilityServices(ComponentName who, List packageList) {
+ if (!mHasFeature) {
+ return false;
+ }
+ if (who == null) {
+ throw new NullPointerException("ComponentName is null");
+ }
+
+ if (packageList != null) {
+ int userId = UserHandle.getCallingUserId();
+ List<AccessibilityServiceInfo> enabledServices = null;
+ long id = Binder.clearCallingIdentity();
+ try {
+ UserInfo user = mUserManager.getUserInfo(userId);
+ if (user.isManagedProfile()) {
+ userId = user.profileGroupId;
+ }
+ AccessibilityManager accessibilityManager = getAccessibilityManagerForUser(userId);
+ enabledServices = accessibilityManager.getEnabledAccessibilityServiceList(
+ AccessibilityServiceInfo.FEEDBACK_ALL_MASK);
+ } finally {
+ restoreCallingIdentity(id);
+ }
+
+ if (enabledServices != null) {
+ List<String> enabledPackages = new ArrayList<String>();
+ for (AccessibilityServiceInfo service : enabledServices) {
+ enabledPackages.add(service.getResolveInfo().serviceInfo.packageName);
+ }
+ if (!checkPackagesInPermittedListOrSystem(enabledPackages, packageList)) {
+ Slog.e(LOG_TAG, "Cannot set permitted accessibility services, "
+ + "because it contains already enabled accesibility services.");
+ return false;
+ }
+ }
+ }
+
+ synchronized (this) {
+ ActiveAdmin admin = getActiveAdminForCallerLocked(who,
+ DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
+ admin.permittedAccessiblityServices = packageList;
+ saveSettingsLocked(UserHandle.getCallingUserId());
+ }
+ return true;
+ }
+
+ @Override
+ public List getPermittedAccessibilityServices(ComponentName who) {
+ if (!mHasFeature) {
+ return null;
+ }
+
+ if (who == null) {
+ throw new NullPointerException("ComponentName is null");
+ }
+
+ synchronized (this) {
+ ActiveAdmin admin = getActiveAdminForCallerLocked(who,
+ DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
+ return admin.permittedAccessiblityServices;
+ }
+ }
+
+ @Override
+ public List getPermittedAccessibilityServicesForUser(int userId) {
+ if (!mHasFeature) {
+ return null;
+ }
+ synchronized (this) {
+ List<String> result = null;
+ // If we have multiple profiles we return the intersection of the
+ // permitted lists. This can happen in cases where we have a device
+ // and profile owner.
+ List<UserInfo> profiles = mUserManager.getProfiles(userId);
+ final int PROFILES_SIZE = profiles.size();
+ for (int i = 0; i < PROFILES_SIZE; ++i) {
+ // Just loop though all admins, only device or profiles
+ // owners can have permitted lists set.
+ DevicePolicyData policy = getUserData(profiles.get(i).id);
+ final int N = policy.mAdminList.size();
+ for (int j = 0; j < N; j++) {
+ ActiveAdmin admin = policy.mAdminList.get(j);
+ List<String> fromAdmin = admin.permittedAccessiblityServices;
+ if (fromAdmin != null) {
+ if (result == null) {
+ result = new ArrayList<String>(fromAdmin);
+ } else {
+ result.retainAll(fromAdmin);
+ }
+ }
+ }
+ }
+
+ // If we have a permitted list add all system accessibility services.
+ if (result != null) {
+ long id = Binder.clearCallingIdentity();
+ try {
+ UserInfo user = mUserManager.getUserInfo(userId);
+ if (user.isManagedProfile()) {
+ userId = user.profileGroupId;
+ }
+ AccessibilityManager accessibilityManager =
+ getAccessibilityManagerForUser(userId);
+ List<AccessibilityServiceInfo> installedServices =
+ accessibilityManager.getInstalledAccessibilityServiceList();
+
+ IPackageManager pm = AppGlobals.getPackageManager();
+ if (installedServices != null) {
+ for (AccessibilityServiceInfo service : installedServices) {
+ String packageName = service.getResolveInfo().serviceInfo.packageName;
+ try {
+ ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName,
+ PackageManager.GET_UNINSTALLED_PACKAGES, userId);
+ if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
+ result.add(packageName);
+ }
+ } catch (RemoteException e) {
+ Log.i(LOG_TAG, "Accessibility service in missing package", e);
+ }
+ }
+ }
+ } finally {
+ restoreCallingIdentity(id);
+ }
+ }
+
+ return result;
+ }
+ }
+
+ private boolean checkCallerIsCurrentUserOrProfile() {
+ int callingUserId = UserHandle.getCallingUserId();
+ long token = Binder.clearCallingIdentity();
+ try {
+ UserInfo currentUser;
+ UserInfo callingUser = mUserManager.getUserInfo(callingUserId);
+ try {
+ currentUser = ActivityManagerNative.getDefault().getCurrentUser();
+ } catch (RemoteException e) {
+ Slog.e(LOG_TAG, "Failed to talk to activity managed.", e);
+ return false;
+ }
+
+ if (callingUser.isManagedProfile() && callingUser.profileGroupId != currentUser.id) {
+ Slog.e(LOG_TAG, "Cannot set permitted input methods for managed profile "
+ + "of a user that isn't the foreground user.");
+ return false;
+ }
+ if (!callingUser.isManagedProfile() && callingUserId != currentUser.id ) {
+ Slog.e(LOG_TAG, "Cannot set permitted input methods "
+ + "of a user that isn't the foreground user.");
+ return false;
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean setPermittedInputMethods(ComponentName who, List packageList) {
+ if (!mHasFeature) {
+ return false;
+ }
+ if (who == null) {
+ throw new NullPointerException("ComponentName is null");
+ }
+
+ // TODO When InputMethodManager supports per user calls remove
+ // this restriction.
+ if (!checkCallerIsCurrentUserOrProfile()) {
+ return false;
+ }
+
+ if (packageList != null) {
+ // InputMethodManager fetches input methods for current user.
+ // So this can only be set when calling user is the current user
+ // or parent is current user in case of managed profiles.
+ InputMethodManager inputMethodManager = (InputMethodManager) mContext
+ .getSystemService(Context.INPUT_METHOD_SERVICE);
+ List<InputMethodInfo> enabledImes = inputMethodManager.getEnabledInputMethodList();
+
+ if (enabledImes != null) {
+ List<String> enabledPackages = new ArrayList<String>();
+ for (InputMethodInfo ime : enabledImes) {
+ enabledPackages.add(ime.getPackageName());
+ }
+ if (!checkPackagesInPermittedListOrSystem(enabledPackages, packageList)) {
+ Slog.e(LOG_TAG, "Cannot set permitted input methods, "
+ + "because it contains already enabled input method.");
+ return false;
+ }
+ }
+ }
+
+ synchronized (this) {
+ ActiveAdmin admin = getActiveAdminForCallerLocked(who,
+ DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
+ admin.permittedInputMethods = packageList;
+ saveSettingsLocked(UserHandle.getCallingUserId());
+ }
+ return true;
+ }
+
+ @Override
+ public List getPermittedInputMethods(ComponentName who) {
+ if (!mHasFeature) {
+ return null;
+ }
+
+ if (who == null) {
+ throw new NullPointerException("ComponentName is null");
+ }
+
+ synchronized (this) {
+ ActiveAdmin admin = getActiveAdminForCallerLocked(who,
+ DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
+ return admin.permittedInputMethods;
+ }
+ }
+
+ @Override
+ public List getPermittedInputMethodsForCurrentUser() {
+ UserInfo currentUser;
+ try {
+ currentUser = ActivityManagerNative.getDefault().getCurrentUser();
+ } catch (RemoteException e) {
+ Slog.e(LOG_TAG, "Failed to make remote calls to get current user", e);
+ // Activity managed is dead, just allow all IMEs
+ return null;
+ }
+
+ int userId = currentUser.id;
+ synchronized (this) {
+ List<String> result = null;
+ // If we have multiple profiles we return the intersection of the
+ // permitted lists. This can happen in cases where we have a device
+ // and profile owner.
+ List<UserInfo> profiles = mUserManager.getProfiles(userId);
+ final int PROFILES_SIZE = profiles.size();
+ for (int i = 0; i < PROFILES_SIZE; ++i) {
+ // Just loop though all admins, only device or profiles
+ // owners can have permitted lists set.
+ DevicePolicyData policy = getUserData(profiles.get(i).id);
+ final int N = policy.mAdminList.size();
+ for (int j = 0; j < N; j++) {
+ ActiveAdmin admin = policy.mAdminList.get(j);
+ List<String> fromAdmin = admin.permittedInputMethods;
+ if (fromAdmin != null) {
+ if (result == null) {
+ result = new ArrayList<String>(fromAdmin);
+ } else {
+ result.retainAll(fromAdmin);
+ }
+ }
+ }
+ }
+
+ // If we have a permitted list add all system input methods.
+ if (result != null) {
+ InputMethodManager inputMethodManager = (InputMethodManager) mContext
+ .getSystemService(Context.INPUT_METHOD_SERVICE);
+ List<InputMethodInfo> imes = inputMethodManager.getInputMethodList();
+ long id = Binder.clearCallingIdentity();
+ try {
+ IPackageManager pm = AppGlobals.getPackageManager();
+ if (imes != null) {
+ for (InputMethodInfo ime : imes) {
+ String packageName = ime.getPackageName();
+ try {
+ ApplicationInfo applicationInfo = pm.getApplicationInfo(
+ packageName, PackageManager.GET_UNINSTALLED_PACKAGES,
+ userId);
+ if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
+ result.add(packageName);
+ }
+ } catch (RemoteException e) {
+ Log.i(LOG_TAG, "Input method for missing package", e);
+ }
+ }
+ }
+ } finally {
+ restoreCallingIdentity(id);
+ }
+ }
+ return result;
+ }
+ }
+
@Override
public UserHandle createUser(ComponentName who, String name) {
synchronized (this) {
@@ -4181,46 +4594,6 @@
}
@Override
- public int setApplicationsHidden(ComponentName who, Intent intent, boolean hidden) {
- int callingUserId = UserHandle.getCallingUserId();
- synchronized (this) {
- if (who == null) {
- throw new NullPointerException("ComponentName is null");
- }
- getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
-
- long id = Binder.clearCallingIdentity();
- try {
- IPackageManager pm = AppGlobals.getPackageManager();
- List<ResolveInfo> activitiesToEnable = pm.queryIntentActivities(intent,
- intent.resolveTypeIfNeeded(mContext.getContentResolver()),
- PackageManager.GET_DISABLED_COMPONENTS
- | PackageManager.GET_UNINSTALLED_PACKAGES,
- callingUserId);
-
- if (DBG) Slog.d(LOG_TAG, "Enabling activities: " + activitiesToEnable);
- int numberOfAppsUnhidden = 0;
- if (activitiesToEnable != null) {
- for (ResolveInfo info : activitiesToEnable) {
- if (info.activityInfo != null) {
- numberOfAppsUnhidden++;
- pm.setApplicationHiddenSettingAsUser(info.activityInfo.packageName,
- hidden, callingUserId);
- }
- }
- }
- return numberOfAppsUnhidden;
- } catch (RemoteException re) {
- // shouldn't happen
- Slog.e(LOG_TAG, "Failed to setApplicationsHiddenSettingsWithIntent", re);
- } finally {
- restoreCallingIdentity(id);
- }
- return 0;
- }
- }
-
- @Override
public boolean isApplicationHidden(ComponentName who, String packageName) {
int callingUserId = UserHandle.getCallingUserId();
synchronized (this) {
@@ -4396,7 +4769,8 @@
}
@Override
- public void setBlockUninstall(ComponentName who, String packageName, boolean blockUninstall) {
+ public void setUninstallBlocked(ComponentName who, String packageName,
+ boolean uninstallBlocked) {
final int userId = UserHandle.getCallingUserId();
synchronized (this) {
@@ -4408,7 +4782,7 @@
long id = Binder.clearCallingIdentity();
try {
IPackageManager pm = AppGlobals.getPackageManager();
- pm.setBlockUninstallForUser(packageName, blockUninstall, userId);
+ pm.setBlockUninstallForUser(packageName, uninstallBlocked, userId);
} catch (RemoteException re) {
// Shouldn't happen.
Slog.e(LOG_TAG, "Failed to setBlockUninstallForUser", re);
@@ -4419,7 +4793,7 @@
}
@Override
- public boolean getBlockUninstall(ComponentName who, String packageName) {
+ public boolean getUninstallBlocked(ComponentName who, String packageName) {
final int userId = UserHandle.getCallingUserId();
synchronized (this) {
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 22c09f0..b1c3c4a 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -793,5 +793,16 @@
* positive value success, data length of response
*/
int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
-}
+ /**
+ * Check if any mobile Radios need to be shutdown.
+ *
+ * @return true is any mobile radio needs to be shutdown
+ */
+ boolean needMobileRadioShutdown();
+
+ /**
+ * Shutdown Mobile Radios
+ */
+ void shutdownMobileRadios();
+}
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index a8a9057..e730bde 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -287,7 +287,10 @@
int RIL_REQUEST_ALLOW_DATA = 123;
int RIL_REQUEST_GET_HARDWARE_CONFIG = 124;
int RIL_REQUEST_SIM_AUTHENTICATION = 125;
+ int RIL_REQUEST_GET_DC_RT_INFO = 126;
+ int RIL_REQUEST_SET_DC_RT_INFO_RATE = 127;
int RIL_REQUEST_SET_DATA_PROFILE = 128;
+ int RIL_REQUEST_SHUTDOWN = 129;
int RIL_UNSOL_RESPONSE_BASE = 1000;
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index a01a6b6..f2db206 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -106,7 +106,24 @@
* Status: indicating join status
* @hide
*/
- public int status;
+ public int autoJoinStatus;
+
+ /**
+ * @hide
+ * Last time we blacklisted the ScanResult
+ */
+ public long blackListTimestamp;
+
+ /** @hide **/
+ public void setAutoJoinStatus(int status) {
+ if (status < 0) status = 0;
+ if (status == 0) {
+ blackListTimestamp = 0;
+ } else if (status > autoJoinStatus) {
+ blackListTimestamp = System.currentTimeMillis();
+ }
+ autoJoinStatus = status;
+ }
/**
* Status: indicating the scan result is not a result
@@ -244,7 +261,7 @@
distanceSdCm = source.distanceSdCm;
seen = source.seen;
passpoint = source.passpoint;
- status = source.status;
+ autoJoinStatus = source.autoJoinStatus;
untrusted = source.untrusted;
numConnection = source.numConnection;
numUsage = source.numUsage;
@@ -282,8 +299,8 @@
append("(cm)");
sb.append(", passpoint: ").append(passpoint != null ? "yes" : "no");
- if (status != 0) {
- sb.append(", status: ").append(status);
+ if (autoJoinStatus != 0) {
+ sb.append(", status: ").append(autoJoinStatus);
}
return sb.toString();
}
@@ -309,7 +326,7 @@
dest.writeInt(distanceCm);
dest.writeInt(distanceSdCm);
dest.writeLong(seen);
- dest.writeInt(status);
+ dest.writeInt(autoJoinStatus);
dest.writeInt(untrusted ? 1 : 0);
dest.writeInt(numConnection);
dest.writeInt(numUsage);
@@ -350,7 +367,7 @@
in.readInt()
);
sr.seen = in.readLong();
- sr.status = in.readInt();
+ sr.autoJoinStatus = in.readInt();
sr.untrusted = in.readInt() != 0;
sr.numConnection = in.readInt();
sr.numUsage = in.readInt();