Merge "Correct algorithm property name and clarify javadoc description of device unique id property." into jb-mr2-dev
diff --git a/api/current.txt b/api/current.txt
index d16fa31..76e11ae 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2198,6 +2198,7 @@
method public android.accounts.Account[] getAccounts();
method public android.accounts.Account[] getAccountsByType(java.lang.String);
method public android.accounts.AccountManagerFuture<android.accounts.Account[]> getAccountsByTypeAndFeatures(java.lang.String, java.lang.String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, android.os.Handler);
+ method public android.accounts.Account[] getAccountsByTypeForPackage(java.lang.String, java.lang.String);
method public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
method public deprecated android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
method public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, android.os.Bundle, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
@@ -4358,7 +4359,7 @@
method public boolean hasGrantedPolicy(android.content.ComponentName, int);
method public boolean isActivePasswordSufficient();
method public boolean isAdminActive(android.content.ComponentName);
- method public boolean isDeviceOwner(java.lang.String);
+ method public boolean isDeviceOwnerApp(java.lang.String);
method public void lockNow();
method public void removeActiveAdmin(android.content.ComponentName);
method public boolean resetPassword(java.lang.String, int);
@@ -13931,8 +13932,11 @@
ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig);
method public int describeContents();
method public java.lang.String getAnonymousIdentity();
+ method public java.security.cert.X509Certificate getCaCertificate();
+ method public java.security.cert.X509Certificate getClientCertificate();
method public int getEapMethod();
method public java.lang.String getIdentity();
+ method public java.lang.String getPassword();
method public int getPhase2Method();
method public java.lang.String getSubjectMatch();
method public void setAnonymousIdentity(java.lang.String);
@@ -13948,7 +13952,6 @@
}
public static final class WifiEnterpriseConfig.Eap {
- ctor public WifiEnterpriseConfig.Eap();
field public static final int NONE = -1; // 0xffffffff
field public static final int PEAP = 0; // 0x0
field public static final int PWD = 3; // 0x3
@@ -13957,7 +13960,6 @@
}
public static final class WifiEnterpriseConfig.Phase2 {
- ctor public WifiEnterpriseConfig.Phase2();
field public static final int GTC = 4; // 0x4
field public static final int MSCHAP = 2; // 0x2
field public static final int MSCHAPV2 = 3; // 0x3
@@ -17523,16 +17525,17 @@
public class StatFs {
ctor public StatFs(java.lang.String);
- method public int getAvailableBlocks();
+ method public deprecated int getAvailableBlocks();
method public long getAvailableBlocksLong();
method public long getAvailableBytes();
- method public int getBlockCount();
+ method public deprecated int getBlockCount();
method public long getBlockCountLong();
- method public int getBlockSize();
+ method public deprecated int getBlockSize();
method public long getBlockSizeLong();
- method public int getFreeBlocks();
+ method public deprecated int getFreeBlocks();
method public long getFreeBlocksLong();
method public long getFreeBytes();
+ method public long getTotalBytes();
method public void restat(java.lang.String);
}
@@ -20296,7 +20299,6 @@
method public deprecated synchronized void resize(int);
method public void setFromFieldPacker(int, android.renderscript.FieldPacker);
method public void setFromFieldPacker(int, int, android.renderscript.FieldPacker);
- method public void setIoInputNotificationHandler(android.renderscript.Allocation.IoInputNotifier);
method public void setSurface(android.view.Surface);
method public void syncAll(int);
field public static final int USAGE_GRAPHICS_CONSTANTS = 8; // 0x8
@@ -20309,10 +20311,6 @@
field public static final int USAGE_SHARED = 128; // 0x80
}
- public static abstract interface Allocation.IoInputNotifier {
- method public abstract void onBufferAvailable(android.renderscript.Allocation);
- }
-
public static final class Allocation.MipmapControl extends java.lang.Enum {
method public static android.renderscript.Allocation.MipmapControl valueOf(java.lang.String);
method public static final android.renderscript.Allocation.MipmapControl[] values();
@@ -20895,13 +20893,6 @@
method public android.renderscript.Script.LaunchOptions setX(int, int);
method public android.renderscript.Script.LaunchOptions setY(int, int);
method public android.renderscript.Script.LaunchOptions setZ(int, int);
- field protected int strategy;
- field protected int xend;
- field protected int xstart;
- field protected int yend;
- field protected int ystart;
- field protected int zend;
- field protected int zstart;
}
public class ScriptC extends android.renderscript.Script {
@@ -21127,37 +21118,6 @@
package android.security {
- public final class AndroidKeyPairGeneratorSpec implements java.security.spec.AlgorithmParameterSpec {
- method public android.content.Context getContext();
- method public java.util.Date getEndDate();
- method public java.lang.String getKeystoreAlias();
- method public java.math.BigInteger getSerialNumber();
- method public java.util.Date getStartDate();
- method public javax.security.auth.x500.X500Principal getSubjectDN();
- method public boolean isEncryptionRequired();
- }
-
- public static final class AndroidKeyPairGeneratorSpec.Builder {
- ctor public AndroidKeyPairGeneratorSpec.Builder(android.content.Context);
- method public android.security.AndroidKeyPairGeneratorSpec build();
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setAlias(java.lang.String);
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setEncryptionRequired();
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setEndDate(java.util.Date);
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setSerialNumber(java.math.BigInteger);
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setStartDate(java.util.Date);
- method public android.security.AndroidKeyPairGeneratorSpec.Builder setSubject(javax.security.auth.x500.X500Principal);
- }
-
- public final class AndroidKeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
- method public boolean isEncryptionRequired();
- }
-
- public static final class AndroidKeyStoreParameter.Builder {
- ctor public AndroidKeyStoreParameter.Builder(android.content.Context);
- method public android.security.AndroidKeyStoreParameter build();
- method public android.security.AndroidKeyStoreParameter.Builder setEncryptionRequired();
- }
-
public final class KeyChain {
ctor public KeyChain();
method public static void choosePrivateKeyAlias(android.app.Activity, android.security.KeyChainAliasCallback, java.lang.String[], java.security.Principal[], java.lang.String, int, java.lang.String);
@@ -21183,6 +21143,37 @@
ctor public KeyChainException(java.lang.Throwable);
}
+ public final class KeyPairGeneratorSpec implements java.security.spec.AlgorithmParameterSpec {
+ method public android.content.Context getContext();
+ method public java.util.Date getEndDate();
+ method public java.lang.String getKeystoreAlias();
+ method public java.math.BigInteger getSerialNumber();
+ method public java.util.Date getStartDate();
+ method public javax.security.auth.x500.X500Principal getSubjectDN();
+ method public boolean isEncryptionRequired();
+ }
+
+ public static final class KeyPairGeneratorSpec.Builder {
+ ctor public KeyPairGeneratorSpec.Builder(android.content.Context);
+ method public android.security.KeyPairGeneratorSpec build();
+ method public android.security.KeyPairGeneratorSpec.Builder setAlias(java.lang.String);
+ method public android.security.KeyPairGeneratorSpec.Builder setEncryptionRequired();
+ method public android.security.KeyPairGeneratorSpec.Builder setEndDate(java.util.Date);
+ method public android.security.KeyPairGeneratorSpec.Builder setSerialNumber(java.math.BigInteger);
+ method public android.security.KeyPairGeneratorSpec.Builder setStartDate(java.util.Date);
+ method public android.security.KeyPairGeneratorSpec.Builder setSubject(javax.security.auth.x500.X500Principal);
+ }
+
+ public final class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
+ method public boolean isEncryptionRequired();
+ }
+
+ public static final class KeyStoreParameter.Builder {
+ ctor public KeyStoreParameter.Builder(android.content.Context);
+ method public android.security.KeyStoreParameter build();
+ method public android.security.KeyStoreParameter.Builder setEncryptionRequired(boolean);
+ }
+
}
package android.service.dreams {
@@ -24447,17 +24438,6 @@
method public void set(T, V);
}
- public class PropertyValueModel extends android.util.ValueModel {
- method public T get();
- method public H getHost();
- method public android.util.Property<H, T> getProperty();
- method public java.lang.Class<T> getType();
- method public static android.util.PropertyValueModel<H, T> of(H, android.util.Property<H, T>);
- method public static android.util.PropertyValueModel<H, T> of(H, java.lang.Class<T>, java.lang.String);
- method public static android.util.PropertyValueModel of(java.lang.Object, java.lang.String);
- method public void set(T);
- }
-
public class SparseArray implements java.lang.Cloneable {
ctor public SparseArray();
ctor public SparseArray(int);
@@ -24624,14 +24604,6 @@
field public int type;
}
- public abstract class ValueModel {
- ctor protected ValueModel();
- method public abstract T get();
- method public abstract java.lang.Class<T> getType();
- method public abstract void set(T);
- field public static final android.util.ValueModel EMPTY;
- }
-
public class Xml {
method public static android.util.AttributeSet asAttributeSet(org.xmlpull.v1.XmlPullParser);
method public static android.util.Xml.Encoding findEncodingByName(java.lang.String) throws java.io.UnsupportedEncodingException;
@@ -29097,12 +29069,10 @@
method public abstract void onSelectedDayChange(android.widget.CalendarView, int, int, int);
}
- public class CheckBox extends android.widget.CompoundButton implements android.widget.ValueEditor {
+ public class CheckBox extends android.widget.CompoundButton {
ctor public CheckBox(android.content.Context);
ctor public CheckBox(android.content.Context, android.util.AttributeSet);
ctor public CheckBox(android.content.Context, android.util.AttributeSet, int);
- method public android.util.ValueModel<java.lang.Boolean> getValueModel();
- method public void setValueModel(android.util.ValueModel<java.lang.Boolean>);
}
public abstract interface Checkable {
@@ -29275,16 +29245,14 @@
method public void setSize(int, int);
}
- public class EditText extends android.widget.TextView implements android.widget.ValueEditor {
+ public class EditText extends android.widget.TextView {
ctor public EditText(android.content.Context);
ctor public EditText(android.content.Context, android.util.AttributeSet);
ctor public EditText(android.content.Context, android.util.AttributeSet, int);
method public void extendSelection(int);
- method public android.util.ValueModel<java.lang.CharSequence> getValueModel();
method public void selectAll();
method public void setSelection(int, int);
method public void setSelection(int);
- method public void setValueModel(android.util.ValueModel<java.lang.CharSequence>);
}
public abstract interface ExpandableListAdapter {
@@ -30313,13 +30281,11 @@
method public abstract java.lang.Object[] getSections();
}
- public class SeekBar extends android.widget.AbsSeekBar implements android.widget.ValueEditor {
+ public class SeekBar extends android.widget.AbsSeekBar {
ctor public SeekBar(android.content.Context);
ctor public SeekBar(android.content.Context, android.util.AttributeSet);
ctor public SeekBar(android.content.Context, android.util.AttributeSet, int);
- method public android.util.ValueModel<java.lang.Integer> getValueModel();
method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener);
- method public void setValueModel(android.util.ValueModel<java.lang.Integer>);
}
public static abstract interface SeekBar.OnSeekBarChangeListener {
@@ -30907,11 +30873,6 @@
method public android.widget.TextView getText2();
}
- public abstract interface ValueEditor {
- method public abstract android.util.ValueModel<T> getValueModel();
- method public abstract void setValueModel(android.util.ValueModel<T>);
- }
-
public class VideoView extends android.view.SurfaceView implements android.widget.MediaController.MediaPlayerControl {
ctor public VideoView(android.content.Context);
ctor public VideoView(android.content.Context, android.util.AttributeSet);
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java
index 241a64a..b4a12c4 100644
--- a/core/java/android/accounts/AccountManager.java
+++ b/core/java/android/accounts/AccountManager.java
@@ -405,6 +405,23 @@
}
/**
+ * Returns the accounts visible to the specified package, in an environment where some apps
+ * are not authorized to view all accounts. This method can only be called by system apps.
+ * @param type The type of accounts to return, null to retrieve all accounts
+ * @param packageName The package name of the app for which the accounts are to be returned
+ * @return An array of {@link Account}, one per matching account. Empty
+ * (never null) if no accounts of the specified type have been added.
+ */
+ public Account[] getAccountsByTypeForPackage(String type, String packageName) {
+ try {
+ return mService.getAccountsByTypeForPackage(type, packageName);
+ } catch (RemoteException re) {
+ // possible security exception
+ throw new RuntimeException(re);
+ }
+ }
+
+ /**
* Lists all accounts of a particular type. The account type is a
* string token corresponding to the authenticator and useful domain
* of the account. For example, there are types corresponding to Google
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index 2aba163..58eb66f 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -34,13 +34,11 @@
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Toast;
import com.android.internal.R;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
@@ -110,6 +108,7 @@
private static final String KEY_INSTANCE_STATE_EXISTING_ACCOUNTS = "existingAccounts";
private static final String KEY_INSTANCE_STATE_SELECTED_ACCOUNT_NAME = "selectedAccountName";
private static final String KEY_INSTANCE_STATE_SELECTED_ADD_ACCOUNT = "selectedAddAccount";
+ private static final String KEY_INSTANCE_STATE_ACCOUNT_LIST = "accountList";
private static final int SELECTED_ITEM_NONE = -1;
@@ -169,6 +168,7 @@
mSelectedAddNewAccount = savedInstanceState.getBoolean(
KEY_INSTANCE_STATE_SELECTED_ADD_ACCOUNT, false);
+ mAccounts = savedInstanceState.getParcelableArrayList(KEY_INSTANCE_STATE_ACCOUNT_LIST);
} else {
mPendingRequest = REQUEST_NULL;
mExistingAccounts = null;
@@ -266,6 +266,7 @@
mAccounts.get(mSelectedItemIndex).name);
}
}
+ outState.putParcelableArrayList(KEY_INSTANCE_STATE_ACCOUNT_LIST, mAccounts);
}
public void onCancelButtonClicked(View view) {
diff --git a/core/java/android/accounts/IAccountManager.aidl b/core/java/android/accounts/IAccountManager.aidl
index 8141813..86e279f 100644
--- a/core/java/android/accounts/IAccountManager.aidl
+++ b/core/java/android/accounts/IAccountManager.aidl
@@ -32,6 +32,7 @@
AuthenticatorDescription[] getAuthenticatorTypes();
Account[] getAccounts(String accountType);
Account[] getAccountsForPackage(String packageName, int uid);
+ Account[] getAccountsByTypeForPackage(String type, String packageName);
Account[] getAccountsAsUser(String accountType, int userId);
void hasFeatures(in IAccountManagerResponse response, in Account account, in String[] features);
void getAccountsByFeatures(in IAccountManagerResponse response, String accountType, in String[] features);
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 8284b2c..17e8dd9 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -1537,14 +1537,21 @@
return false;
}
+
/**
- * Used to determine if a particular package has been registered as a Device Owner admin.
- * Device Owner admins cannot be deactivated by the user unless the Device Owner itself allows
- * it. And Device Owner packages cannot be uninstalled, once registered.
- * @param packageName the package name to check against the registered device owner.
- * @return whether or not the package is registered as the Device Owner.
+ * Used to determine if a particular package has been registered as a Device Owner app.
+ * A device owner app is a special device admin that cannot be deactivated by the user, once
+ * activated as a device admin. It also cannot be uninstalled. To check if a particular
+ * package is currently registered as the device owner app, pass in the package name from
+ * {@link Context#getPackageName()} to this method.<p/>This is useful for device
+ * admin apps that want to check if they are also registered as the device owner app. The
+ * exact mechanism by which a device admin app is registered as a device owner app is defined by
+ * the setup process.
+ * @param packageName the package name of the app, to compare with the registered device owner
+ * app, if any.
+ * @return whether or not the package is registered as the device owner app.
*/
- public boolean isDeviceOwner(String packageName) {
+ public boolean isDeviceOwnerApp(String packageName) {
if (mService != null) {
try {
return mService.isDeviceOwner(packageName);
@@ -1555,6 +1562,14 @@
return false;
}
+ /**
+ * @hide
+ * Redirect to isDeviceOwnerApp.
+ */
+ public boolean isDeviceOwner(String packageName) {
+ return isDeviceOwnerApp(packageName);
+ }
+
/** @hide */
public String getDeviceOwner() {
if (mService != null) {
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 1ab1eb8..67bd952 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2425,8 +2425,8 @@
* which is of type <code>ArrayList<RestrictionEntry></code>. It can also
* contain an extra {@link #EXTRA_RESTRICTIONS_INTENT}, which is of type <code>Intent</code>.
* The activity specified by that intent will be launched for a result which must contain
- * the extra {@link #EXTRA_RESTRICTIONS_LIST}. The keys and values of the returned restrictions
- * will be persisted.
+ * one of the extras {@link #EXTRA_RESTRICTIONS_LIST} or {@link #EXTRA_RESTRICTIONS_BUNDLE}.
+ * The keys and values of the returned restrictions will be persisted.
* @see RestrictionEntry
*/
public static final String ACTION_GET_RESTRICTION_ENTRIES =
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index d64bff9..d8d5f2b 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -17,6 +17,7 @@
package android.content.res;
import android.os.Trace;
+import android.view.View;
import com.android.internal.util.XmlUtils;
import org.xmlpull.v1.XmlPullParser;
@@ -80,16 +81,16 @@
private static final Object sSync = new Object();
/*package*/ static Resources mSystem = null;
-
+
// Information about preloaded resources. Note that they are not
// protected by a lock, because while preloading in zygote we are all
// single-threaded, and after that these are immutable.
- private static final LongSparseArray<Drawable.ConstantState> sPreloadedDrawables
+ private static final LongSparseArray<Drawable.ConstantState>[] sPreloadedDrawables;
+ private static final LongSparseArray<Drawable.ConstantState> sPreloadedColorDrawables
= new LongSparseArray<Drawable.ConstantState>();
private static final LongSparseArray<ColorStateList> sPreloadedColorStateLists
= new LongSparseArray<ColorStateList>();
- private static final LongSparseArray<Drawable.ConstantState> sPreloadedColorDrawables
- = new LongSparseArray<Drawable.ConstantState>();
+
private static boolean sPreloaded;
private static int sPreloadedDensity;
@@ -120,6 +121,12 @@
private CompatibilityInfo mCompatibilityInfo;
+ static {
+ sPreloadedDrawables = new LongSparseArray[2];
+ sPreloadedDrawables[0] = new LongSparseArray<Drawable.ConstantState>();
+ sPreloadedDrawables[1] = new LongSparseArray<Drawable.ConstantState>();
+ }
+
/** @hide */
public static int selectDefaultTheme(int curTheme, int targetSdkVersion) {
return selectSystemTheme(curTheme, targetSdkVersion,
@@ -1982,6 +1989,7 @@
ActivityInfo.CONFIG_LAYOUT_DIRECTION);
private boolean verifyPreloadConfig(int changingConfigurations, int resourceId, String name) {
+ // We dont want to preloadd a Drawable when there is both a LTR and RTL version of it
if (((changingConfigurations&~(ActivityInfo.CONFIG_FONT_SCALE |
ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) {
String resName;
@@ -1995,6 +2003,17 @@
+ " (" + resName + ") that varies with configuration!!");
return false;
}
+ if (TRACE_FOR_PRELOAD) {
+ String resName;
+ try {
+ resName = getResourceName(resourceId);
+ } catch (NotFoundException e) {
+ resName = "?";
+ }
+ Log.w(TAG, "Preloading " + name + " resource #0x"
+ + Integer.toHexString(resourceId)
+ + " (" + resName + ")");
+ }
return true;
}
@@ -2022,11 +2041,11 @@
if (dr != null) {
return dr;
}
-
+ final int layoutDirection = mConfiguration.getLayoutDirection();
Drawable.ConstantState cs = isColorDrawable
? sPreloadedColorDrawables.get(key)
: (sPreloadedDensity == mConfiguration.densityDpi
- ? sPreloadedDrawables.get(key) : null);
+ ? sPreloadedDrawables[layoutDirection].get(key) : null);
if (cs != null) {
dr = cs.newDrawable(this);
} else {
@@ -2100,11 +2119,12 @@
cs = dr.getConstantState();
if (cs != null) {
if (mPreloading) {
- if (verifyPreloadConfig(cs.getChangingConfigurations(), value.resourceId, "drawable")) {
+ if (verifyPreloadConfig(cs.getChangingConfigurations(), value.resourceId,
+ "drawable")) {
if (isColorDrawable) {
sPreloadedColorDrawables.put(key, cs);
} else {
- sPreloadedDrawables.put(key, cs);
+ sPreloadedDrawables[layoutDirection].put(key, cs);
}
}
} else {
diff --git a/core/java/android/net/DhcpInfo.java b/core/java/android/net/DhcpInfo.java
index 2b359eb..ab4cd9b 100644
--- a/core/java/android/net/DhcpInfo.java
+++ b/core/java/android/net/DhcpInfo.java
@@ -22,8 +22,7 @@
/**
* A simple object for retrieving the results of a DHCP request.
- * @deprecated - use LinkProperties - To be removed 11/2013
- * STOPSHIP - make sure we expose LinkProperties through ConnectivityManager
+ * @deprecated - use LinkProperties - To be removed 11/2014
*/
public class DhcpInfo implements Parcelable {
public int ipAddress;
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index d9846ec..61eef1f 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -51,6 +51,7 @@
private static final String SYSTEM_PROPERTY_EFS_ENABLED = "persist.security.efs.enabled";
private static UserEnvironment sCurrentUser;
+ private static boolean sUserRequired;
private static final Object sLock = new Object();
@@ -223,7 +224,7 @@
* @hide
*/
public static File getMediaStorageDirectory() {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getMediaStorageDirectory();
}
@@ -318,7 +319,7 @@
* @see #isExternalStorageRemovable()
*/
public static File getExternalStorageDirectory() {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageDirectory();
}
@@ -465,7 +466,7 @@
* using it such as with {@link File#mkdirs File.mkdirs()}.
*/
public static File getExternalStoragePublicDirectory(String type) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStoragePublicDirectory(type);
}
@@ -474,7 +475,7 @@
* @hide
*/
public static File getExternalStorageAndroidDataDir() {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAndroidDataDir();
}
@@ -483,7 +484,7 @@
* @hide
*/
public static File getExternalStorageAppDataDirectory(String packageName) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAppDataDirectory(packageName);
}
@@ -492,7 +493,7 @@
* @hide
*/
public static File getExternalStorageAppMediaDirectory(String packageName) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAppMediaDirectory(packageName);
}
@@ -501,7 +502,7 @@
* @hide
*/
public static File getExternalStorageAppObbDirectory(String packageName) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAppObbDirectory(packageName);
}
@@ -510,7 +511,7 @@
* @hide
*/
public static File getExternalStorageAppFilesDirectory(String packageName) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAppFilesDirectory(packageName);
}
@@ -519,7 +520,7 @@
* @hide
*/
public static File getExternalStorageAppCacheDirectory(String packageName) {
- throwIfSystem();
+ throwIfUserRequired();
return sCurrentUser.getExternalStorageAppCacheDirectory(packageName);
}
@@ -650,9 +651,15 @@
}
}
- private static void throwIfSystem() {
- if (Process.myUid() == Process.SYSTEM_UID) {
- Log.wtf(TAG, "Static storage paths aren't available from AID_SYSTEM", new Throwable());
+ /** {@hide} */
+ public static void setUserRequired(boolean userRequired) {
+ sUserRequired = userRequired;
+ }
+
+ private static void throwIfUserRequired() {
+ if (sUserRequired) {
+ Log.wtf(TAG, "Path requests must specify a user by using UserEnvironment",
+ new Throwable());
}
}
diff --git a/core/java/android/os/StatFs.java b/core/java/android/os/StatFs.java
index 60ec0d7..2314057 100644
--- a/core/java/android/os/StatFs.java
+++ b/core/java/android/os/StatFs.java
@@ -57,9 +57,9 @@
}
/**
- * The size, in bytes, of a block on the file system. This corresponds to
- * the Unix {@code statfs.f_bsize} field.
+ * @deprecated Use {@link #getBlockSizeLong()} instead.
*/
+ @Deprecated
public int getBlockSize() {
return (int) mStat.f_bsize;
}
@@ -73,27 +73,25 @@
}
/**
- * The total number of blocks on the file system. This corresponds to the
- * Unix {@code statfs.f_blocks} field.
+ * @deprecated Use {@link #getBlockCountLong()} instead.
*/
+ @Deprecated
public int getBlockCount() {
return (int) mStat.f_blocks;
}
/**
- * The size, in bytes, of a block on the file system. This corresponds to
- * the Unix {@code statfs.f_bsize} field.
+ * The total number of blocks on the file system. This corresponds to the
+ * Unix {@code statfs.f_blocks} field.
*/
public long getBlockCountLong() {
return mStat.f_blocks;
}
/**
- * The total number of blocks that are free on the file system, including
- * reserved blocks (that are not available to normal applications). This
- * corresponds to the Unix {@code statfs.f_bfree} field. Most applications
- * will want to use {@link #getAvailableBlocks()} instead.
+ * @deprecated Use {@link #getFreeBlocksLong()} instead.
*/
+ @Deprecated
public int getFreeBlocks() {
return (int) mStat.f_bfree;
}
@@ -109,17 +107,18 @@
}
/**
- * The number of bytes that are free on the file system, including
- * reserved blocks (that are not available to normal applications).
+ * The number of bytes that are free on the file system, including reserved
+ * blocks (that are not available to normal applications). Most applications
+ * will want to use {@link #getAvailableBytes()} instead.
*/
public long getFreeBytes() {
return mStat.f_bfree * mStat.f_bsize;
}
/**
- * The number of blocks that are free on the file system and available to
- * applications. This corresponds to the Unix {@code statfs.f_bavail} field.
+ * @deprecated Use {@link #getAvailableBlocksLong()} instead.
*/
+ @Deprecated
public int getAvailableBlocks() {
return (int) mStat.f_bavail;
}
@@ -139,4 +138,11 @@
public long getAvailableBytes() {
return mStat.f_bavail * mStat.f_bsize;
}
+
+ /**
+ * The total number of bytes supported by the file system.
+ */
+ public long getTotalBytes() {
+ return mStat.f_blocks * mStat.f_bsize;
+ }
}
diff --git a/core/java/android/util/PropertyValueModel.java b/core/java/android/util/PropertyValueModel.java
deleted file mode 100755
index eb9c47d..0000000
--- a/core/java/android/util/PropertyValueModel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2012 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.util;
-
-/**
- * A value model for a {@link Property property} of a host object. This class can be used for
- * both reflective and non-reflective property implementations.
- *
- * @param <H> the host type, where the host is the object that holds this property
- * @param <T> the value type
- *
- * @see Property
- * @see ValueModel
- */
-public class PropertyValueModel<H, T> extends ValueModel<T> {
- private final H mHost;
- private final Property<H, T> mProperty;
-
- private PropertyValueModel(H host, Property<H, T> property) {
- mProperty = property;
- mHost = host;
- }
-
- /**
- * Returns the host.
- *
- * @return the host
- */
- public H getHost() {
- return mHost;
- }
-
- /**
- * Returns the property.
- *
- * @return the property
- */
- public Property<H, T> getProperty() {
- return mProperty;
- }
-
- @Override
- public Class<T> getType() {
- return mProperty.getType();
- }
-
- @Override
- public T get() {
- return mProperty.get(mHost);
- }
-
- @Override
- public void set(T value) {
- mProperty.set(mHost, value);
- }
-
- /**
- * Return an appropriate PropertyValueModel for this host and property.
- *
- * @param host the host
- * @param property the property
- * @return the value model
- */
- public static <H, T> PropertyValueModel<H, T> of(H host, Property<H, T> property) {
- return new PropertyValueModel<H, T>(host, property);
- }
-
- /**
- * Return a PropertyValueModel for this {@code host} and a
- * reflective property, constructed from this {@code propertyType} and {@code propertyName}.
- *
- * @param host
- * @param propertyType the property type
- * @param propertyName the property name
- * @return a value model with this host and a reflective property with this type and name
- *
- * @see Property#of
- */
- public static <H, T> PropertyValueModel<H, T> of(H host, Class<T> propertyType,
- String propertyName) {
- return of(host, Property.of((Class<H>) host.getClass(), propertyType, propertyName));
- }
-
- private static Class getNullaryMethodReturnType(Class c, String name) {
- try {
- return c.getMethod(name).getReturnType();
- } catch (NoSuchMethodException e) {
- return null;
- }
- }
-
- private static Class getFieldType(Class c, String name) {
- try {
- return c.getField(name).getType();
- } catch (NoSuchFieldException e) {
- return null;
- }
- }
-
- private static String capitalize(String name) {
- if (name.isEmpty()) {
- return name;
- }
- return Character.toUpperCase(name.charAt(0)) + name.substring(1);
- }
-
- /**
- * Return a PropertyValueModel for this {@code host} and and {@code propertyName}.
- *
- * @param host the host
- * @param propertyName the property name
- * @return a value model with this host and a reflective property with this name
- */
- public static PropertyValueModel of(Object host, String propertyName) {
- Class clazz = host.getClass();
- String suffix = capitalize(propertyName);
- Class propertyType = getNullaryMethodReturnType(clazz, "get" + suffix);
- if (propertyType == null) {
- propertyType = getNullaryMethodReturnType(clazz, "is" + suffix);
- }
- if (propertyType == null) {
- propertyType = getFieldType(clazz, propertyName);
- }
- if (propertyType == null) {
- throw new NoSuchPropertyException(propertyName);
- }
- return of(host, propertyType, propertyName);
- }
-}
diff --git a/core/java/android/util/ValueModel.java b/core/java/android/util/ValueModel.java
deleted file mode 100755
index 4789682..0000000
--- a/core/java/android/util/ValueModel.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2012 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.util;
-
-/**
- * A ValueModel is an abstraction for a 'slot' or place in memory in which a value
- * may be stored and retrieved. A common implementation of ValueModel is a regular property of
- * an object, whose value may be retrieved by calling the appropriate <em>getter</em>
- * method and set by calling the corresponding <em>setter</em> method.
- *
- * @param <T> the value type
- *
- * @see PropertyValueModel
- */
-public abstract class ValueModel<T> {
- /**
- * The empty model should be used in place of {@code null} to indicate that a
- * model has not been set. The empty model has no value and does nothing when it is set.
- */
- public static final ValueModel EMPTY = new ValueModel() {
- @Override
- public Class getType() {
- return Object.class;
- }
-
- @Override
- public Object get() {
- return null;
- }
-
- @Override
- public void set(Object value) {
-
- }
- };
-
- protected ValueModel() {
- }
-
- /**
- * Returns the type of this property.
- *
- * @return the property type
- */
- public abstract Class<T> getType();
-
- /**
- * Returns the value of this property.
- *
- * @return the property value
- */
- public abstract T get();
-
- /**
- * Sets the value of this property.
- *
- * @param value the new value for this property
- */
- public abstract void set(T value);
-}
\ No newline at end of file
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index be26d20..a0a63a6 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2915,14 +2915,14 @@
*
* @hide
*/
- int mUserPaddingLeftInitial = 0;
+ int mUserPaddingLeftInitial;
/**
* Cache initial right padding.
*
* @hide
*/
- int mUserPaddingRightInitial = 0;
+ int mUserPaddingRightInitial;
/**
* Default undefined padding
@@ -3388,11 +3388,11 @@
break;
case com.android.internal.R.styleable.View_paddingStart:
startPadding = a.getDimensionPixelSize(attr, UNDEFINED_PADDING);
- startPaddingDefined = true;
+ startPaddingDefined = (startPadding != UNDEFINED_PADDING);
break;
case com.android.internal.R.styleable.View_paddingEnd:
endPadding = a.getDimensionPixelSize(attr, UNDEFINED_PADDING);
- endPaddingDefined = true;
+ endPaddingDefined = (endPadding != UNDEFINED_PADDING);
break;
case com.android.internal.R.styleable.View_scrollX:
x = a.getDimensionPixelOffset(attr, 0);
@@ -3712,10 +3712,12 @@
// Padding from the background drawable is stored at this point in mUserPaddingLeftInitial
// and mUserPaddingRightInitial) so drawable padding will be used as ultimate default if
// defined.
- if (leftPaddingDefined) {
+ final boolean hasRelativePadding = startPaddingDefined || endPaddingDefined;
+
+ if (leftPaddingDefined && !hasRelativePadding) {
mUserPaddingLeftInitial = leftPadding;
}
- if (rightPaddingDefined) {
+ if (rightPaddingDefined && !hasRelativePadding) {
mUserPaddingRightInitial = rightPadding;
}
}
@@ -11952,26 +11954,30 @@
// left / right or right / left depending on the resolved layout direction.
// If start / end padding are not defined, use the left / right ones.
int resolvedLayoutDirection = getLayoutDirection();
- // Set user padding to initial values ...
- mUserPaddingLeft = mUserPaddingLeftInitial;
- mUserPaddingRight = mUserPaddingRightInitial;
- // ... then resolve it.
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
if (mUserPaddingStart != UNDEFINED_PADDING) {
mUserPaddingRight = mUserPaddingStart;
+ } else {
+ mUserPaddingRight = mUserPaddingRightInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingLeft = mUserPaddingEnd;
+ } else {
+ mUserPaddingLeft = mUserPaddingLeftInitial;
}
break;
case LAYOUT_DIRECTION_LTR:
default:
if (mUserPaddingStart != UNDEFINED_PADDING) {
mUserPaddingLeft = mUserPaddingStart;
+ } else {
+ mUserPaddingLeft = mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight = mUserPaddingEnd;
+ } else {
+ mUserPaddingRight = mUserPaddingRightInitial;
}
}
diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java
index 41ab5f2..f1804f8 100644
--- a/core/java/android/widget/CheckBox.java
+++ b/core/java/android/widget/CheckBox.java
@@ -20,7 +20,6 @@
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
-import android.util.ValueModel;
/**
@@ -56,9 +55,7 @@
* {@link android.R.styleable#View View Attributes}
* </p>
*/
-public class CheckBox extends CompoundButton implements ValueEditor<Boolean> {
- private ValueModel<Boolean> mValueModel = ValueModel.EMPTY;
-
+public class CheckBox extends CompoundButton {
public CheckBox(Context context) {
this(context, null);
}
@@ -82,22 +79,4 @@
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(CheckBox.class.getName());
}
-
- @Override
- public ValueModel<Boolean> getValueModel() {
- return mValueModel;
- }
-
- @Override
- public void setValueModel(ValueModel<Boolean> valueModel) {
- mValueModel = valueModel;
- setChecked(mValueModel.get());
- }
-
- @Override
- public boolean performClick() {
- boolean handled = super.performClick();
- mValueModel.set(isChecked());
- return handled;
- }
}
diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java
index ec81214..57e51c2 100644
--- a/core/java/android/widget/EditText.java
+++ b/core/java/android/widget/EditText.java
@@ -17,7 +17,6 @@
package android.widget;
import android.content.Context;
-import android.graphics.Rect;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
@@ -25,7 +24,6 @@
import android.text.method.ArrowKeyMovementMethod;
import android.text.method.MovementMethod;
import android.util.AttributeSet;
-import android.util.ValueModel;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -49,9 +47,7 @@
* {@link android.R.styleable#TextView TextView Attributes},
* {@link android.R.styleable#View View Attributes}
*/
-public class EditText extends TextView implements ValueEditor<CharSequence> {
- private ValueModel<CharSequence> mValueModel = ValueModel.EMPTY;
-
+public class EditText extends TextView {
public EditText(Context context) {
this(context, null);
}
@@ -132,21 +128,4 @@
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(EditText.class.getName());
}
-
- @Override
- public ValueModel<CharSequence> getValueModel() {
- return mValueModel;
- }
-
- @Override
- public void setValueModel(ValueModel<CharSequence> valueModel) {
- mValueModel = valueModel;
- setText(mValueModel.get());
- }
-
- @Override
- void sendAfterTextChanged(Editable text) {
- super.sendAfterTextChanged(text);
- mValueModel.set(text);
- }
}
diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java
index a6486a8..2737f94 100644
--- a/core/java/android/widget/SeekBar.java
+++ b/core/java/android/widget/SeekBar.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.util.AttributeSet;
-import android.util.ValueModel;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -34,7 +33,7 @@
*
* @attr ref android.R.styleable#SeekBar_thumb
*/
-public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> {
+public class SeekBar extends AbsSeekBar {
/**
* A callback that notifies clients when the progress level has been
@@ -70,9 +69,8 @@
void onStopTrackingTouch(SeekBar seekBar);
}
- private ValueModel<Integer> mValueModel = ValueModel.EMPTY;
private OnSeekBarChangeListener mOnSeekBarChangeListener;
-
+
public SeekBar(Context context) {
this(context, null);
}
@@ -91,23 +89,9 @@
if (mOnSeekBarChangeListener != null) {
mOnSeekBarChangeListener.onProgressChanged(this, getProgress(), fromUser);
- if (fromUser) {
- mValueModel.set(getProgress());
- }
}
}
- @Override
- public ValueModel<Integer> getValueModel() {
- return mValueModel;
- }
-
- @Override
- public void setValueModel(ValueModel<Integer> valueModel) {
- mValueModel = valueModel;
- setProgress(mValueModel.get());
- }
-
/**
* Sets a listener to receive notifications of changes to the SeekBar's progress level. Also
* provides notifications of when the user starts and stops a touch gesture within the SeekBar.
diff --git a/core/java/android/widget/ValueEditor.java b/core/java/android/widget/ValueEditor.java
deleted file mode 100755
index 2b91abf..0000000
--- a/core/java/android/widget/ValueEditor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2012 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.widget;
-
-import android.util.ValueModel;
-
-/**
- * An interface for editors of simple values. Classes implementing this interface are normally
- * UI controls (subclasses of {@link android.view.View View}) that can provide a suitable
- * user interface to display and edit values of the specified type. This interface is
- * intended to describe editors for simple types, like {@code boolean}, {@code int} or
- * {@code String}, where the values themselves are immutable.
- * <p>
- * For example, {@link android.widget.CheckBox CheckBox} implements
- * this interface for the Boolean type as it is capable of providing an appropriate
- * mechanism for displaying and changing the value of a Boolean property.
- *
- * @param <T> the value type that this editor supports
- */
-public interface ValueEditor<T> {
- /**
- * Return the last value model that was set. If no value model has been set, the editor
- * should return the value {@link android.util.ValueModel#EMPTY}.
- *
- * @return the value model
- */
- public ValueModel<T> getValueModel();
-
- /**
- * Sets the value model for this editor. When the value model is set, the editor should
- * retrieve the value from the value model, using {@link android.util.ValueModel#get()},
- * and set its internal state accordingly. Likewise, when the editor's internal state changes
- * it should update the value model by calling {@link android.util.ValueModel#set(T)}
- * with the appropriate value.
- *
- * @param valueModel the new value model for this editor.
- */
- public void setValueModel(ValueModel<T> valueModel);
-}
diff --git a/docs/html/about/versions/android-1.1.jd b/docs/html/about/versions/android-1.1.jd
index b61f186..b2a1615 100644
--- a/docs/html/about/versions/android-1.1.jd
+++ b/docs/html/about/versions/android-1.1.jd
@@ -1,4 +1,5 @@
page.title=Android 1.1 Version Notes
+excludeFromSuggestions=true
sdk.version=1.1_r1
sys.date=February 2009
@jd:body
diff --git a/docs/html/about/versions/android-1.5-highlights.jd b/docs/html/about/versions/android-1.5-highlights.jd
index ff64e8c..dd4d218 100644
--- a/docs/html/about/versions/android-1.5-highlights.jd
+++ b/docs/html/about/versions/android-1.5-highlights.jd
@@ -1,4 +1,5 @@
page.title=Android 1.5 Platform Highlights
+excludeFromSuggestions=true
@jd:body
<p>
diff --git a/docs/html/about/versions/android-1.5.jd b/docs/html/about/versions/android-1.5.jd
index 78dcbd7..ca8771b 100644
--- a/docs/html/about/versions/android-1.5.jd
+++ b/docs/html/about/versions/android-1.5.jd
@@ -1,4 +1,5 @@
page.title=Android 1.5 Platform
+excludeFromSuggestions=true
sdk.platform.version=1.5
sdk.platform.apiLevel=3
sdk.platform.majorMinor=major
diff --git a/docs/html/about/versions/android-1.6-highlights.jd b/docs/html/about/versions/android-1.6-highlights.jd
index 0c56e8e..88c0f55 100644
--- a/docs/html/about/versions/android-1.6-highlights.jd
+++ b/docs/html/about/versions/android-1.6-highlights.jd
@@ -1,4 +1,5 @@
page.title=Android 1.6 Platform Highlights
+excludeFromSuggestions=true
sdk.date=September 2009
@jd:body
diff --git a/docs/html/about/versions/android-1.6.jd b/docs/html/about/versions/android-1.6.jd
index 2a66cd3..313b77a 100644
--- a/docs/html/about/versions/android-1.6.jd
+++ b/docs/html/about/versions/android-1.6.jd
@@ -1,4 +1,5 @@
page.title=Android 1.6 Platform
+excludeFromSuggestions=true
sdk.platform.version=1.6
sdk.platform.apiLevel=4
sdk.platform.majorMinor=minor
diff --git a/docs/html/about/versions/android-2.0-highlights.jd b/docs/html/about/versions/android-2.0-highlights.jd
index bec49a3..3b23e4d 100644
--- a/docs/html/about/versions/android-2.0-highlights.jd
+++ b/docs/html/about/versions/android-2.0-highlights.jd
@@ -1,4 +1,5 @@
page.title=Android 2.0 Platform Highlights
+excludeFromSuggestions=true
sdk.date=October 2009
@jd:body
diff --git a/docs/html/about/versions/android-2.0.1.jd b/docs/html/about/versions/android-2.0.1.jd
index bcba717..ba00231 100644
--- a/docs/html/about/versions/android-2.0.1.jd
+++ b/docs/html/about/versions/android-2.0.1.jd
@@ -1,4 +1,5 @@
page.title=Android 2.0.1, Release 1
+excludeFromSuggestions=true
sdk.platform.version=2.0.1
sdk.platform.apiLevel=6
sdk.platform.majorMinor=minor
diff --git a/docs/html/about/versions/android-2.0.jd b/docs/html/about/versions/android-2.0.jd
index 7a12e48..82bb78f 100644
--- a/docs/html/about/versions/android-2.0.jd
+++ b/docs/html/about/versions/android-2.0.jd
@@ -1,4 +1,5 @@
page.title=Android 2.0, Release 1
+excludeFromSuggestions=true
sdk.platform.version=2.0
sdk.platform.apiLevel=5
sdk.platform.majorMinor=major
diff --git a/docs/html/about/versions/android-2.1.jd b/docs/html/about/versions/android-2.1.jd
index 3cb0708..2d5988a 100644
--- a/docs/html/about/versions/android-2.1.jd
+++ b/docs/html/about/versions/android-2.1.jd
@@ -1,4 +1,5 @@
page.title=Android 2.1 Platform
+excludeFromSuggestions=true
sdk.platform.version=2.1
sdk.platform.apiLevel=7
sdk.platform.majorMinor=minor
diff --git a/docs/html/about/versions/android-2.2-highlights.jd b/docs/html/about/versions/android-2.2-highlights.jd
index 334d036..afbf26b 100644
--- a/docs/html/about/versions/android-2.2-highlights.jd
+++ b/docs/html/about/versions/android-2.2-highlights.jd
@@ -1,4 +1,5 @@
page.title=Android 2.2 Platform Highlights
+excludeFromSuggestions=true
@jd:body
diff --git a/docs/html/about/versions/android-2.2.jd b/docs/html/about/versions/android-2.2.jd
index 64ddca4..bd0f071 100644
--- a/docs/html/about/versions/android-2.2.jd
+++ b/docs/html/about/versions/android-2.2.jd
@@ -1,4 +1,5 @@
page.title=Android 2.2 APIs
+excludeFromSuggestions=true
sdk.platform.version=2.2
sdk.platform.apiLevel=8
sdk.platform.majorMinor=minor
diff --git a/docs/html/about/versions/android-2.3.3.jd b/docs/html/about/versions/android-2.3.3.jd
index 3b40831..eec0735 100644
--- a/docs/html/about/versions/android-2.3.3.jd
+++ b/docs/html/about/versions/android-2.3.3.jd
@@ -1,4 +1,5 @@
page.title=Android 2.3.3 APIs
+excludeFromSuggestions=true
sdk.platform.version=2.3.3
sdk.platform.apiLevel=10
diff --git a/docs/html/about/versions/android-2.3.4.jd b/docs/html/about/versions/android-2.3.4.jd
index b80b4b2..963df9a 100644
--- a/docs/html/about/versions/android-2.3.4.jd
+++ b/docs/html/about/versions/android-2.3.4.jd
@@ -1,4 +1,5 @@
page.title=Android 2.3.4 APIs
+excludeFromSuggestions=true
sdk.platform.version=2.3.4
sdk.platform.apiLevel=10
diff --git a/docs/html/about/versions/android-2.3.jd b/docs/html/about/versions/android-2.3.jd
index 4feff51..4b8ef91 100644
--- a/docs/html/about/versions/android-2.3.jd
+++ b/docs/html/about/versions/android-2.3.jd
@@ -1,4 +1,5 @@
page.title=Android 2.3 APIs
+excludeFromSuggestions=true
sdk.platform.version=2.3
sdk.platform.apiLevel=9
diff --git a/docs/html/about/versions/android-3.0.jd b/docs/html/about/versions/android-3.0.jd
index d0b41d3..f319fed 100644
--- a/docs/html/about/versions/android-3.0.jd
+++ b/docs/html/about/versions/android-3.0.jd
@@ -1,4 +1,5 @@
page.title=Android 3.0 APIs
+excludeFromSuggestions=true
sdk.platform.version=3.0
sdk.platform.apiLevel=11
@jd:body
diff --git a/docs/html/about/versions/android-3.1.jd b/docs/html/about/versions/android-3.1.jd
index 8681327..c22dfaa 100644
--- a/docs/html/about/versions/android-3.1.jd
+++ b/docs/html/about/versions/android-3.1.jd
@@ -1,4 +1,5 @@
page.title=Android 3.1 APIs
+excludeFromSuggestions=true
sdk.platform.version=3.1
sdk.platform.apiLevel=12
@jd:body
diff --git a/docs/html/about/versions/android-3.2.jd b/docs/html/about/versions/android-3.2.jd
index 17f4d85..ef95337 100644
--- a/docs/html/about/versions/android-3.2.jd
+++ b/docs/html/about/versions/android-3.2.jd
@@ -1,4 +1,5 @@
page.title=Android 3.2 APIs
+excludeFromSuggestions=true
sdk.platform.version=3.2
sdk.platform.apiLevel=13
@jd:body
diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd
index dc69c99..5fa8547 100644
--- a/docs/html/about/versions/android-4.0.3.jd
+++ b/docs/html/about/versions/android-4.0.3.jd
@@ -1,4 +1,5 @@
page.title=Android 4.0.3 APIs
+excludeFromSuggestions=true
sdk.platform.version=4.0.3
sdk.platform.apiLevel=15
@jd:body
diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd
index 868227a..1d81bc2 100644
--- a/docs/html/about/versions/android-4.0.jd
+++ b/docs/html/about/versions/android-4.0.jd
@@ -1,4 +1,5 @@
page.title=Android 4.0 APIs
+excludeFromSuggestions=true
sdk.platform.version=4.0
sdk.platform.apiLevel=14
@jd:body
diff --git a/docs/html/about/versions/android-4.1.jd b/docs/html/about/versions/android-4.1.jd
index 60ed7f0..060f0f4 100644
--- a/docs/html/about/versions/android-4.1.jd
+++ b/docs/html/about/versions/android-4.1.jd
@@ -1,4 +1,5 @@
page.title=Android 4.1 APIs
+excludeFromSuggestions=true
sdk.platform.version=4.1
sdk.platform.apiLevel=16
@jd:body
diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd
index b02c1d1..73d51c5 100644
--- a/docs/html/about/versions/android-4.2.jd
+++ b/docs/html/about/versions/android-4.2.jd
@@ -1,4 +1,5 @@
page.title=Android 4.2 APIs
+excludeFromSuggestions=true
sdk.platform.version=4.2
sdk.platform.apiLevel=17
@jd:body
diff --git a/docs/html/distribute/googleplay/promote/brand.jd b/docs/html/distribute/googleplay/promote/brand.jd
index cea6d2c..265584f 100644
--- a/docs/html/distribute/googleplay/promote/brand.jd
+++ b/docs/html/distribute/googleplay/promote/brand.jd
@@ -172,5 +172,22 @@
see <a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to your products</a></p>
-<p>If you are not sure you meet these brand guidelines, <a href=
- "http://services.google.com/permissions/application">please contact us</a>. </p>
+
+<h2 id="Questions">Questions</h2>
+
+<p>To view our full guidelines or for any further brand usage questions, please contact our
+Android Partner Marketing team:</p>
+<ul>
+ <li>For North and South America, please contact <a
+ href="mailto:android-brand-approvals@google.com?Subject=Brand%20Approval%20Questions"
+ >android-brand-approvals@google.com</a></li>
+
+ <li>For Europe and Emerging Markets, please contact <a
+ href="mailto:emea-android-brand@google.com?Subject=Brand%20Approval%20Questions"
+ >emea-android-brand@google.com</a></li>
+
+ <li>For Asia and Pacific-America, please contact <a
+ href="mailto:apac-android-brand-approvals@google.com?Subject=Brand%20Approval%20Questions"
+ >apac-android-brand-approvals@google.com</a></li>
+</ul>
+
diff --git a/docs/html/google/gcm/gs.jd b/docs/html/google/gcm/gs.jd
index 5d34641..e96b204 100644
--- a/docs/html/google/gcm/gs.jd
+++ b/docs/html/google/gcm/gs.jd
@@ -1,4 +1,5 @@
page.title=GCM: Getting Started
+page.tags="cloud","push","messaging"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play-services/auth.jd b/docs/html/google/play-services/auth.jd
index 8e11131..3ccc81a 100644
--- a/docs/html/google/play-services/auth.jd
+++ b/docs/html/google/play-services/auth.jd
@@ -1,4 +1,5 @@
page.title=Authorization
+page.tags="AccountManager","oauth2"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play-services/maps.jd b/docs/html/google/play-services/maps.jd
index 5a4aaf4..965444a 100644
--- a/docs/html/google/play-services/maps.jd
+++ b/docs/html/google/play-services/maps.jd
@@ -1,4 +1,5 @@
page.title=Google Maps Android API
+page.tags="mapview","location"
header.hide=1
@jd:body
diff --git a/docs/html/google/play-services/plus.jd b/docs/html/google/play-services/plus.jd
index de921be..e126dad 100644
--- a/docs/html/google/play-services/plus.jd
+++ b/docs/html/google/play-services/plus.jd
@@ -1,4 +1,5 @@
page.title=Google+ Platform for Android
+page.tags="authentication","signin","social"
header.hide=1
@jd:body
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index 0cf2df3..a960a18 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -1,4 +1,4 @@
-page.title=Setup
+page.title=Setup Google Play Services SDK
@jd:body
diff --git a/docs/html/guide/appendix/app-intents.jd b/docs/html/guide/appendix/app-intents.jd
index 110196c..8898927 100644
--- a/docs/html/guide/appendix/app-intents.jd
+++ b/docs/html/guide/appendix/app-intents.jd
@@ -1,4 +1,5 @@
page.title=Reference of Available Intents
+excludeFromSuggestions=true
@jd:body
<p>This document describes the default applications and settings that Google provides
diff --git a/docs/html/guide/appendix/g-app-intents.jd b/docs/html/guide/appendix/g-app-intents.jd
index 10ec01e..9ec72db 100644
--- a/docs/html/guide/appendix/g-app-intents.jd
+++ b/docs/html/guide/appendix/g-app-intents.jd
@@ -1,4 +1,5 @@
page.title=Intents List: Invoking Google Applications on Android Devices
+excludeFromSuggestions=true
@jd:body
<div class="sidebox-wrapper">
diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd
index 94cb0f0..af60eb7 100644
--- a/docs/html/guide/appendix/glossary.jd
+++ b/docs/html/guide/appendix/glossary.jd
@@ -1,4 +1,5 @@
page.title=Glossary
+excludeFromSuggestions=true
@jd:body
<p>The list below defines some of the basic terminology of the Android platform. </p>
diff --git a/docs/html/guide/practices/compatibility.jd b/docs/html/guide/practices/compatibility.jd
index bc58403..9e3d461 100644
--- a/docs/html/guide/practices/compatibility.jd
+++ b/docs/html/guide/practices/compatibility.jd
@@ -1,4 +1,5 @@
page.title=Android Compatibility
+excludeFromSuggestions=true
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/guide/practices/index.jd b/docs/html/guide/practices/index.jd
index 48a849a..b61272b 100644
--- a/docs/html/guide/practices/index.jd
+++ b/docs/html/guide/practices/index.jd
@@ -1,4 +1,5 @@
page.title=Best Practices
+excludeFromSuggestions=true
page.landing=true
page.landing.intro=Design and build apps the right way. Learn how to create apps that look great and perform well on as many devices as possible, from phones to tablets and more.
page.landing.image=
diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd
index 0dd92d9..465a847 100644
--- a/docs/html/guide/practices/optimizing-for-3.0.jd
+++ b/docs/html/guide/practices/optimizing-for-3.0.jd
@@ -1,4 +1,5 @@
page.title=Optimizing Apps for Android 3.0
+excludeFromSuggestions=true
@jd:body
diff --git a/docs/html/guide/practices/screen-compat-mode.jd b/docs/html/guide/practices/screen-compat-mode.jd
index 7f10914..e3160c39 100644
--- a/docs/html/guide/practices/screen-compat-mode.jd
+++ b/docs/html/guide/practices/screen-compat-mode.jd
@@ -1,4 +1,5 @@
page.title=Screen Compatibility Mode
+excludeFromSuggestions=true
parent.title=Supporting Multiple Screens
parent.link=screens_support.html
diff --git a/docs/html/guide/practices/screens-distribution.jd b/docs/html/guide/practices/screens-distribution.jd
index 29d2a8c..99eb04e 100644
--- a/docs/html/guide/practices/screens-distribution.jd
+++ b/docs/html/guide/practices/screens-distribution.jd
@@ -1,4 +1,5 @@
page.title=Distributing to Specific Screens
+excludeFromSuggestions=true
parent.title=Supporting Multiple Screens
parent.link=screens_support.html
diff --git a/docs/html/guide/practices/screens-support-1.5.jd b/docs/html/guide/practices/screens-support-1.5.jd
index 15f0695..ad680d9 100644
--- a/docs/html/guide/practices/screens-support-1.5.jd
+++ b/docs/html/guide/practices/screens-support-1.5.jd
@@ -1,4 +1,5 @@
page.title=Strategies for Android 1.5
+excludeFromSuggestions=true
parent.title=Supporting Multiple Screens
parent.link=screens_support.html
diff --git a/docs/html/guide/practices/seamlessness.jd b/docs/html/guide/practices/seamlessness.jd
index ec6b7fd..9679e2a 100644
--- a/docs/html/guide/practices/seamlessness.jd
+++ b/docs/html/guide/practices/seamlessness.jd
@@ -1,4 +1,5 @@
page.title=Designing for Seamlessness
+excludeFromSuggestions=true
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
index cb2bc37..f6669e4 100644
--- a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
@@ -1,4 +1,5 @@
page.title=Activity and Task Design Guidelines
+excludeFromSuggestions=true
parent.title=UI Guidelines
parent.link=index.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design.jd b/docs/html/guide/practices/ui_guidelines/icon_design.jd
index 70ae862..0726660 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design.jd
@@ -1,4 +1,5 @@
page.title=Icon Design Guidelines
+excludeFromSuggestions=true
parent.title=UI Guidelines
parent.link=index.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
index 9f835a7..831de45 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
@@ -1,4 +1,5 @@
page.title=Action Bar Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
index a2c1459..c958ed9 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
@@ -1,4 +1,5 @@
page.title=Dialog Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
index 4ec56b1..f47e186 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
@@ -1,4 +1,5 @@
page.title=Launcher Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
index 4529797..2df3a22 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
@@ -1,4 +1,5 @@
page.title=Launcher Icons (Archive)
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
index 38ceb85..29e1a93 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
@@ -1,4 +1,5 @@
page.title=List View Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
index 24bce51..a5b3597 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
@@ -1,4 +1,5 @@
page.title=Menu Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
index 4cd4db3..4993adb 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
@@ -1,4 +1,5 @@
page.title=Status Bar Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
index 5338a4d..cbe6706 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
@@ -1,4 +1,5 @@
page.title=Tab Icons
+excludeFromSuggestions=true
parent.title=Icon Design Guidelines
parent.link=icon_design.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/index.jd b/docs/html/guide/practices/ui_guidelines/index.jd
index 7603f6b..91a0725 100644
--- a/docs/html/guide/practices/ui_guidelines/index.jd
+++ b/docs/html/guide/practices/ui_guidelines/index.jd
@@ -1,4 +1,5 @@
page.title=User Interface Guidelines
+excludeFromSuggestions=true
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/menu_design.jd b/docs/html/guide/practices/ui_guidelines/menu_design.jd
index b4e2ea7..bf87bdd 100644
--- a/docs/html/guide/practices/ui_guidelines/menu_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/menu_design.jd
@@ -1,4 +1,5 @@
page.title=Menu Design Guidelines
+excludeFromSuggestions=true
parent.title=UI Guidelines
parent.link=index.html
@jd:body
diff --git a/docs/html/guide/practices/ui_guidelines/widget_design.jd b/docs/html/guide/practices/ui_guidelines/widget_design.jd
index a48d17d..cf2cd64 100644
--- a/docs/html/guide/practices/ui_guidelines/widget_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/widget_design.jd
@@ -1,4 +1,5 @@
page.title=App Widget Design Guidelines
+excludeFromSuggestions=true
parent.title=UI Guidelines
parent.link=index.html
@jd:body
diff --git a/docs/html/sdk/OLD_RELEASENOTES.jd b/docs/html/sdk/OLD_RELEASENOTES.jd
index 6865db2..b7fd12f 100644
--- a/docs/html/sdk/OLD_RELEASENOTES.jd
+++ b/docs/html/sdk/OLD_RELEASENOTES.jd
@@ -1,4 +1,5 @@
page.title=Release Notes for Older SDK Versions
+excludeFromSuggestions=true
@jd:body
<div class="special">
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index c7ece42..cbcbb12 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -1,4 +1,5 @@
page.title=SDK Release Notes
+excludeFromSuggestions=true
@jd:body
<p>This document provides version-specific information about Android SDK
diff --git a/docs/html/sdk/download.jd b/docs/html/sdk/download.jd
index 8005009..4329102 100644
--- a/docs/html/sdk/download.jd
+++ b/docs/html/sdk/download.jd
@@ -1,4 +1,5 @@
page.title=Download an Archived Android SDK
+excludeFromSuggestions=true
hide_license_footer=true
@jd:body
diff --git a/docs/html/sdk/older_releases.jd b/docs/html/sdk/older_releases.jd
index bb274b6..94baa92 100644
--- a/docs/html/sdk/older_releases.jd
+++ b/docs/html/sdk/older_releases.jd
@@ -1,4 +1,5 @@
page.title=SDK Archives
+excludeFromSuggestions=true
@jd:body
<p>This page provides a full list of archived and obsolete SDK releases,
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 5d1990a..773328c 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -1711,6 +1711,8 @@
}
/**
+ * @hide
+ *
* Interface to handle notification when new buffers are
* available via USAGE_IO_INPUT. An application will receive
* one notification when a buffer is available. Additional
@@ -1722,6 +1724,8 @@
}
/**
+ * @hide
+ *
* Set a notification handler for USAGE_IO_INPUT
*
* @param callback instance of the IoInputNotifier class to be called
diff --git a/graphics/java/android/renderscript/FieldPacker.java b/graphics/java/android/renderscript/FieldPacker.java
index decd0c7..730d973 100644
--- a/graphics/java/android/renderscript/FieldPacker.java
+++ b/graphics/java/android/renderscript/FieldPacker.java
@@ -23,6 +23,10 @@
* Utility class for packing arguments and structures from Android system objects to
* Renderscript objects.
*
+ * This class is only intended to be used to support the
+ * reflected code generated by the RS tool chain. It should not
+ * be called directly.
+ *
**/
public class FieldPacker {
public FieldPacker(int len) {
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index b4ba943..f0579ca 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -166,6 +166,15 @@
mRS.nScriptForEach(getID(mRS), slot, in_id, out_id, params);
}
+ /**
+ * Only intended for use by generated reflected code.
+ *
+ * @param slot
+ * @param ain
+ * @param aout
+ * @param v
+ * @param sc
+ */
protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v, LaunchOptions sc) {
if (ain == null && aout == null) {
throw new RSIllegalArgumentException(
@@ -310,6 +319,12 @@
mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims);
}
+ /**
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void getVarV(int index, FieldPacker v) {
mRS.nScriptGetVarV(getID(mRS), index, v.getData());
}
@@ -332,6 +347,10 @@
}
+ /**
+ * Only intended for use by generated reflected code.
+ *
+ */
public static class FieldBase {
protected Element mElement;
protected Allocation mAllocation;
@@ -364,16 +383,29 @@
}
}
+
+ /**
+ * Class used to specify clipping for a kernel launch.
+ *
+ */
public static final class LaunchOptions {
- protected int xstart = 0;
- protected int ystart = 0;
- protected int xend = 0;
- protected int yend = 0;
- protected int zstart = 0;
- protected int zend = 0;
+ private int xstart = 0;
+ private int ystart = 0;
+ private int xend = 0;
+ private int yend = 0;
+ private int zstart = 0;
+ private int zend = 0;
+ private int strategy;
- protected int strategy;
-
+ /**
+ * Set the X range. If the end value is set to 0 the X dimension is not
+ * clipped.
+ *
+ * @param xstartArg Must be >= 0
+ * @param xendArg Must be >= xstartArg
+ *
+ * @return LaunchOptions
+ */
public LaunchOptions setX(int xstartArg, int xendArg) {
if (xstartArg < 0 || xendArg <= xstartArg) {
throw new RSIllegalArgumentException("Invalid dimensions");
@@ -383,6 +415,15 @@
return this;
}
+ /**
+ * Set the Y range. If the end value is set to 0 the Y dimension is not
+ * clipped.
+ *
+ * @param ystartArg Must be >= 0
+ * @param yendArg Must be >= ystartArg
+ *
+ * @return LaunchOptions
+ */
public LaunchOptions setY(int ystartArg, int yendArg) {
if (ystartArg < 0 || yendArg <= ystartArg) {
throw new RSIllegalArgumentException("Invalid dimensions");
@@ -392,6 +433,15 @@
return this;
}
+ /**
+ * Set the Z range. If the end value is set to 0 the Z dimension is not
+ * clipped.
+ *
+ * @param zstartArg Must be >= 0
+ * @param zendArg Must be >= zstartArg
+ *
+ * @return LaunchOptions
+ */
public LaunchOptions setZ(int zstartArg, int zendArg) {
if (zstartArg < 0 || zendArg <= zstartArg) {
throw new RSIllegalArgumentException("Invalid dimensions");
@@ -402,21 +452,51 @@
}
+ /**
+ * Returns the current X start
+ *
+ * @return int current value
+ */
public int getXStart() {
return xstart;
}
+ /**
+ * Returns the current X end
+ *
+ * @return int current value
+ */
public int getXEnd() {
return xend;
}
+ /**
+ * Returns the current Y start
+ *
+ * @return int current value
+ */
public int getYStart() {
return ystart;
}
+ /**
+ * Returns the current Y end
+ *
+ * @return int current value
+ */
public int getYEnd() {
return yend;
}
+ /**
+ * Returns the current Z start
+ *
+ * @return int current value
+ */
public int getZStart() {
return zstart;
}
+ /**
+ * Returns the current Z end
+ *
+ * @return int current value
+ */
public int getZEnd() {
return zend;
}
diff --git a/keystore/java/android/security/AndroidKeyPairGenerator.java b/keystore/java/android/security/AndroidKeyPairGenerator.java
index 6975583..43d1eb6 100644
--- a/keystore/java/android/security/AndroidKeyPairGenerator.java
+++ b/keystore/java/android/security/AndroidKeyPairGenerator.java
@@ -52,12 +52,12 @@
public class AndroidKeyPairGenerator extends KeyPairGeneratorSpi {
private android.security.KeyStore mKeyStore;
- private AndroidKeyPairGeneratorSpec mSpec;
+ private KeyPairGeneratorSpec mSpec;
/**
* Generate a KeyPair which is backed by the Android keystore service. You
* must call {@link KeyPairGenerator#initialize(AlgorithmParameterSpec)}
- * with an {@link AndroidKeyPairGeneratorSpec} as the {@code params}
+ * with an {@link KeyPairGeneratorSpec} as the {@code params}
* argument before calling this otherwise an {@code IllegalStateException}
* will be thrown.
* <p>
@@ -73,7 +73,7 @@
public KeyPair generateKeyPair() {
if (mKeyStore == null || mSpec == null) {
throw new IllegalStateException(
- "Must call initialize with an AndroidKeyPairGeneratorSpec first");
+ "Must call initialize with an android.security.KeyPairGeneratorSpec first");
}
if (((mSpec.getFlags() & KeyStore.FLAG_ENCRYPTED) != 0)
@@ -156,13 +156,13 @@
throws InvalidAlgorithmParameterException {
if (params == null) {
throw new InvalidAlgorithmParameterException(
- "must supply params of type AndroidKeyPairGenericSpec");
- } else if (!(params instanceof AndroidKeyPairGeneratorSpec)) {
+ "must supply params of type android.security.KeyPairGeneratorSpec");
+ } else if (!(params instanceof KeyPairGeneratorSpec)) {
throw new InvalidAlgorithmParameterException(
- "params must be of type AndroidKeyPairGeneratorSpec");
+ "params must be of type android.security.KeyPairGeneratorSpec");
}
- AndroidKeyPairGeneratorSpec spec = (AndroidKeyPairGeneratorSpec) params;
+ KeyPairGeneratorSpec spec = (KeyPairGeneratorSpec) params;
mSpec = spec;
mKeyStore = android.security.KeyStore.getInstance();
diff --git a/keystore/java/android/security/AndroidKeyStore.java b/keystore/java/android/security/AndroidKeyStore.java
index dcc9516..04ee8c4 100644
--- a/keystore/java/android/security/AndroidKeyStore.java
+++ b/keystore/java/android/security/AndroidKeyStore.java
@@ -209,7 +209,7 @@
}
private void setPrivateKeyEntry(String alias, PrivateKey key, Certificate[] chain,
- AndroidKeyStoreParameter params) throws KeyStoreException {
+ KeyStoreParameter params) throws KeyStoreException {
byte[] keyBytes = null;
final String pkeyAlias;
@@ -544,15 +544,16 @@
return;
}
- if (param != null && !(param instanceof AndroidKeyStoreParameter)) {
- throw new KeyStoreException("protParam should be AndroidKeyStoreParameter; was: "
+ if (param != null && !(param instanceof KeyStoreParameter)) {
+ throw new KeyStoreException(
+ "protParam should be android.security.KeyStoreParameter; was: "
+ param.getClass().getName());
}
if (entry instanceof PrivateKeyEntry) {
PrivateKeyEntry prE = (PrivateKeyEntry) entry;
setPrivateKeyEntry(alias, prE.getPrivateKey(), prE.getCertificateChain(),
- (AndroidKeyStoreParameter) param);
+ (KeyStoreParameter) param);
return;
}
diff --git a/keystore/java/android/security/AndroidKeyStoreProvider.java b/keystore/java/android/security/AndroidKeyStoreProvider.java
index 8ca301e..b17e450 100644
--- a/keystore/java/android/security/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/AndroidKeyStoreProvider.java
@@ -24,7 +24,7 @@
* @hide
*/
public class AndroidKeyStoreProvider extends Provider {
- public static final String PROVIDER_NAME = "AndroidKeyStoreProvider";
+ public static final String PROVIDER_NAME = "AndroidKeyStore";
public AndroidKeyStoreProvider() {
super(PROVIDER_NAME, 1.0, "Android KeyStore security provider");
@@ -33,6 +33,6 @@
put("KeyStore." + AndroidKeyStore.NAME, AndroidKeyStore.class.getName());
// java.security.KeyPairGenerator
- put("KeyPairGenerator." + AndroidKeyStore.NAME, AndroidKeyPairGenerator.class.getName());
+ put("KeyPairGenerator.RSA", AndroidKeyPairGenerator.class.getName());
}
}
diff --git a/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java b/keystore/java/android/security/KeyPairGeneratorSpec.java
similarity index 89%
rename from keystore/java/android/security/AndroidKeyPairGeneratorSpec.java
rename to keystore/java/android/security/KeyPairGeneratorSpec.java
index b126f03..59f89bc 100644
--- a/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java
+++ b/keystore/java/android/security/KeyPairGeneratorSpec.java
@@ -29,9 +29,9 @@
/**
* This provides the required parameters needed for initializing the
- * {@code KeyPairGenerator} that works with <a href="{@docRoot}
- * guide/topics/security/keystore.html">Android KeyStore facility</a>. The
- * Android KeyStore facility is accessed through a
+ * {@code KeyPairGenerator} that works with
+ * <a href="{@docRoot}guide/topics/security/keystore.html">Android KeyStore
+ * facility</a>. The Android KeyStore facility is accessed through a
* {@link java.security.KeyPairGenerator} API using the {@code AndroidKeyStore}
* provider. The {@code context} passed in may be used to pop up some UI to ask
* the user to unlock or initialize the Android KeyStore facility.
@@ -49,7 +49,7 @@
* The self-signed X.509 certificate may be replaced at a later time by a
* certificate signed by a real Certificate Authority.
*/
-public final class AndroidKeyPairGeneratorSpec implements AlgorithmParameterSpec {
+public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
private final String mKeystoreAlias;
private final Context mContext;
@@ -91,9 +91,9 @@
* period
* @throws IllegalArgumentException when any argument is {@code null} or
* {@code endDate} is before {@code startDate}.
- * @hide should be built with AndroidKeyPairGeneratorSpecBuilder
+ * @hide should be built with KeyPairGeneratorSpecBuilder
*/
- public AndroidKeyPairGeneratorSpec(Context context, String keyStoreAlias,
+ public KeyPairGeneratorSpec(Context context, String keyStoreAlias,
X500Principal subjectDN, BigInteger serialNumber, Date startDate, Date endDate,
int flags) {
if (context == null) {
@@ -184,7 +184,7 @@
}
/**
- * Builder class for {@link AndroidKeyPairGeneratorSpec} objects.
+ * Builder class for {@link KeyPairGeneratorSpec} objects.
* <p>
* This will build a parameter spec for use with the <a href="{@docRoot}
* guide/topics/security/keystore.html">Android KeyStore facility</a>.
@@ -198,14 +198,10 @@
* Calendar end = new Calendar();
* end.add(1, Calendar.YEAR);
*
- * AndroidKeyPairGeneratorSpec spec =
- * new AndroidKeyPairGeneratorSpec.Builder(mContext)
- * .setAlias("myKey")
- * .setSubject(new X500Principal("CN=myKey"))
- * .setSerial(BigInteger.valueOf(1337))
- * .setStartDate(start.getTime())
- * .setEndDate(end.getTime())
- * .build();
+ * KeyPairGeneratorSpec spec =
+ * new KeyPairGeneratorSpec.Builder(mContext).setAlias("myKey")
+ * .setSubject(new X500Principal("CN=myKey")).setSerial(BigInteger.valueOf(1337))
+ * .setStartDate(start.getTime()).setEndDate(end.getTime()).build();
* </pre>
*/
public final static class Builder {
@@ -309,13 +305,13 @@
}
/**
- * Builds the instance of the {@code AndroidKeyPairGeneratorSpec}.
+ * Builds the instance of the {@code KeyPairGeneratorSpec}.
*
* @throws IllegalArgumentException if a required field is missing
- * @return built instance of {@code AndroidKeyPairGeneratorSpec}
+ * @return built instance of {@code KeyPairGeneratorSpec}
*/
- public AndroidKeyPairGeneratorSpec build() {
- return new AndroidKeyPairGeneratorSpec(mContext, mKeystoreAlias, mSubjectDN,
+ public KeyPairGeneratorSpec build() {
+ return new KeyPairGeneratorSpec(mContext, mKeystoreAlias, mSubjectDN,
mSerialNumber, mStartDate, mEndDate, mFlags);
}
}
diff --git a/keystore/java/android/security/AndroidKeyStoreParameter.java b/keystore/java/android/security/KeyStoreParameter.java
similarity index 72%
rename from keystore/java/android/security/AndroidKeyStoreParameter.java
rename to keystore/java/android/security/KeyStoreParameter.java
index 44f57c4..621a605 100644
--- a/keystore/java/android/security/AndroidKeyStoreParameter.java
+++ b/keystore/java/android/security/KeyStoreParameter.java
@@ -17,7 +17,7 @@
package android.security;
import android.content.Context;
-import android.security.AndroidKeyPairGeneratorSpec.Builder;
+import android.security.KeyPairGeneratorSpec.Builder;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
@@ -26,9 +26,9 @@
/**
* This provides the optional parameters that can be specified for
- * {@code KeyStore} entries that work with <a href="{@docRoot}
- * guide/topics/security/keystore.html">Android KeyStore facility</a>. The
- * Android KeyStore facility is accessed through a
+ * {@code KeyStore} entries that work with
+ * <a href="{@docRoot}guide/topics/security/keystore.html">Android KeyStore
+ * facility</a>. The Android KeyStore facility is accessed through a
* {@link java.security.KeyStore} API using the {@code AndroidKeyStore}
* provider. The {@code context} passed in may be used to pop up some UI to ask
* the user to unlock or initialize the Android KeyStore facility.
@@ -39,15 +39,15 @@
* {@code KeyStore}.
* <p>
* Keys may be generated using the {@link KeyPairGenerator} facility with a
- * {@link AndroidKeyPairGeneratorSpec} to specify the entry's {@code alias}. A
+ * {@link KeyPairGeneratorSpec} to specify the entry's {@code alias}. A
* self-signed X.509 certificate will be attached to generated entries, but that
* may be replaced at a later time by a certificate signed by a real Certificate
* Authority.
*/
-public final class AndroidKeyStoreParameter implements ProtectionParameter {
+public final class KeyStoreParameter implements ProtectionParameter {
private int mFlags;
- private AndroidKeyStoreParameter(int flags) {
+ private KeyStoreParameter(int flags) {
mFlags = flags;
}
@@ -67,10 +67,10 @@
}
/**
- * Builder class for {@link AndroidKeyStoreParameter} objects.
+ * Builder class for {@link KeyStoreParameter} objects.
* <p>
- * This will build protection parameters for use with the <a
- * href="{@docRoot} guide/topics/security/keystore.html">Android KeyStore
+ * This will build protection parameters for use with the
+ * <a href="{@docRoot}guide/topics/security/keystore.html">Android KeyStore
* facility</a>.
* <p>
* This can be used to require that KeyStore entries be stored encrypted.
@@ -78,8 +78,9 @@
* Example:
*
* <pre class="prettyprint">
- * AndroidKeyStoreParameter params =
- * new AndroidKeyStoreParameter.Builder(mContext).setEncryptionRequired().build();
+ * KeyStoreParameter params = new KeyStoreParameter.Builder(mContext)
+ * .setEncryptionRequired()
+ * .build();
* </pre>
*/
public final static class Builder {
@@ -105,19 +106,23 @@
* screen (e.g., PIN, password) before creating or using the generated
* key is successful.
*/
- public Builder setEncryptionRequired() {
- mFlags |= KeyStore.FLAG_ENCRYPTED;
+ public Builder setEncryptionRequired(boolean required) {
+ if (required) {
+ mFlags |= KeyStore.FLAG_ENCRYPTED;
+ } else {
+ mFlags &= ~KeyStore.FLAG_ENCRYPTED;
+ }
return this;
}
/**
- * Builds the instance of the {@code AndroidKeyPairGeneratorSpec}.
+ * Builds the instance of the {@code KeyPairGeneratorSpec}.
*
* @throws IllegalArgumentException if a required field is missing
- * @return built instance of {@code AndroidKeyPairGeneratorSpec}
+ * @return built instance of {@code KeyPairGeneratorSpec}
*/
- public AndroidKeyStoreParameter build() {
- return new AndroidKeyStoreParameter(mFlags);
+ public KeyStoreParameter build() {
+ return new KeyStoreParameter(mFlags);
}
}
}
diff --git a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
index c5cf514..1582f74 100644
--- a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
+++ b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
@@ -65,7 +65,7 @@
assertFalse(mAndroidKeyStore.isUnlocked());
- mGenerator = java.security.KeyPairGenerator.getInstance("AndroidKeyStore");
+ mGenerator = java.security.KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
}
private void setupPassword() {
@@ -80,7 +80,7 @@
public void testKeyPairGenerator_Initialize_Params_Encrypted_Success() throws Exception {
setupPassword();
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -116,7 +116,7 @@
setupPassword();
mGenerator.initialize(
- new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -130,7 +130,7 @@
public void testKeyPairGenerator_GenerateKeyPair_Encrypted_Success() throws Exception {
setupPassword();
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -146,7 +146,7 @@
}
public void testKeyPairGenerator_GenerateKeyPair_Unencrypted_Success() throws Exception {
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -163,7 +163,7 @@
public void testKeyPairGenerator_GenerateKeyPair_Replaced_Success() throws Exception {
// Generate the first key
{
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -178,7 +178,7 @@
// Replace the original key
{
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_2)
.setSubject(TEST_DN_2)
.setSerialNumber(TEST_SERIAL_2)
@@ -196,7 +196,7 @@
throws Exception {
// Generate the first key
{
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(TEST_SERIAL_1)
@@ -211,7 +211,7 @@
// Attempt to replace previous key
{
- mGenerator.initialize(new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ mGenerator.initialize(new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_2)
.setSerialNumber(TEST_SERIAL_2)
diff --git a/keystore/tests/src/android/security/AndroidKeyStoreTest.java b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
index 507d41c..8798fb5 100644
--- a/keystore/tests/src/android/security/AndroidKeyStoreTest.java
+++ b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
@@ -1232,8 +1232,8 @@
try {
mKeyStore.setEntry(TEST_ALIAS_1, entry,
- new AndroidKeyStoreParameter.Builder(getContext())
- .setEncryptionRequired()
+ new KeyStoreParameter.Builder(getContext())
+ .setEncryptionRequired(true)
.build());
fail("Shouldn't be able to insert encrypted entry when KeyStore uninitialized");
} catch (KeyStoreException expected) {
@@ -1752,8 +1752,10 @@
Entry entry = mKeyStore.getEntry(TEST_ALIAS_1, null);
try {
- mKeyStore.setEntry(TEST_ALIAS_1, entry, new AndroidKeyStoreParameter.Builder(
- getContext()).setEncryptionRequired().build());
+ mKeyStore.setEntry(TEST_ALIAS_1, entry,
+ new KeyStoreParameter.Builder(getContext())
+ .setEncryptionRequired(true)
+ .build());
fail("Should not allow setting of Entry without unlocked keystore");
} catch (KeyStoreException success) {
}
@@ -1762,8 +1764,8 @@
assertTrue(mAndroidKeyStore.isUnlocked());
mKeyStore.setEntry(TEST_ALIAS_1, entry,
- new AndroidKeyStoreParameter.Builder(getContext())
- .setEncryptionRequired()
+ new KeyStoreParameter.Builder(getContext())
+ .setEncryptionRequired(true)
.build());
}
}
diff --git a/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java b/keystore/tests/src/android/security/KeyPairGeneratorSpecTest.java
similarity index 83%
rename from keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java
rename to keystore/tests/src/android/security/KeyPairGeneratorSpecTest.java
index 5d4ab9c..113d730 100644
--- a/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java
+++ b/keystore/tests/src/android/security/KeyPairGeneratorSpecTest.java
@@ -23,7 +23,7 @@
import javax.security.auth.x500.X500Principal;
-public class AndroidKeyPairGeneratorSpecTest extends AndroidTestCase {
+public class KeyPairGeneratorSpecTest extends AndroidTestCase {
private static final String TEST_ALIAS_1 = "test1";
private static final X500Principal TEST_DN_1 = new X500Principal("CN=test1");
@@ -39,8 +39,8 @@
private static final Date NOW_PLUS_10_YEARS = new Date(NOW.getYear() + 10, 0, 1);
public void testConstructor_Success() throws Exception {
- AndroidKeyPairGeneratorSpec spec =
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1,
+ KeyPairGeneratorSpec spec =
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1,
NOW, NOW_PLUS_10_YEARS, 0);
assertEquals("Context should be the one specified", getContext(), spec.getContext());
@@ -55,7 +55,7 @@
}
public void testBuilder_Success() throws Exception {
- AndroidKeyPairGeneratorSpec spec = new AndroidKeyPairGeneratorSpec.Builder(getContext())
+ KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(getContext())
.setAlias(TEST_ALIAS_1)
.setSubject(TEST_DN_1)
.setSerialNumber(SERIAL_1)
@@ -79,7 +79,7 @@
public void testConstructor_NullContext_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(null, TEST_ALIAS_1, TEST_DN_1, SERIAL_1, NOW,
+ new KeyPairGeneratorSpec(null, TEST_ALIAS_1, TEST_DN_1, SERIAL_1, NOW,
NOW_PLUS_10_YEARS, 0);
fail("Should throw IllegalArgumentException when context is null");
} catch (IllegalArgumentException success) {
@@ -88,7 +88,7 @@
public void testConstructor_NullKeystoreAlias_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), null, TEST_DN_1, SERIAL_1, NOW,
+ new KeyPairGeneratorSpec(getContext(), null, TEST_DN_1, SERIAL_1, NOW,
NOW_PLUS_10_YEARS, 0);
fail("Should throw IllegalArgumentException when keystoreAlias is null");
} catch (IllegalArgumentException success) {
@@ -97,7 +97,7 @@
public void testConstructor_NullSubjectDN_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, null, SERIAL_1, NOW,
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, null, SERIAL_1, NOW,
NOW_PLUS_10_YEARS, 0);
fail("Should throw IllegalArgumentException when subjectDN is null");
} catch (IllegalArgumentException success) {
@@ -106,7 +106,7 @@
public void testConstructor_NullSerial_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, null, NOW,
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, null, NOW,
NOW_PLUS_10_YEARS, 0);
fail("Should throw IllegalArgumentException when startDate is null");
} catch (IllegalArgumentException success) {
@@ -115,7 +115,7 @@
public void testConstructor_NullStartDate_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1, null,
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1, null,
NOW_PLUS_10_YEARS, 0);
fail("Should throw IllegalArgumentException when startDate is null");
} catch (IllegalArgumentException success) {
@@ -124,7 +124,7 @@
public void testConstructor_NullEndDate_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1, NOW,
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1, NOW,
null, 0);
fail("Should throw IllegalArgumentException when keystoreAlias is null");
} catch (IllegalArgumentException success) {
@@ -133,7 +133,7 @@
public void testConstructor_EndBeforeStart_Failure() throws Exception {
try {
- new AndroidKeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1,
+ new KeyPairGeneratorSpec(getContext(), TEST_ALIAS_1, TEST_DN_1, SERIAL_1,
NOW_PLUS_10_YEARS, NOW, 0);
fail("Should throw IllegalArgumentException when end is before start");
} catch (IllegalArgumentException success) {
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 7f3fc43..0fb3244 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -18,6 +18,7 @@
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.AppOpsManager;
+import android.app.IUiModeManager;
import android.app.ProgressDialog;
import android.app.SearchManager;
import android.app.UiModeManager;
@@ -31,6 +32,7 @@
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -125,6 +127,11 @@
static final boolean SHOW_STARTING_ANIMATIONS = true;
static final boolean SHOW_PROCESSES_ON_ALT_MENU = false;
+ // Whether to allow dock apps with METADATA_DOCK_HOME to temporarily take over the Home key.
+ // No longer recommended for desk docks; still useful in car docks.
+ static final boolean ENABLE_CAR_DOCK_HOME_CAPTURE = true;
+ static final boolean ENABLE_DESK_DOCK_HOME_CAPTURE = false;
+
static final int LONG_PRESS_POWER_NOTHING = 0;
static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1;
static final int LONG_PRESS_POWER_SHUT_OFF = 2;
@@ -247,6 +254,7 @@
boolean mSystemReady;
boolean mSystemBooted;
boolean mHdmiPlugged;
+ int mUiMode;
int mDockMode = Intent.EXTRA_DOCK_STATE_UNDOCKED;
int mLidOpenRotation;
int mCarDockRotation;
@@ -832,6 +840,8 @@
mSettingsObserver.observe();
mShortcutManager = new ShortcutManager(context, mHandler);
mShortcutManager.observe();
+ mUiMode = context.getResources().getInteger(
+ com.android.internal.R.integer.config_defaultUiModeType);
mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
@@ -3951,6 +3961,13 @@
if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction())) {
mDockMode = intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
Intent.EXTRA_DOCK_STATE_UNDOCKED);
+ } else {
+ try {
+ IUiModeManager uiModeService = IUiModeManager.Stub.asInterface(
+ ServiceManager.getService(Context.UI_MODE_SERVICE));
+ mUiMode = uiModeService.getCurrentModeType();
+ } catch (RemoteException e) {
+ }
}
updateRotation(true);
synchronized (mLock) {
@@ -4587,9 +4604,70 @@
}
}
+ /**
+ * Return an Intent to launch the currently active dock app as home. Returns
+ * null if the standard home should be launched, which is the case if any of the following is
+ * true:
+ * <ul>
+ * <li>The device is not in either car mode or desk mode
+ * <li>The device is in car mode but ENABLE_CAR_DOCK_HOME_CAPTURE is false
+ * <li>The device is in desk mode but ENABLE_DESK_DOCK_HOME_CAPTURE is false
+ * <li>The device is in car mode but there's no CAR_DOCK app with METADATA_DOCK_HOME
+ * <li>The device is in desk mode but there's no DESK_DOCK app with METADATA_DOCK_HOME
+ * </ul>
+ * @return
+ */
+ Intent createHomeDockIntent() {
+ Intent intent = null;
+
+ // What home does is based on the mode, not the dock state. That
+ // is, when in car mode you should be taken to car home regardless
+ // of whether we are actually in a car dock.
+ if (mUiMode == Configuration.UI_MODE_TYPE_CAR) {
+ if (ENABLE_CAR_DOCK_HOME_CAPTURE) {
+ intent = mCarDockIntent;
+ }
+ } else if (mUiMode == Configuration.UI_MODE_TYPE_DESK) {
+ if (ENABLE_DESK_DOCK_HOME_CAPTURE) {
+ intent = mDeskDockIntent;
+ }
+ }
+
+ if (intent == null) {
+ return null;
+ }
+
+ ActivityInfo ai = null;
+ ResolveInfo info = mContext.getPackageManager().resolveActivityAsUser(
+ intent,
+ PackageManager.MATCH_DEFAULT_ONLY,
+ UserHandle.USER_CURRENT);
+ if (info != null) {
+ ai = info.activityInfo;
+ }
+ if (ai != null
+ && ai.metaData != null
+ && ai.metaData.getBoolean(Intent.METADATA_DOCK_HOME)) {
+ intent = new Intent(intent);
+ intent.setClassName(ai.packageName, ai.name);
+ return intent;
+ }
+
+ return null;
+ }
+
void startDockOrHome() {
awakenDreams();
- // We don't have dock home anymore. Home is home. If you lived here, you'd be home by now.
+
+ Intent dock = createHomeDockIntent();
+ if (dock != null) {
+ try {
+ mContext.startActivityAsUser(dock, UserHandle.CURRENT);
+ return;
+ } catch (ActivityNotFoundException e) {
+ }
+ }
+
mContext.startActivityAsUser(mHomeIntent, UserHandle.CURRENT);
}
@@ -4616,6 +4694,18 @@
} else {
ActivityManagerNative.getDefault().stopAppSwitches();
sendCloseSystemWindows();
+ Intent dock = createHomeDockIntent();
+ if (dock != null) {
+ int result = ActivityManagerNative.getDefault()
+ .startActivityAsUser(null, null, dock,
+ dock.resolveTypeIfNeeded(mContext.getContentResolver()),
+ null, null, 0,
+ ActivityManager.START_FLAG_ONLY_IF_NEEDED,
+ null, null, null, UserHandle.USER_CURRENT);
+ if (result == ActivityManager.START_RETURN_INTENT_TO_CALLER) {
+ return false;
+ }
+ }
}
int result = ActivityManagerNative.getDefault()
.startActivityAsUser(null, null, mHomeIntent,
@@ -4844,7 +4934,8 @@
pw.print(prefix); pw.print("mLastFocusNeedsMenu=");
pw.println(mLastFocusNeedsMenu);
}
- pw.print(prefix); pw.print("mDockMode="); pw.print(mDockMode);
+ pw.print(prefix); pw.print("mUiMode="); pw.print(mUiMode);
+ pw.print(" mDockMode="); pw.print(mDockMode);
pw.print(" mCarDockRotation="); pw.print(mCarDockRotation);
pw.print(" mDeskDockRotation="); pw.println(mDeskDockRotation);
pw.print(prefix); pw.print("mUserRotationMode="); pw.print(mUserRotationMode);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
index 7fcf1d5..fbeca4f 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -1589,7 +1589,13 @@
@Override
public void cleanUp() {
-
+ // Make sure we let go of all widgets and their package contexts promptly. If we don't do
+ // this, and the associated application is uninstalled, it can cause a soft reboot.
+ int count = mAppWidgetContainer.getChildCount();
+ for (int i = 0; i < count; i++) {
+ KeyguardWidgetFrame frame = mAppWidgetContainer.getWidgetPageAt(i);
+ frame.removeAllViews();
+ }
}
/**
@@ -1609,8 +1615,6 @@
return !configDisabled || isTestHarness || fileOverride;
}
-
-
public void goToUserSwitcher() {
mAppWidgetContainer.setCurrentPage(getWidgetPosition(R.id.keyguard_multi_user_selector));
}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index a30fc3b..681c21d 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -26,6 +26,7 @@
import android.content.res.Configuration;
import android.media.AudioService;
import android.net.wifi.p2p.WifiP2pService;
+import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
@@ -1055,6 +1056,8 @@
// as efficient as possible with its memory usage.
VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);
+ Environment.setUserRequired(true);
+
System.loadLibrary("android_servers");
init1(args);
}
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java
index fd7cd78..241b224 100644
--- a/services/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/java/com/android/server/accounts/AccountManagerService.java
@@ -30,6 +30,7 @@
import android.accounts.IAccountManagerResponse;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
+import android.app.AppGlobals;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -1874,6 +1875,20 @@
return getAccountsAsUser(null, UserHandle.getCallingUserId(), packageName, uid);
}
+ @Override
+ public Account[] getAccountsByTypeForPackage(String type, String packageName) {
+ checkBinderPermission(android.Manifest.permission.INTERACT_ACROSS_USERS);
+ int packageUid = -1;
+ try {
+ packageUid = AppGlobals.getPackageManager().getPackageUid(
+ packageName, UserHandle.getCallingUserId());
+ } catch (RemoteException re) {
+ Slog.e(TAG, "Couldn't determine the packageUid for " + packageName + re);
+ return new Account[0];
+ }
+ return getAccountsAsUser(type, UserHandle.getCallingUserId(), packageName, packageUid);
+ }
+
public void getAccountsByFeatures(IAccountManagerResponse response,
String type, String[] features) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
index 4e7497c..6e3034b 100644
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
@@ -223,6 +223,9 @@
public static final int PWD = 3;
/** @hide */
public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD" };
+
+ /** Prevent initialization */
+ private Eap() {}
}
/** The inner authentication method used */
@@ -239,6 +242,9 @@
private static final String PREFIX = "auth=";
/** @hide */
public static final String[] strings = {EMPTY_VALUE, "PAP", "MSCHAP", "MSCHAPV2", "GTC" };
+
+ /** Prevent initialization */
+ private Phase2() {}
}
/** Internal use only */
@@ -363,6 +369,16 @@
}
/**
+ * Get the password.
+ *
+ * Returns locally set password value. For networks fetched from
+ * framework, returns "*".
+ */
+ public String getPassword() {
+ return getFieldValue(PASSWORD_KEY, "");
+ }
+
+ /**
* Set CA certificate alias.
*
* <p> See the {@link android.security.KeyChain} for details on installing or choosing
@@ -396,14 +412,27 @@
* @throws IllegalArgumentException if not a CA certificate
*/
public void setCaCertificate(X509Certificate cert) {
- if (cert.getBasicConstraints() >= 0) {
- mCaCert = cert;
+ if (cert != null) {
+ if (cert.getBasicConstraints() >= 0) {
+ mCaCert = cert;
+ } else {
+ throw new IllegalArgumentException("Not a CA certificate");
+ }
} else {
- throw new IllegalArgumentException("Not a CA certificate");
+ mCaCert = null;
}
}
/**
+ * Get CA certificate
+ *
+ * @return X.509 CA certificate
+ */
+ public X509Certificate getCaCertificate() {
+ return mCaCert;
+ }
+
+ /**
* Set Client certificate alias.
*
* <p> See the {@link android.security.KeyChain} for details on installing or choosing
@@ -463,6 +492,15 @@
mClientCertificate = clientCertificate;
}
+ /**
+ * Get client certificate
+ *
+ * @return X.509 client certificate
+ */
+ public X509Certificate getClientCertificate() {
+ return mClientCertificate;
+ }
+
boolean needsKeyStore() {
// Has no keys to be installed
if (mClientCertificate == null && mCaCert == null) return false;
@@ -645,6 +683,7 @@
}
private String removeDoubleQuotes(String string) {
+ if (TextUtils.isEmpty(string)) return "";
int length = string.length();
if ((length > 1) && (string.charAt(0) == '"')
&& (string.charAt(length - 1) == '"')) {