Merge "LayoutLib: Update to use the new RenderResources API." into honeycomb
diff --git a/NOTICE b/NOTICE
index 8d6f583..d857ba3 100644
--- a/NOTICE
+++ b/NOTICE
@@ -72,6 +72,17 @@
OF ANY KIND, either express or implied; not even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Audio Effects code. ==
+ =========================================================================
+
+Audio Effects
+These files are Copyright (C) 2004-2010 NXP Software and
+Copyright (C) 2010 The Android Open Source Project, but released under
+the Apache2 License.
+
Apache License
Version 2.0, January 2004
diff --git a/api/10.xml b/api/10.xml
index 3b9ab1a..15fcffe 100644
--- a/api/10.xml
+++ b/api/10.xml
@@ -157967,21 +157967,6 @@
<parameter name="flags" type="int">
</parameter>
</method>
-<method name="setPackageObbPath"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="path" type="java.lang.String">
-</parameter>
-</method>
</class>
<class name="MockResources"
extends="android.content.res.Resources"
diff --git a/api/11.xml b/api/11.xml
index d59d80a..6d12990 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -30672,6 +30672,17 @@
<parameter name="listener" type="android.app.FragmentManager.OnBackStackChangedListener">
</parameter>
</method>
+<method name="beginTransaction"
+ return="android.app.FragmentTransaction"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="countBackStackEntries"
return="int"
abstract="true"
@@ -30782,7 +30793,7 @@
</method>
<method name="openTransaction"
return="android.app.FragmentTransaction"
- abstract="true"
+ abstract="false"
native="false"
synchronized="false"
static="false"
@@ -37816,7 +37827,7 @@
</parameter>
</method>
<method name="getStorageEncryption"
- return="int"
+ return="boolean"
abstract="false"
native="false"
synchronized="false"
@@ -37828,6 +37839,17 @@
<parameter name="admin" type="android.content.ComponentName">
</parameter>
</method>
+<method name="getStorageEncryptionStatus"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="hasGrantedPolicy"
return="boolean"
abstract="false"
@@ -38168,7 +38190,7 @@
type="int"
transient="false"
volatile="false"
- value="3"
+ value="2"
static="true"
final="true"
deprecated="not deprecated"
@@ -38179,7 +38201,7 @@
type="int"
transient="false"
volatile="false"
- value="4"
+ value="3"
static="true"
final="true"
deprecated="not deprecated"
@@ -38197,17 +38219,6 @@
visibility="public"
>
</field>
-<field name="ENCRYPTION_STATUS_REQUESTED"
- type="int"
- transient="false"
- volatile="false"
- value="2"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="ENCRYPTION_STATUS_UNSUPPORTED"
type="int"
transient="false"
@@ -60287,19 +60298,6 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
-<method name="getPackageObbPaths"
- return="java.lang.String[]"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-</method>
<method name="getPackagesForUid"
return="java.lang.String[]"
abstract="true"
@@ -60786,21 +60784,6 @@
<parameter name="installerPackageName" type="java.lang.String">
</parameter>
</method>
-<method name="setPackageObbPaths"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="paths" type="java.lang.String[]">
-</parameter>
-</method>
<field name="COMPONENT_ENABLED_STATE_DEFAULT"
type="int"
transient="false"
@@ -77124,6 +77107,16 @@
visibility="public"
>
</field>
+<field name="inMutable"
+ type="boolean"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="inPreferQualityOverSpeed"
type="boolean"
transient="false"
@@ -86359,7 +86352,7 @@
<method name="updateTexImage"
return="void"
abstract="false"
- native="true"
+ native="false"
synchronized="false"
static="false"
final="false"
@@ -95617,6 +95610,17 @@
visibility="public"
>
</field>
+<field name="TOUCHABLE_INSETS_REGION"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="3"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="TOUCHABLE_INSETS_VISIBLE"
type="int"
transient="false"
@@ -95648,6 +95652,16 @@
visibility="public"
>
</field>
+<field name="touchableRegion"
+ type="android.graphics.Region"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="visibleTopInsets"
type="int"
transient="false"
@@ -147411,53 +147425,6 @@
>
</field>
</class>
-<class name="StorageEventListener"
- extends="java.lang.Object"
- abstract="true"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<constructor name="StorageEventListener"
- type="android.os.storage.StorageEventListener"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
-<method name="onStorageStateChanged"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="path" type="java.lang.String">
-</parameter>
-<parameter name="oldState" type="java.lang.String">
-</parameter>
-<parameter name="newState" type="java.lang.String">
-</parameter>
-</method>
-<method name="onUsbMassStorageConnectionChanged"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="connected" type="boolean">
-</parameter>
-</method>
-</class>
<class name="StorageManager"
extends="java.lang.Object"
abstract="false"
@@ -147527,111 +147494,6 @@
</parameter>
</method>
</class>
-<class name="StorageResultCode"
- extends="java.lang.Object"
- abstract="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<constructor name="StorageResultCode"
- type="android.os.storage.StorageResultCode"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
-<field name="OperationFailedInternalError"
- type="int"
- transient="false"
- volatile="false"
- value="-1"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedMediaBlank"
- type="int"
- transient="false"
- volatile="false"
- value="-3"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedMediaCorrupt"
- type="int"
- transient="false"
- volatile="false"
- value="-4"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedNoMedia"
- type="int"
- transient="false"
- volatile="false"
- value="-2"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageBusy"
- type="int"
- transient="false"
- volatile="false"
- value="-7"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageMounted"
- type="int"
- transient="false"
- volatile="false"
- value="-6"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageNotMounted"
- type="int"
- transient="false"
- volatile="false"
- value="-5"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationSucceeded"
- type="int"
- transient="false"
- volatile="false"
- value="0"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-</class>
</package>
<package name="android.preference"
>
@@ -167326,6 +167188,38 @@
<parameter name="dimX" type="int">
</parameter>
</method>
+<method name="setFromFieldPacker"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="fp" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
+<method name="setFromFieldPacker"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="component_number" type="int">
+</parameter>
+<parameter name="fp" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
<method name="syncAll"
return="void"
abstract="false"
@@ -173086,6 +172980,49 @@
deprecated="not deprecated"
visibility="public"
>
+<method name="bindAllocation"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="va" type="android.renderscript.Allocation">
+</parameter>
+<parameter name="slot" type="int">
+</parameter>
+</method>
+<method name="invoke"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="slot" type="int">
+</parameter>
+</method>
+<method name="invoke"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="slot" type="int">
+</parameter>
+<parameter name="v" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
<method name="setTimeZone"
return="void"
abstract="false"
@@ -173099,6 +173036,111 @@
<parameter name="timeZone" type="java.lang.String">
</parameter>
</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="float">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="double">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="int">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="long">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="boolean">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="o" type="android.renderscript.BaseObj">
+</parameter>
+</method>
+<method name="setVar"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+<parameter name="v" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
</class>
<class name="Script.Builder"
extends="java.lang.Object"
@@ -173230,6 +173272,32 @@
deprecated="not deprecated"
visibility="public"
>
+<constructor name="ScriptC"
+ type="android.renderscript.ScriptC"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="id" type="int">
+</parameter>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+</constructor>
+<constructor name="ScriptC"
+ type="android.renderscript.ScriptC"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="resources" type="android.content.res.Resources">
+</parameter>
+<parameter name="resourceID" type="int">
+</parameter>
+</constructor>
</class>
<class name="Short2"
extends="java.lang.Object"
@@ -183686,6 +183754,17 @@
visibility="public"
>
</method>
+<method name="getObbDir"
+ return="java.io.File"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="getPackageCodePath"
return="java.lang.String"
abstract="false"
@@ -185274,19 +185353,6 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
-<method name="getPackageObbPaths"
- return="java.lang.String[]"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-</method>
<method name="getPackagesForUid"
return="java.lang.String[]"
abstract="false"
@@ -185771,36 +185837,6 @@
<parameter name="installerPackageName" type="java.lang.String">
</parameter>
</method>
-<method name="setPackageObbPath"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="path" type="java.lang.String">
-</parameter>
-</method>
-<method name="setPackageObbPaths"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="paths" type="java.lang.String[]">
-</parameter>
-</method>
</class>
<class name="MockResources"
extends="android.content.res.Resources"
diff --git a/api/9.xml b/api/9.xml
index 3b9ab1a..15fcffe 100644
--- a/api/9.xml
+++ b/api/9.xml
@@ -157967,21 +157967,6 @@
<parameter name="flags" type="int">
</parameter>
</method>
-<method name="setPackageObbPath"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="path" type="java.lang.String">
-</parameter>
-</method>
</class>
<class name="MockResources"
extends="android.content.res.Resources"
diff --git a/api/current.xml b/api/current.xml
index b9ebd1c..6d12990 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -30672,6 +30672,17 @@
<parameter name="listener" type="android.app.FragmentManager.OnBackStackChangedListener">
</parameter>
</method>
+<method name="beginTransaction"
+ return="android.app.FragmentTransaction"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="countBackStackEntries"
return="int"
abstract="true"
@@ -30782,7 +30793,7 @@
</method>
<method name="openTransaction"
return="android.app.FragmentTransaction"
- abstract="true"
+ abstract="false"
native="false"
synchronized="false"
static="false"
@@ -37816,7 +37827,7 @@
</parameter>
</method>
<method name="getStorageEncryption"
- return="int"
+ return="boolean"
abstract="false"
native="false"
synchronized="false"
@@ -37828,6 +37839,17 @@
<parameter name="admin" type="android.content.ComponentName">
</parameter>
</method>
+<method name="getStorageEncryptionStatus"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="hasGrantedPolicy"
return="boolean"
abstract="false"
@@ -38168,7 +38190,7 @@
type="int"
transient="false"
volatile="false"
- value="3"
+ value="2"
static="true"
final="true"
deprecated="not deprecated"
@@ -38179,7 +38201,7 @@
type="int"
transient="false"
volatile="false"
- value="4"
+ value="3"
static="true"
final="true"
deprecated="not deprecated"
@@ -38197,17 +38219,6 @@
visibility="public"
>
</field>
-<field name="ENCRYPTION_STATUS_REQUESTED"
- type="int"
- transient="false"
- volatile="false"
- value="2"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="ENCRYPTION_STATUS_UNSUPPORTED"
type="int"
transient="false"
@@ -60287,19 +60298,6 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
-<method name="getPackageObbPaths"
- return="java.lang.String[]"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-</method>
<method name="getPackagesForUid"
return="java.lang.String[]"
abstract="true"
@@ -60786,21 +60784,6 @@
<parameter name="installerPackageName" type="java.lang.String">
</parameter>
</method>
-<method name="setPackageObbPaths"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="paths" type="java.lang.String[]">
-</parameter>
-</method>
<field name="COMPONENT_ENABLED_STATE_DEFAULT"
type="int"
transient="false"
@@ -77124,6 +77107,16 @@
visibility="public"
>
</field>
+<field name="inMutable"
+ type="boolean"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="inPreferQualityOverSpeed"
type="boolean"
transient="false"
@@ -86359,7 +86352,7 @@
<method name="updateTexImage"
return="void"
abstract="false"
- native="true"
+ native="false"
synchronized="false"
static="false"
final="false"
@@ -147432,53 +147425,6 @@
>
</field>
</class>
-<class name="StorageEventListener"
- extends="java.lang.Object"
- abstract="true"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<constructor name="StorageEventListener"
- type="android.os.storage.StorageEventListener"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
-<method name="onStorageStateChanged"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="path" type="java.lang.String">
-</parameter>
-<parameter name="oldState" type="java.lang.String">
-</parameter>
-<parameter name="newState" type="java.lang.String">
-</parameter>
-</method>
-<method name="onUsbMassStorageConnectionChanged"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="connected" type="boolean">
-</parameter>
-</method>
-</class>
<class name="StorageManager"
extends="java.lang.Object"
abstract="false"
@@ -147548,111 +147494,6 @@
</parameter>
</method>
</class>
-<class name="StorageResultCode"
- extends="java.lang.Object"
- abstract="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<constructor name="StorageResultCode"
- type="android.os.storage.StorageResultCode"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
-<field name="OperationFailedInternalError"
- type="int"
- transient="false"
- volatile="false"
- value="-1"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedMediaBlank"
- type="int"
- transient="false"
- volatile="false"
- value="-3"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedMediaCorrupt"
- type="int"
- transient="false"
- volatile="false"
- value="-4"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedNoMedia"
- type="int"
- transient="false"
- volatile="false"
- value="-2"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageBusy"
- type="int"
- transient="false"
- volatile="false"
- value="-7"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageMounted"
- type="int"
- transient="false"
- volatile="false"
- value="-6"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationFailedStorageNotMounted"
- type="int"
- transient="false"
- volatile="false"
- value="-5"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OperationSucceeded"
- type="int"
- transient="false"
- volatile="false"
- value="0"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-</class>
</package>
<package name="android.preference"
>
@@ -185512,19 +185353,6 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
-<method name="getPackageObbPaths"
- return="java.lang.String[]"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-</method>
<method name="getPackagesForUid"
return="java.lang.String[]"
abstract="false"
@@ -186009,36 +185837,6 @@
<parameter name="installerPackageName" type="java.lang.String">
</parameter>
</method>
-<method name="setPackageObbPath"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="path" type="java.lang.String">
-</parameter>
-</method>
-<method name="setPackageObbPaths"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="packageName" type="java.lang.String">
-</parameter>
-<parameter name="paths" type="java.lang.String[]">
-</parameter>
-</method>
</class>
<class name="MockResources"
extends="android.content.res.Resources"
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index b64069d..079d4cf 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -1103,25 +1103,6 @@
return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
}
- @Override
- public void setPackageObbPaths(String packageName, String[] paths) {
- try {
- mPM.setPackageObbPaths(packageName, paths);
- } catch (RemoteException e) {
- // Should never happen!
- }
- }
-
- @Override
- public String[] getPackageObbPaths(String packageName) {
- try {
- return mPM.getPackageObbPaths(packageName);
- } catch (RemoteException e) {
- // Should never happen!
- }
- return null;
- }
-
private final ContextImpl mContext;
private final IPackageManager mPM;
diff --git a/core/java/android/app/DialogFragment.java b/core/java/android/app/DialogFragment.java
index 6194240..6f25293 100644
--- a/core/java/android/app/DialogFragment.java
+++ b/core/java/android/app/DialogFragment.java
@@ -218,7 +218,7 @@
* {@link FragmentTransaction#add(Fragment, String) FragmentTransaction.add}.
*/
public void show(FragmentManager manager, String tag) {
- FragmentTransaction ft = manager.openTransaction();
+ FragmentTransaction ft = manager.beginTransaction();
ft.add(this, tag);
ft.commit();
}
@@ -260,7 +260,7 @@
FragmentManager.POP_BACK_STACK_INCLUSIVE);
mBackStackId = -1;
} else {
- FragmentTransaction ft = getFragmentManager().openTransaction();
+ FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.remove(this);
if (allowStateLoss) {
ft.commitAllowingStateLoss();
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index eb9b8a3..e35ef87 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -100,8 +100,13 @@
* in the state, and if changes are made after the state is saved then they
* will be lost.</p>
*/
- public abstract FragmentTransaction openTransaction();
+ public abstract FragmentTransaction beginTransaction();
+ /** Old API */
+ public FragmentTransaction openTransaction() {
+ return beginTransaction();
+ }
+
/**
* After a {@link FragmentTransaction} is committed with
* {@link FragmentTransaction#commit FragmentTransaction.commit()}, it
@@ -347,7 +352,7 @@
};
@Override
- public FragmentTransaction openTransaction() {
+ public FragmentTransaction beginTransaction() {
return new BackStackRecord(this);
}
diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java
index 1ef011c..cd5e3bb 100644
--- a/core/java/android/app/LoaderManager.java
+++ b/core/java/android/app/LoaderManager.java
@@ -60,7 +60,7 @@
* Called when a previously created loader has finished its load. Note
* that normally an application is <em>not</em> allowed to commit fragment
* transactions while in this call, since it can happen after an
- * activity's state is saved. See {@link FragmentManager#openTransaction()
+ * activity's state is saved. See {@link FragmentManager#beginTransaction()
* FragmentManager.openTransaction()} for further discussion on this.
*
* <p>This function is guaranteed to be called prior to the release of
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 4186fec..3f3aa74 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -1093,38 +1093,32 @@
}
/**
- * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryption}:
+ * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryptionStatus}:
* indicating that encryption is not supported.
*/
public static final int ENCRYPTION_STATUS_UNSUPPORTED = 0;
/**
- * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryption}:
+ * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryptionStatus}:
* indicating that encryption is supported, but is not currently active.
*/
public static final int ENCRYPTION_STATUS_INACTIVE = 1;
/**
- * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryption}:
- * indicating that encryption is not currently active, but has been requested.
- */
- public static final int ENCRYPTION_STATUS_REQUESTED = 2;
-
- /**
- * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryption}:
+ * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryptionStatus}:
* indicating that encryption is not currently active, but is currently
* being activated. This is only reported by devices that support
* encryption of data and only when the storage is currently
* undergoing a process of becoming encrypted. A device that must reboot and/or wipe data
* to become encrypted will never return this value.
*/
- public static final int ENCRYPTION_STATUS_ACTIVATING = 3;
+ public static final int ENCRYPTION_STATUS_ACTIVATING = 2;
/**
- * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryption}:
+ * Result code for {@link #setStorageEncryption} and {@link #getStorageEncryptionStatus}:
* indicating that encryption is active.
*/
- public static final int ENCRYPTION_STATUS_ACTIVE = 4;
+ public static final int ENCRYPTION_STATUS_ACTIVE = 3;
/**
* Activity action: begin the process of encrypting data on the device. This activity should
@@ -1139,14 +1133,7 @@
/**
* Called by an application that is administering the device to
- * request that the storage system be encrypted. Depending
- * on the returned status code, the caller may proceed in different
- * ways. If the result is {@link #ENCRYPTION_STATUS_UNSUPPORTED}, the
- * storage system does not support encryption. If the
- * result is {@link #ENCRYPTION_STATUS_REQUESTED}, use {@link
- * #ACTION_START_ENCRYPTION} to begin the process of encrypting or decrypting the
- * storage. If the result is {@link #ENCRYPTION_STATUS_ACTIVATING} or
- * {@link #ENCRYPTION_STATUS_ACTIVE}, no further action is required.
+ * request that the storage system be encrypted.
*
* <p>When multiple device administrators attempt to control device
* encryption, the most secure, supported setting will always be
@@ -1167,7 +1154,10 @@
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param encrypt true to request encryption, false to release any previous request
- * @return current status of encryption
+ * @return the new request status (for all active admins) - will be one of
+ * {@link #ENCRYPTION_STATUS_UNSUPPORTED}, {@link #ENCRYPTION_STATUS_INACTIVE}, or
+ * {@link #ENCRYPTION_STATUS_ACTIVE}. This is the value of the requests; Use
+ * {@link #getStorageEncryptionStatus()} to query the actual device state.
*/
public int setStorageEncryption(ComponentName admin, boolean encrypt) {
if (mService != null) {
@@ -1182,12 +1172,14 @@
/**
* Called by an application that is administering the device to
- * determine the encryption status of a specific storage system.
+ * determine the requested setting for secure storage.
*
- * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
- * @return current status of encryption
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with. If null,
+ * this will return the requested encryption setting as an aggregate of all active
+ * administrators.
+ * @return true if the admin(s) are requesting encryption, false if not.
*/
- public int getStorageEncryption(ComponentName admin) {
+ public boolean getStorageEncryption(ComponentName admin) {
if (mService != null) {
try {
return mService.getStorageEncryption(admin);
@@ -1195,6 +1187,33 @@
Log.w(TAG, "Failed talking with device policy service", e);
}
}
+ return false;
+ }
+
+ /**
+ * Called by an application that is administering the device to
+ * determine the current encryption status of the device.
+ *
+ * Depending on the returned status code, the caller may proceed in different
+ * ways. If the result is {@link #ENCRYPTION_STATUS_UNSUPPORTED}, the
+ * storage system does not support encryption. If the
+ * result is {@link #ENCRYPTION_STATUS_INACTIVE}, use {@link
+ * #ACTION_START_ENCRYPTION} to begin the process of encrypting or decrypting the
+ * storage. If the result is {@link #ENCRYPTION_STATUS_ACTIVATING} or
+ * {@link #ENCRYPTION_STATUS_ACTIVE}, no further action is required.
+ *
+ * @return current status of encryption. The value will be one of
+ * {@link #ENCRYPTION_STATUS_UNSUPPORTED}, {@link #ENCRYPTION_STATUS_INACTIVE},
+ * {@link #ENCRYPTION_STATUS_ACTIVATING}, or{@link #ENCRYPTION_STATUS_ACTIVE}.
+ */
+ public int getStorageEncryptionStatus() {
+ if (mService != null) {
+ try {
+ return mService.getStorageEncryptionStatus();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
return ENCRYPTION_STATUS_UNSUPPORTED;
}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index d3b5cf3..e8caca1 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -76,7 +76,8 @@
ComponentName getGlobalProxyAdmin();
int setStorageEncryption(in ComponentName who, boolean encrypt);
- int getStorageEncryption(in ComponentName who);
+ boolean getStorageEncryption(in ComponentName who);
+ int getStorageEncryptionStatus();
void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing);
boolean isAdminActive(in ComponentName policyReceiver);
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 28e1a63..034525e 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -323,7 +323,4 @@
boolean setInstallLocation(int loc);
int getInstallLocation();
-
- void setPackageObbPaths(in String packageName, in String[] paths);
- String[] getPackageObbPaths(in String packageName);
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 47418aa..6e9cdbe 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -2289,32 +2289,4 @@
*/
public abstract void movePackage(
String packageName, IPackageMoveObserver observer, int flags);
-
- /**
- * Sets the Opaque Binary Blob (OBB) file path associated with a package
- * name. The caller must have the
- * {@link android.Manifest.permission#INSTALL_PACKAGES} permission.
- * <p>
- * NOTE: The existence or format of this file is not currently checked, but
- * it may be in the future.
- *
- * @param packageName Name of the package with which to associate the .obb
- * file.
- * @param paths Arrays of paths on the filesystem to the .obb files
- * associated with the package.
- * @see #getPackageObbPaths(String)
- */
- public abstract void setPackageObbPaths(String packageName, String[] paths);
-
- /**
- * Gets the Opaque Binary Blob (OBB) file path associated with the package.
- * The caller must be the owner of the package queried or have the
- * {@link android.Manifest.permission#INSTALL_PACKAGES} permission.
- *
- * @param packageName Name of the package with which to associate the .obb
- * file.
- * @return array of paths to .obb files associated with the package
- * @see #setPackageObbPaths(String, String[])
- */
- public abstract String[] getPackageObbPaths(String packageName);
}
diff --git a/core/java/android/net/InterfaceConfiguration.java b/core/java/android/net/InterfaceConfiguration.java
index 980048c..d1bbaa4 100644
--- a/core/java/android/net/InterfaceConfiguration.java
+++ b/core/java/android/net/InterfaceConfiguration.java
@@ -39,14 +39,36 @@
public String toString() {
StringBuffer str = new StringBuffer();
- str.append("ipddress "); str.append(addr.toString());
- str.append(" netmask "); str.append(mask.toString());
+ str.append("ipddress ");
+ str.append((addr != null) ? addr.toString() : "NULL");
+ str.append(" netmask ");
+ str.append((mask != null) ? mask.toString() : "NULL");
str.append(" flags ").append(interfaceFlags);
str.append(" hwaddr ").append(hwAddr);
return str.toString();
}
+ /**
+ * This function determines if the interface is up and has a valid IP
+ * configuration (IP address has a non zero octet).
+ *
+ * Note: It is supposed to be quick and hence should not initiate
+ * any network activity
+ */
+ public boolean isActive() {
+ try {
+ if(interfaceFlags.contains("up")) {
+ for (byte b : addr.getAddress()) {
+ if (b != 0) return true;
+ }
+ }
+ } catch (NullPointerException e) {
+ return false;
+ }
+ return false;
+ }
+
/** Implement the Parcelable interface {@hide} */
public int describeContents() {
return 0;
diff --git a/core/java/android/os/storage/StorageEventListener.java b/core/java/android/os/storage/StorageEventListener.java
index d3d39d6d..6c73d04 100644
--- a/core/java/android/os/storage/StorageEventListener.java
+++ b/core/java/android/os/storage/StorageEventListener.java
@@ -18,6 +18,8 @@
/**
* Used for receiving notifications from the StorageManager
+ *
+ * @hide
*/
public abstract class StorageEventListener {
/**
diff --git a/core/java/android/os/storage/StorageResultCode.java b/core/java/android/os/storage/StorageResultCode.java
index 07d95df..8e7db31 100644
--- a/core/java/android/os/storage/StorageResultCode.java
+++ b/core/java/android/os/storage/StorageResultCode.java
@@ -19,6 +19,8 @@
/**
* Class that provides access to constants returned from StorageManager
* and lower level MountService APIs.
+ *
+ * @hide
*/
public class StorageResultCode
{
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java
index 7a186f3..ee3bdab 100644
--- a/core/java/android/preference/PreferenceActivity.java
+++ b/core/java/android/preference/PreferenceActivity.java
@@ -1044,7 +1044,7 @@
getFragmentManager().popBackStack(BACK_STACK_PREFS,
FragmentManager.POP_BACK_STACK_INCLUSIVE);
Fragment f = Fragment.instantiate(this, fragmentName, args);
- FragmentTransaction transaction = getFragmentManager().openTransaction();
+ FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.setTransition(direction == 0 ? FragmentTransaction.TRANSIT_NONE
: direction > 0 ? FragmentTransaction.TRANSIT_FRAGMENT_NEXT
: FragmentTransaction.TRANSIT_FRAGMENT_PREV);
@@ -1136,7 +1136,7 @@
* the current fragment will be replaced.
*/
public void startPreferenceFragment(Fragment fragment, boolean push) {
- FragmentTransaction transaction = getFragmentManager().openTransaction();
+ FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(com.android.internal.R.id.prefs, fragment);
if (push) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
@@ -1175,7 +1175,7 @@
if (resultTo != null) {
f.setTargetFragment(resultTo, resultRequestCode);
}
- FragmentTransaction transaction = getFragmentManager().openTransaction();
+ FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(com.android.internal.R.id.prefs, f);
if (titleRes != 0) {
transaction.setBreadCrumbTitle(titleRes);
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index ba46a3f..63dbfbf 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -754,7 +754,7 @@
return;
}
mCurrentScrollOffset += y;
- while (mCurrentScrollOffset - mInitialScrollOffset > mSelectorElementHeight) {
+ while (mCurrentScrollOffset - mInitialScrollOffset >= mSelectorElementHeight) {
mCurrentScrollOffset -= mSelectorElementHeight;
decrementSelectorIndices(selectorIndices);
changeCurrent(selectorIndices[SELECTOR_MIDDLE_ITEM_INDEX]);
@@ -762,7 +762,7 @@
mCurrentScrollOffset = mInitialScrollOffset;
}
}
- while (mCurrentScrollOffset - mInitialScrollOffset < -mSelectorElementHeight) {
+ while (mCurrentScrollOffset - mInitialScrollOffset <= -mSelectorElementHeight) {
mCurrentScrollOffset += mSelectorElementHeight;
incrementScrollSelectorIndices(selectorIndices);
changeCurrent(selectorIndices[SELECTOR_MIDDLE_ITEM_INDEX]);
@@ -1147,8 +1147,8 @@
postAdjustScrollerCommand(0);
tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_IDLE);
} else {
- showInputControls();
updateInputTextView();
+ showInputControls();
}
}
@@ -1537,8 +1537,8 @@
public void run() {
mPreviousScrollerY = 0;
if (mInitialScrollOffset == mCurrentScrollOffset) {
- showInputControls();
updateInputTextView();
+ showInputControls();
return;
}
// adjust to the closest value
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index df1f4bf..ab69725 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -33,8 +33,8 @@
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.View.MeasureSpec;
import android.view.ViewGroup;
+import android.view.View.MeasureSpec;
import com.android.internal.widget.IRemoteViewsFactory;
@@ -760,11 +760,12 @@
synchronized (mCache) {
// Queue up other indices to be preloaded based on this position
mCache.queuePositionsToBePreloadedFromRequestedPosition(position);
-
- RemoteViewsFrameLayout layout = (RemoteViewsFrameLayout) convertView;
View convertViewChild = null;
int convertViewTypeId = 0;
- if (convertView != null) {
+ RemoteViewsFrameLayout layout = null;
+
+ if (convertView instanceof RemoteViewsFrameLayout) {
+ layout = (RemoteViewsFrameLayout) convertView;
convertViewChild = layout.getChildAt(0);
convertViewTypeId = getConvertViewTypeId(convertViewChild);
}
@@ -777,17 +778,17 @@
int typeId = mCache.getMetaDataAt(position).typeId;
// Reuse the convert view where possible
- if (convertView != null) {
+ if (layout != null) {
if (convertViewTypeId == typeId) {
rv.reapply(context, convertViewChild);
- return convertView;
+ return layout;
}
}
// Otherwise, create a new view to be returned
View newView = rv.apply(context, parent);
newView.setTagInternal(com.android.internal.R.id.rowTypeId, new Integer(typeId));
- if (convertView != null) {
+ if (layout != null) {
layout.removeAllViews();
} else {
layout = new RemoteViewsFrameLayout(context);
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 0102628..0baddcb 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -23,6 +23,8 @@
import android.content.DialogInterface.OnClickListener;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
+import android.graphics.drawable.Drawable;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.Gravity;
@@ -632,7 +634,8 @@
private class DropdownPopup extends ListPopupWindow implements SpinnerPopup {
private CharSequence mHintText;
private int mPopupMaxWidth;
-
+ private Rect mTempRect = new Rect();
+
public DropdownPopup(Context context, AttributeSet attrs, int defStyleRes) {
super(context, attrs, 0, defStyleRes);
@@ -699,6 +702,14 @@
itemView.measure(widthMeasureSpec, heightMeasureSpec);
width = Math.max(width, itemView.getMeasuredWidth());
}
+
+ // Add background padding to measured width
+ Drawable popupBackground = getBackground();
+ if (popupBackground != null) {
+ popupBackground.getPadding(mTempRect);
+ width += mTempRect.left + mTempRect.right;
+ }
+
return width;
}
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java
index 4ee3083..0e31fef 100644
--- a/core/java/com/android/internal/app/ActionBarImpl.java
+++ b/core/java/com/android/internal/app/ActionBarImpl.java
@@ -492,7 +492,7 @@
return;
}
- final FragmentTransaction trans = mActivity.getFragmentManager().openTransaction()
+ final FragmentTransaction trans = mActivity.getFragmentManager().beginTransaction()
.disallowAddToBackStack();
if (mSelectedTab == tab) {
diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java
index 588b10c..ff59950 100644
--- a/core/java/com/android/internal/view/menu/MenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/MenuBuilder.java
@@ -1050,7 +1050,7 @@
*/
private ViewGroup getMeasureActionButtonParent() {
if (mMeasureActionButtonParent == null) {
- mMeasureActionButtonParent = (ViewGroup) mMenuTypes[TYPE_ACTION_BUTTON].getInflater()
+ mMeasureActionButtonParent = (ViewGroup) getMenuType(TYPE_ACTION_BUTTON).getInflater()
.inflate(LAYOUT_RES_FOR_TYPE[TYPE_ACTION_BUTTON], null, false);
}
return mMeasureActionButtonParent;
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index dac748d..e47d91c 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -23,6 +23,7 @@
jfieldID gOptions_justBoundsFieldID;
jfieldID gOptions_sampleSizeFieldID;
jfieldID gOptions_configFieldID;
+jfieldID gOptions_mutableFieldID;
jfieldID gOptions_ditherFieldID;
jfieldID gOptions_purgeableFieldID;
jfieldID gOptions_shareableFieldID;
@@ -179,6 +180,7 @@
SkImageDecoder::Mode mode = SkImageDecoder::kDecodePixels_Mode;
SkBitmap::Config prefConfig = SkBitmap::kNo_Config;
bool doDither = true;
+ bool isMutable = false;
bool isPurgeable = forcePurgeable ||
(allowPurgeable && optionsPurgeable(env, options));
bool preferQualityOverSpeed = false;
@@ -196,6 +198,7 @@
jobject jconfig = env->GetObjectField(options, gOptions_configFieldID);
prefConfig = GraphicsJNI::getNativeBitmapConfig(env, jconfig);
+ isMutable = env->GetBooleanField(options, gOptions_mutableFieldID);
doDither = env->GetBooleanField(options, gOptions_ditherFieldID);
preferQualityOverSpeed = env->GetBooleanField(options,
gOptions_preferQualityOverSpeedFieldID);
@@ -306,15 +309,19 @@
// already have a pixelref installed.
pr = bitmap->pixelRef();
}
- // promise we will never change our pixels (great for sharing and pictures)
- pr->setImmutable();
+
+ if (!isMutable) {
+ // promise we will never change our pixels (great for sharing and pictures)
+ pr->setImmutable();
+ }
if (javaBitmap != NULL) {
// If a java bitmap was passed in for reuse, pass it back
return javaBitmap;
}
// now create the java bitmap
- return GraphicsJNI::createBitmap(env, bitmap, javaAllocator.getStorageObj(), false, ninePatchChunk);
+ return GraphicsJNI::createBitmap(env, bitmap, javaAllocator.getStorageObj(),
+ isMutable, ninePatchChunk);
}
static jobject nativeDecodeStream(JNIEnv* env, jobject clazz,
@@ -572,6 +579,7 @@
gOptions_sampleSizeFieldID = getFieldIDCheck(env, gOptions_class, "inSampleSize", "I");
gOptions_configFieldID = getFieldIDCheck(env, gOptions_class, "inPreferredConfig",
"Landroid/graphics/Bitmap$Config;");
+ gOptions_mutableFieldID = getFieldIDCheck(env, gOptions_class, "inMutable", "Z");
gOptions_ditherFieldID = getFieldIDCheck(env, gOptions_class, "inDither", "Z");
gOptions_purgeableFieldID = getFieldIDCheck(env, gOptions_class, "inPurgeable", "Z");
gOptions_shareableFieldID = getFieldIDCheck(env, gOptions_class, "inInputShareable", "Z");
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 2126529..0e65df5 100755
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -48,7 +48,6 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Arrays;
public class PackageManagerTests extends AndroidTestCase {
private static final boolean localLOGV = true;
@@ -3106,164 +3105,6 @@
PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
- @LargeTest
- public void testPackageObbPaths_Nonexistent() {
- try {
- final PackageManager pm = getPm();
-
- // Invalid Java package name.
- pm.getPackageObbPaths("=non-existent");
-
- fail("Should not be able to get package OBB paths for non-existent package");
- } catch (IllegalArgumentException e) {
- // pass
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Initial() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- assertEquals("Initial obb paths should be null",
- null, pm.getPackageObbPaths(ip.pkg.packageName));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Null() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- pm.setPackageObbPaths(ip.pkg.packageName, null);
-
- assertEquals("Returned paths should be null",
- null, pm.getPackageObbPaths(ip.pkg.packageName));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Empty() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- final String[] paths = new String[0];
-
- pm.setPackageObbPaths(ip.pkg.packageName, paths);
-
- assertEquals("Empty list should be interpreted as null",
- null, pm.getPackageObbPaths(ip.pkg.packageName));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Single() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- final String[] paths = new String[] {
- "/example/test",
- };
-
- pm.setPackageObbPaths(ip.pkg.packageName, paths.clone());
-
- assertTrue("Previously set paths should be the same as the returned paths.",
- Arrays.equals(paths, pm.getPackageObbPaths(ip.pkg.packageName)));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Multiple() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- final String[] paths = new String[] {
- "/example/test1",
- "/example/test2",
- };
-
- pm.setPackageObbPaths(ip.pkg.packageName, paths.clone());
-
- assertTrue("Previously set paths should be the same as the returned paths.",
- Arrays.equals(paths, pm.getPackageObbPaths(ip.pkg.packageName)));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_Twice() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- final String[] paths = new String[] {
- "/example/test1",
- "/example/test2",
- };
-
- pm.setPackageObbPaths(ip.pkg.packageName, paths.clone());
-
- assertTrue("Previously set paths should be the same as the returned paths.",
- Arrays.equals(paths, pm.getPackageObbPaths(ip.pkg.packageName)));
-
- paths[0] = "/example/test3";
- pm.setPackageObbPaths(ip.pkg.packageName, paths.clone());
-
- assertTrue("Previously set paths should be the same as the returned paths.",
- Arrays.equals(paths, pm.getPackageObbPaths(ip.pkg.packageName)));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
- @LargeTest
- public void testPackageObbPaths_ReplacePackage() {
- InstallParams ip = sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, false);
-
- try {
- final PackageManager pm = getPm();
-
- final String[] paths = new String[] {
- "/example/test1",
- "/example/test2",
- };
-
- pm.setPackageObbPaths(ip.pkg.packageName, paths.clone());
-
- Log.i(TAG, "Creating replaceReceiver");
- final GenericReceiver receiver = new ReplaceReceiver(ip.pkg.packageName);
-
- final int flags = PackageManager.INSTALL_REPLACE_EXISTING;
- invokeInstallPackage(ip.packageURI, flags, receiver);
- assertInstall(ip.pkg, flags, ip.pkg.installLocation);
-
- assertTrue("Previously set paths should be the same as the returned paths.",
- Arrays.equals(paths, pm.getPackageObbPaths(ip.pkg.packageName)));
- } finally {
- cleanUpInstall(ip);
- }
- }
-
/*---------- Recommended install location tests ----*/
/*
* TODO's
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index a8efd00..e67ceed 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -53,6 +53,7 @@
*/
public byte[] mBuffer;
+ @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) // Keep to finalize native resources
private final BitmapFinalizer mFinalizer;
private final boolean mIsMutable;
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index 8309f7a..dd6bf19 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -64,6 +64,14 @@
public Bitmap inBitmap;
/**
+ * If set, decode methods will always return a mutable Bitmap instead of
+ * an immutable one. This can be used for instance to programmatically apply
+ * effects to a Bitmap loaded through BitmapFactory.
+ */
+ @SuppressWarnings({"UnusedDeclaration"}) // used in native code
+ public boolean inMutable;
+
+ /**
* If set to true, the decoder will return null (no bitmap), but
* the out... fields will still be set, allowing the caller to query
* the bitmap without having to allocate the memory for its pixels.
@@ -523,7 +531,7 @@
}
bm.setDensity(targetDensity);
}
-
+
return bm;
}
diff --git a/libs/rs/scriptc/rs_cl.rsh b/libs/rs/scriptc/rs_cl.rsh
index a5092b3..b9bb1f7 100644
--- a/libs/rs/scriptc/rs_cl.rsh
+++ b/libs/rs/scriptc/rs_cl.rsh
@@ -449,57 +449,87 @@
DEF_FUNC_1(trunc)
// Int ops (partial), 6.11.3
-extern uint __attribute__((overloadable)) abs(int);
-extern ushort __attribute__((overloadable)) abs(short);
-extern uchar __attribute__((overloadable)) abs(char);
-extern uint __attribute__((overloadable)) clz(uint);
-extern int __attribute__((overloadable)) clz(int);
-extern ushort __attribute__((overloadable)) clz(ushort);
-extern short __attribute__((overloadable)) clz(short);
-extern uchar __attribute__((overloadable)) clz(uchar);
-extern char __attribute__((overloadable)) clz(char);
-
-static uint __attribute__((overloadable)) min(uint v1, uint v2) {
- return v1 < v2 ? v1 : v2;
-}
-static int __attribute__((overloadable)) min(int v1, int v2) {
- return v1 < v2 ? v1 : v2;
-}
-static ushort __attribute__((overloadable)) min(ushort v1, ushort v2) {
- return v1 < v2 ? v1 : v2;
-}
-static short __attribute__((overloadable)) min(short v1, short v2) {
- return v1 < v2 ? v1 : v2;
-}
-static uchar __attribute__((overloadable)) min(uchar v1, uchar v2) {
- return v1 < v2 ? v1 : v2;
-}
-static char __attribute__((overloadable)) min(char v1, char v2) {
- return v1 < v2 ? v1 : v2;
+#define DEF_RIFUNC_1(typeout, typein, fnc) \
+extern typeout __attribute__((overloadable)) fnc(typein); \
+static typeout##2 __attribute__((overloadable)) fnc(typein##2 v) { \
+ typeout##2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
+static typeout##3 __attribute__((overloadable)) fnc(typein##3 v) { \
+ typeout##3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
+static typeout##4 __attribute__((overloadable)) fnc(typein##4 v) { \
+ typeout##4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-static uint __attribute__((overloadable)) max(uint v1, uint v2) {
- return v1 > v2 ? v1 : v2;
-}
-static int __attribute__((overloadable)) max(int v1, int v2) {
- return v1 > v2 ? v1 : v2;
-}
-static ushort __attribute__((overloadable)) max(ushort v1, ushort v2) {
- return v1 > v2 ? v1 : v2;
-}
-static short __attribute__((overloadable)) max(short v1, short v2) {
- return v1 > v2 ? v1 : v2;
-}
-static uchar __attribute__((overloadable)) max(uchar v1, uchar v2) {
- return v1 > v2 ? v1 : v2;
-}
-static char __attribute__((overloadable)) max(char v1, char v2) {
- return v1 > v2 ? v1 : v2;
-}
+#define DEF_UIFUNC_1(fnc) \
+DEF_RIFUNC_1(uchar, char, fnc) \
+DEF_RIFUNC_1(ushort, short, fnc) \
+DEF_RIFUNC_1(uint, int, fnc)
+#define DEF_IFUNC_1(fnc) \
+DEF_RIFUNC_1(uchar, uchar, fnc) \
+DEF_RIFUNC_1(char, char, fnc) \
+DEF_RIFUNC_1(ushort, ushort, fnc) \
+DEF_RIFUNC_1(short, short, fnc) \
+DEF_RIFUNC_1(uint, uint, fnc) \
+DEF_RIFUNC_1(int, int, fnc)
+#define DEF_RIFUNC_2(type, fnc, body) \
+static type __attribute__((overloadable)) fnc(type v1, type v2) { \
+ return body; \
+} \
+static type##2 __attribute__((overloadable)) fnc(type##2 v1, type##2 v2) { \
+ type##2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
+static type##3 __attribute__((overloadable)) fnc(type##3 v1, type##3 v2) { \
+ type##3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
+static type##4 __attribute__((overloadable)) fnc(type##4 v1, type##4 v2) { \
+ type##4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
+} \
+#define DEF_IFUNC_2(fnc, body) \
+DEF_RIFUNC_2(uchar, fnc, body) \
+DEF_RIFUNC_2(char, fnc, body) \
+DEF_RIFUNC_2(ushort, fnc, body) \
+DEF_RIFUNC_2(short, fnc, body) \
+DEF_RIFUNC_2(uint, fnc, body) \
+DEF_RIFUNC_2(int, fnc, body) \
+DEF_RIFUNC_2(float, fnc, body)
+
+DEF_UIFUNC_1(abs)
+DEF_IFUNC_1(clz)
+
+DEF_IFUNC_2(min, (v1 < v2 ? v1 : v2))
+DEF_FUNC_2F(min)
+
+DEF_IFUNC_2(max, (v1 > v2 ? v1 : v2))
+DEF_FUNC_2F(max)
// 6.11.4
@@ -554,98 +584,6 @@
}
DEF_FUNC_1(degrees)
-static float __attribute__((overloadable)) max(float v1, float v2) {
- return v1 > v2 ? v1 : v2;
-}
-static float2 __attribute__((overloadable)) max(float2 v1, float2 v2) {
- float2 r;
- r.x = v1.x > v2.x ? v1.x : v2.x;
- r.y = v1.y > v2.y ? v1.y : v2.y;
- return r;
-}
-static float3 __attribute__((overloadable)) max(float3 v1, float3 v2) {
- float3 r;
- r.x = v1.x > v2.x ? v1.x : v2.x;
- r.y = v1.y > v2.y ? v1.y : v2.y;
- r.z = v1.z > v2.z ? v1.z : v2.z;
- return r;
-}
-static float4 __attribute__((overloadable)) max(float4 v1, float4 v2) {
- float4 r;
- r.x = v1.x > v2.x ? v1.x : v2.x;
- r.y = v1.y > v2.y ? v1.y : v2.y;
- r.z = v1.z > v2.z ? v1.z : v2.z;
- r.w = v1.w > v2.w ? v1.w : v2.w;
- return r;
-}
-static float2 __attribute__((overloadable)) max(float2 v1, float v2) {
- float2 r;
- r.x = v1.x > v2 ? v1.x : v2;
- r.y = v1.y > v2 ? v1.y : v2;
- return r;
-}
-static float3 __attribute__((overloadable)) max(float3 v1, float v2) {
- float3 r;
- r.x = v1.x > v2 ? v1.x : v2;
- r.y = v1.y > v2 ? v1.y : v2;
- r.z = v1.z > v2 ? v1.z : v2;
- return r;
-}
-static float4 __attribute__((overloadable)) max(float4 v1, float v2) {
- float4 r;
- r.x = v1.x > v2 ? v1.x : v2;
- r.y = v1.y > v2 ? v1.y : v2;
- r.z = v1.z > v2 ? v1.z : v2;
- r.w = v1.w > v2 ? v1.w : v2;
- return r;
-}
-
-static float __attribute__((overloadable)) min(float v1, float v2) {
- return v1 < v2 ? v1 : v2;
-}
-static float2 __attribute__((overloadable)) min(float2 v1, float2 v2) {
- float2 r;
- r.x = v1.x < v2.x ? v1.x : v2.x;
- r.y = v1.y < v2.y ? v1.y : v2.y;
- return r;
-}
-static float3 __attribute__((overloadable)) min(float3 v1, float3 v2) {
- float3 r;
- r.x = v1.x < v2.x ? v1.x : v2.x;
- r.y = v1.y < v2.y ? v1.y : v2.y;
- r.z = v1.z < v2.z ? v1.z : v2.z;
- return r;
-}
-static float4 __attribute__((overloadable)) min(float4 v1, float4 v2) {
- float4 r;
- r.x = v1.x < v2.x ? v1.x : v2.x;
- r.y = v1.y < v2.y ? v1.y : v2.y;
- r.z = v1.z < v2.z ? v1.z : v2.z;
- r.w = v1.w < v2.w ? v1.w : v2.w;
- return r;
-}
-static float2 __attribute__((overloadable)) min(float2 v1, float v2) {
- float2 r;
- r.x = v1.x < v2 ? v1.x : v2;
- r.y = v1.y < v2 ? v1.y : v2;
- return r;
-}
-static float3 __attribute__((overloadable)) min(float3 v1, float v2) {
- float3 r;
- r.x = v1.x < v2 ? v1.x : v2;
- r.y = v1.y < v2 ? v1.y : v2;
- r.z = v1.z < v2 ? v1.z : v2;
- return r;
-}
-static float4 __attribute__((overloadable)) min(float4 v1, float v2) {
- float4 r;
- r.x = v1.x < v2 ? v1.x : v2;
- r.y = v1.y < v2 ? v1.y : v2;
- r.z = v1.z < v2 ? v1.z : v2;
- r.w = v1.w < v2 ? v1.w : v2;
- return r;
-}
-
static float __attribute__((overloadable)) mix(float start, float stop, float amount) {
return start + (stop - start) * amount;
}
@@ -810,5 +748,10 @@
#undef DEF_FUNC_1_RI
#undef DEF_FUNC_2
#undef DEF_FUNC_2F
+#undef DEF_RIFUNC_1
+#undef DEF_UIFUNC_1
+#undef DEF_IFUNC_1
+#undef DEF_RIFUNC_2
+#undef DEF_IFUNC_2
#endif
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
index bab8ed3..7544f46 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
@@ -297,7 +297,7 @@
private Drawable getFullResDefaultActivityIcon() {
return getFullResIcon(Resources.getSystem(),
- com.android.internal.R.drawable.sym_def_app_icon);
+ com.android.internal.R.mipmap.sym_def_app_icon);
}
private Drawable getFullResIcon(Resources resources, int iconId) {
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java
index c0ce256..8a9e351 100644
--- a/services/java/com/android/server/DevicePolicyManagerService.java
+++ b/services/java/com/android/server/DevicePolicyManagerService.java
@@ -145,6 +145,7 @@
int maximumFailedPasswordsForWipe = 0;
long passwordExpirationTimeout = 0L;
long passwordExpirationDate = 0L;
+ boolean encryptionRequested = false;
// TODO: review implementation decisions with frameworks team
boolean specifiesGlobalProxy = false;
@@ -242,6 +243,11 @@
out.attribute(null, "value", Long.toString(passwordExpirationDate));
out.endTag(null, "password-expiration-date");
}
+ if (encryptionRequested) {
+ out.startTag(null, "encryption-requested");
+ out.attribute(null, "value", Boolean.toString(encryptionRequested));
+ out.endTag(null, "encryption-requested");
+ }
}
void readFromXml(XmlPullParser parser)
@@ -290,7 +296,7 @@
maximumFailedPasswordsForWipe = Integer.parseInt(
parser.getAttributeValue(null, "value"));
} else if ("specifies-global-proxy".equals(tag)) {
- specifiesGlobalProxy = Boolean.getBoolean(
+ specifiesGlobalProxy = Boolean.parseBoolean(
parser.getAttributeValue(null, "value"));
} else if ("global-proxy-spec".equals(tag)) {
globalProxySpec =
@@ -304,6 +310,9 @@
} else if ("password-expiration-date".equals(tag)) {
passwordExpirationDate = Long.parseLong(
parser.getAttributeValue(null, "value"));
+ } else if ("encryption-requested".equals(tag)) {
+ encryptionRequested = Boolean.parseBoolean(
+ parser.getAttributeValue(null, "value"));
} else {
Slog.w(TAG, "Unknown admin tag: " + tag);
}
@@ -356,6 +365,8 @@
pw.print(prefix); pw.print("globalProxyEclusionList=");
pw.println(globalProxyExclusionList);
}
+ pw.print(prefix); pw.print("encryptionRequested=");
+ pw.println(encryptionRequested);
}
}
@@ -1823,7 +1834,8 @@
}
/**
- * Set the storage encryption request.
+ * Set the storage encryption request for a single admin. Returns the new total request
+ * status (for all admins).
*/
public int setStorageEncryption(ComponentName who, boolean encrypt) {
synchronized (this) {
@@ -1834,29 +1846,94 @@
ActiveAdmin ap = getActiveAdminForCallerLocked(who,
DeviceAdminInfo.USES_ENCRYPTED_STORAGE);
- // TODO: (1) Record the value for the admin so it's sticky
- // TODO: (2) Compute "max" for all admins (if any admin requests encryption, then
- // we enable it.
- // TODO: (3) Work with filesystem / mount service to start/stop encryption
- return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ // Quick exit: If the filesystem does not support encryption, we can exit early.
+ if (!isEncryptionSupported()) {
+ return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ }
+
+ // (1) Record the value for the admin so it's sticky
+ if (ap.encryptionRequested != encrypt) {
+ ap.encryptionRequested = encrypt;
+ saveSettingsLocked();
+ }
+
+ // (2) Compute "max" for all admins
+ boolean newRequested = false;
+ final int N = mAdminList.size();
+ for (int i = 0; i < N; i++) {
+ newRequested |= mAdminList.get(i).encryptionRequested;
+ }
+
+ // Notify OS of new request
+ setEncryptionRequested(newRequested);
+
+ // Return the new global request status
+ return newRequested
+ ? DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE
+ : DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE;
}
}
/**
- * Get the current storage encryption status for a given storage domain.
+ * Get the current storage encryption request status for a given admin, or aggregate of all
+ * active admins.
*/
- public int getStorageEncryption(ComponentName who) {
+ public boolean getStorageEncryption(ComponentName who) {
synchronized (this) {
// Check for permissions if a particular caller is specified
if (who != null) {
- getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_ENCRYPTED_STORAGE);
+ // When checking for a single caller, status is based on caller's request
+ ActiveAdmin ap = getActiveAdminForCallerLocked(who,
+ DeviceAdminInfo.USES_ENCRYPTED_STORAGE);
+ return ap.encryptionRequested;
}
- // TODO: Work with filesystem / mount service to query encryption status
- return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ // If no particular caller is specified, return the aggregate set of requests.
+ // This is short circuited by returning true on the first hit.
+ final int N = mAdminList.size();
+ for (int i = 0; i < N; i++) {
+ if (mAdminList.get(i).encryptionRequested) {
+ return true;
+ }
+ }
+ return false;
}
}
+ /**
+ * Get the current encryption status of the device.
+ */
+ public int getStorageEncryptionStatus() {
+ return getEncryptionStatus();
+ }
+
+ /**
+ * Hook to low-levels: This should report if the filesystem supports encrypted storage.
+ */
+ private boolean isEncryptionSupported() {
+ // Note, this can be implemented as
+ // return getEncryptionStatus() != DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ // But is provided as a separate internal method if there's a faster way to do a
+ // simple check for supported-or-not.
+ return getEncryptionStatus() != DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ }
+
+ /**
+ * Hook to low-levels: Reporting the current status of encryption.
+ * @return A value such as {@link DevicePolicyManager#ENCRYPTION_STATUS_UNSUPPORTED} or
+ * {@link DevicePolicyManager#ENCRYPTION_STATUS_INACTIVE} or
+ * {@link DevicePolicyManager#ENCRYPTION_STATUS_ACTIVE}.
+ */
+ private int getEncryptionStatus() {
+ return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
+ }
+
+ /**
+ * Hook to low-levels: If needed, record the new admin setting for encryption.
+ */
+ private void setEncryptionRequested(boolean encrypt) {
+ }
+
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index d2c6475..1eebd6a 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -4390,8 +4390,6 @@
}
};
- private static final boolean DEBUG_OBB = false;
-
private static final void sendPackageBroadcast(String action, String pkg,
Bundle extras, IIntentReceiver finishedReceiver) {
IActivityManager am = ActivityManagerNative.getDefault();
@@ -4641,64 +4639,6 @@
}
}
- public void setPackageObbPaths(String packageName, String[] paths) {
- if (DEBUG_OBB)
- Log.v(TAG, "Setting .obb paths for " + packageName + " to: " + Arrays.toString(paths));
- final int uid = Binder.getCallingUid();
- final int permission = mContext.checkCallingPermission(
- android.Manifest.permission.INSTALL_PACKAGES);
- final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED);
- if (!allowedByPermission) {
- throw new SecurityException("Permission denial: attempt to set .obb file from pid="
- + Binder.getCallingPid());
- }
- synchronized (mPackages) {
- final PackageSetting pkgSetting = mSettings.mPackages.get(packageName);
- if (pkgSetting == null) {
- throw new IllegalArgumentException("Unknown package: " + packageName);
- }
-
- if (paths != null) {
- if (paths.length == 0) {
- // Don't bother storing an empty array.
- paths = null;
- } else {
- // Don't allow the caller to manipulate our copy of the
- // list.
- paths = paths.clone();
- }
- }
-
- // Only write settings file if the new and old settings are not the
- // same.
- if (!Arrays.equals(paths, pkgSetting.obbPathStrings)) {
- pkgSetting.obbPathStrings = paths;
- mSettings.writeLP();
- }
- }
- }
-
- public String[] getPackageObbPaths(String packageName) {
- if (DEBUG_OBB)
- Log.v(TAG, "Getting .obb paths for " + packageName);
- final int uid = Binder.getCallingUid();
- final int permission = mContext.checkCallingPermission(
- android.Manifest.permission.INSTALL_PACKAGES);
- final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED);
- synchronized (mPackages) {
- final PackageSetting pkgSetting = mSettings.mPackages.get(packageName);
- if (pkgSetting == null) {
- throw new IllegalArgumentException("Unknown package: " + packageName);
- }
- if (!allowedByPermission && (uid != pkgSetting.userId)) {
- throw new SecurityException("Permission denial: attempt to set .obb file from pid="
- + Binder.getCallingPid() + ", uid=" + uid + ", package uid="
- + pkgSetting.userId);
- }
- return pkgSetting.obbPathStrings;
- }
- }
-
private void processPendingInstall(final InstallArgs args, final int currentStatus) {
// Queue up an async operation since the package installation may take a little while.
mHandler.post(new Runnable() {
@@ -7338,7 +7278,6 @@
pw.print(" codePath="); pw.println(ps.codePathString);
pw.print(" resourcePath="); pw.println(ps.resourcePathString);
pw.print(" nativeLibraryPath="); pw.println(ps.nativeLibraryPathString);
- pw.print(" obbPaths="); pw.println(Arrays.toString(ps.obbPathStrings));
pw.print(" versionCode="); pw.println(ps.versionCode);
if (ps.pkg != null) {
pw.print(" versionName="); pw.println(ps.pkg.mVersionName);
@@ -7922,7 +7861,6 @@
File resourcePath;
String resourcePathString;
String nativeLibraryPathString;
- String[] obbPathStrings;
long timeStamp;
long firstInstallTime;
long lastUpdateTime;
@@ -7968,11 +7906,6 @@
resourcePath = base.resourcePath;
resourcePathString = base.resourcePathString;
nativeLibraryPathString = base.nativeLibraryPathString;
-
- if (base.obbPathStrings != null) {
- obbPathStrings = base.obbPathStrings.clone();
- }
-
timeStamp = base.timeStamp;
firstInstallTime = base.firstInstallTime;
lastUpdateTime = base.lastUpdateTime;
@@ -9031,16 +8964,6 @@
if (pkg.installerPackageName != null) {
serializer.attribute(null, "installer", pkg.installerPackageName);
}
- if (pkg.obbPathStrings != null && pkg.obbPathStrings.length > 0) {
- int N = pkg.obbPathStrings.length;
- serializer.startTag(null, "obbs");
- for (int i = 0; i < N; i++) {
- serializer.startTag(null, "obb");
- serializer.attribute(null, "path", pkg.obbPathStrings[i]);
- serializer.endTag(null, "obb");
- }
- serializer.endTag(null, "obbs");
- }
pkg.signatures.writeXml(serializer, "sigs", mPastSignatures);
if ((pkg.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0) {
serializer.startTag(null, "perms");
@@ -9633,8 +9556,6 @@
readGrantedPermissionsLP(parser,
packageSetting.grantedPermissions);
packageSetting.permissionsFixed = true;
- } else if (tagName.equals("obbs")) {
- readObbPathsLP(packageSetting, parser);
} else {
reportSettingsProblem(Log.WARN,
"Unknown element under <package>: "
@@ -9839,34 +9760,6 @@
}
}
- private void readObbPathsLP(PackageSettingBase packageSetting, XmlPullParser parser)
- throws XmlPullParserException, IOException {
- final List<String> obbPaths = new ArrayList<String>();
- final int outerDepth = parser.getDepth();
- int type;
- while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
- && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
- if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
- continue;
- }
-
- final String tagName = parser.getName();
- if (tagName.equals("obb")) {
- final String path = parser.getAttributeValue(null, "path");
- obbPaths.add(path);
- } else {
- reportSettingsProblem(Log.WARN, "Unknown element under <obbs>: "
- + parser.getName());
- }
- XmlUtils.skipCurrentTag(parser);
- }
- if (obbPaths.size() == 0) {
- return;
- } else {
- packageSetting.obbPathStrings = obbPaths.toArray(new String[obbPaths.size()]);
- }
- }
-
// Returns -1 if we could not find an available UserId to assign
private int newUserIdLP(Object obj) {
// Let's be stupidly inefficient for now...
diff --git a/services/java/com/android/server/UsbService.java b/services/java/com/android/server/UsbService.java
index 77ddf3b..8ef03d4 100644
--- a/services/java/com/android/server/UsbService.java
+++ b/services/java/com/android/server/UsbService.java
@@ -134,14 +134,17 @@
mContext = context;
init(); // set initial status
- mUEventObserver.startObserving(USB_CONNECTED_MATCH);
- mUEventObserver.startObserving(USB_CONFIGURATION_MATCH);
- mUEventObserver.startObserving(USB_FUNCTIONS_MATCH);
+ if (mConfiguration >= 0) {
+ mUEventObserver.startObserving(USB_CONNECTED_MATCH);
+ mUEventObserver.startObserving(USB_CONFIGURATION_MATCH);
+ mUEventObserver.startObserving(USB_FUNCTIONS_MATCH);
+ }
}
private final void init() {
char[] buffer = new char[1024];
+ mConfiguration = -1;
try {
FileReader file = new FileReader(USB_CONNECTED_PATH);
int len = file.read(buffer, 0, 1024);
@@ -154,10 +157,12 @@
mConfiguration = Integer.valueOf((new String(buffer, 0, len)).trim());
} catch (FileNotFoundException e) {
- Slog.w(TAG, "This kernel does not have USB configuration switch support");
+ Slog.i(TAG, "This kernel does not have USB configuration switch support");
} catch (Exception e) {
Slog.e(TAG, "" , e);
}
+ if (mConfiguration < 0)
+ return;
try {
File[] files = new File(USB_COMPOSITE_CLASS_PATH).listFiles();
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 134b91e..dd9db9a 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -1233,18 +1233,18 @@
for (String iface : ifaces) {
for (String regex : mUpstreamIfaceRegexs) {
if (iface.matches(regex)) {
- // verify it is up!
+ // verify it is active
InterfaceConfiguration ifcg = null;
try {
ifcg = service.getInterfaceConfig(iface);
+ if (ifcg.isActive()) {
+ return iface;
+ }
} catch (Exception e) {
Log.e(TAG, "Error getting iface config :" + e);
// ignore - try next
continue;
}
- if (ifcg.interfaceFlags.contains("up")) {
- return iface;
- }
}
}
}
diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 2e4199e..0d20496 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -495,18 +495,4 @@
public boolean isSafeMode() {
throw new UnsupportedOperationException();
}
-
- public void setPackageObbPath(String packageName, String path) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setPackageObbPaths(String packageName, String[] paths) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String[] getPackageObbPaths(String packageName) {
- throw new UnsupportedOperationException();
- }
}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
index 4054353..607a173 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
@@ -25,6 +25,7 @@
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.os.Bundle;
+import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.animation.Animation;
@@ -61,7 +62,15 @@
mBitmap1 = BitmapFactory.decodeResource(c.getResources(), R.drawable.sunset1);
mBitmap2 = BitmapFactory.decodeResource(c.getResources(), R.drawable.sunset2);
+
+ Log.d("Bitmap", "mBitmap1.isMutable() = " + mBitmap1.isMutable());
+ Log.d("Bitmap", "mBitmap2.isMutable() = " + mBitmap2.isMutable());
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inMutable = true;
+ Bitmap bitmap = BitmapFactory.decodeResource(c.getResources(), R.drawable.sunset1, opts);
+ Log.d("Bitmap", "bitmap.isMutable() = " + bitmap.isMutable());
+
mBitmapPaint = new Paint();
mDstIn = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
}