Merge branch 'cupcake'
diff --git a/api/current.xml b/api/current.xml
index e183217..c84d27f 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -26770,6 +26770,28 @@
visibility="public"
>
</field>
+<field name="ACTION_POWER_CONNECTED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.intent.action.POWER_CONNECTED""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ACTION_POWER_DISCONNECTED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.intent.action.POWER_DISCONNECTED""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="ACTION_PROVIDER_CHANGED"
type="java.lang.String"
transient="false"
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 4a92b4c..39888c1 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -506,6 +506,8 @@
* <li> {@link #ACTION_PACKAGE_REMOVED}
* <li> {@link #ACTION_UID_REMOVED}
* <li> {@link #ACTION_BATTERY_CHANGED}
+ * <li> {@link #ACTION_POWER_CONNECTED}
+ * <li> {@link #ACTION_POWER_DISCONNECTED}
* </ul>
*
* <h3>Standard Categories</h3>
@@ -1175,6 +1177,25 @@
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_BATTERY_LOW = "android.intent.action.BATTERY_LOW";
/**
+ * Broadcast Action: External power has been connected to the device.
+ * This is intended for applications that wish to register specifically to this notification.
+ * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to
+ * stay active to receive this notification. This action can be used to implement actions
+ * that wait until power is available to trigger.
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_POWER_CONNECTED = "android.intent.action.POWER_CONNECTED";
+ /**
+ * Broadcast Action: External power has been removed from the device.
+ * This is intended for applications that wish to register specifically to this notification.
+ * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to
+ * stay active to receive this notification. This action can be used to implement actions
+ * that wait until power is available to trigger.
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_POWER_DISCONNECTED =
+ "android.intent.action.POWER_DISCONNECTED";
+ /**
* Broadcast Action: Indicates low memory condition on the device
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java
index e81bc86..b151de5 100644
--- a/core/java/android/content/IntentFilter.java
+++ b/core/java/android/content/IntentFilter.java
@@ -351,6 +351,7 @@
throws MalformedMimeTypeException {
mPriority = 0;
mActions = new ArrayList<String>();
+ addAction(action);
addDataType(dataType);
}
diff --git a/core/java/android/provider/Contacts.java b/core/java/android/provider/Contacts.java
index 085c095..e006d8c 100644
--- a/core/java/android/provider/Contacts.java
+++ b/core/java/android/provider/Contacts.java
@@ -1178,7 +1178,7 @@
*/
public interface OrganizationColumns {
/**
- * The type of the the phone number.
+ * The type of the organizations.
* <P>Type: INTEGER (one of the constants below)</P>
*/
public static final String TYPE = "type";
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index e928998..03ae6dc 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -30,8 +30,9 @@
import android.util.AttributeSet;
import android.util.Config;
import android.util.Log;
-import java.util.ArrayList;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
import java.util.concurrent.locks.ReentrantLock;
import java.lang.ref.WeakReference;
diff --git a/core/java/android/widget/TwoLineListItem.java b/core/java/android/widget/TwoLineListItem.java
index 77ea645..9a72980 100644
--- a/core/java/android/widget/TwoLineListItem.java
+++ b/core/java/android/widget/TwoLineListItem.java
@@ -36,8 +36,8 @@
* that can be displayed when a TwoLineListItem has focus. Android supplies a
* {@link android.R.layout#two_line_list_item standard layout resource for TwoLineListView}
* (which does not include a selected item icon), but you can design your own custom XML
- * layout for this object as shown here:</p>
- * {@sample packages/apps/Phone/res/layout/dialer_list_item.xml}
+ * layout for this object as shown in the Phone Application.
+ * (packages/apps/Phone/res/layout/dialer_list_item.xml)
*
* @attr ref android.R.styleable#TwoLineListItem_mode
*/
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 32c3a54..4452b79 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -161,7 +161,8 @@
ifeq ($(BOARD_HAVE_BLUETOOTH),true)
LOCAL_C_INCLUDES += \
external/dbus \
- external/bluez/libs/include
+ external/bluez/libs/include \
+ system/bluetooth/bluedroid/include
LOCAL_CFLAGS += -DHAVE_BLUETOOTH
LOCAL_SHARED_LIBRARIES += libbluedroid libdbus
endif
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java
index dba8fca..ed53272 100644
--- a/services/java/com/android/server/BatteryService.java
+++ b/services/java/com/android/server/BatteryService.java
@@ -170,6 +170,16 @@
mBatteryLevel, mBatteryVoltage, mBatteryTemperature);
}
+ // Separate broadcast is sent for power connected / not connected
+ // since the standard intent will not wake any applications and some
+ // applications may want to have smart behavior based on this.
+ if (mPlugType != 0 && mLastPlugType == 0) {
+ mContext.sendBroadcast(new Intent(Intent.ACTION_POWER_CONNECTED));
+ }
+ else if (mPlugType == 0 && mLastPlugType != 0) {
+ mContext.sendBroadcast(new Intent(Intent.ACTION_POWER_DISCONNECTED));
+ }
+
mLastBatteryStatus = mBatteryStatus;
mLastBatteryHealth = mBatteryHealth;
mLastBatteryPresent = mBatteryPresent;
diff --git a/telephony/java/com/android/internal/telephony/gsm/RIL.java b/telephony/java/com/android/internal/telephony/gsm/RIL.java
index 45000ba..8ec286a 100644
--- a/telephony/java/com/android/internal/telephony/gsm/RIL.java
+++ b/telephony/java/com/android/internal/telephony/gsm/RIL.java
@@ -1577,12 +1577,22 @@
* {@inheritDoc}
*/
public void getNeighboringCids(Message response) {
- RILRequest rr = RILRequest.obtain(
+ /* TODO: Remove this hack when backward compatibility issue is fixed.
+ * RIL_REQUEST_GET_NEIGHBORING_CELL_IDS currently returns REQUEST_NOT_SUPPORTED
+ */
+
+ AsyncResult.forMessage(response).exception =
+ new CommandException(CommandException.Error.REQUEST_NOT_SUPPORTED);
+ response.sendToTarget();
+ response = null;
+
+ /* RILRequest rr = RILRequest.obtain(
RILConstants.RIL_REQUEST_GET_NEIGHBORING_CELL_IDS, response);
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
+ */
}
/**
diff --git a/tools/aidl/generate_java.cpp b/tools/aidl/generate_java.cpp
index e3c0af0..25d47a2 100644
--- a/tools/aidl/generate_java.cpp
+++ b/tools/aidl/generate_java.cpp
@@ -1,6 +1,7 @@
#include "generate_java.h"
#include "AST.h"
#include "Type.h"
+#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/aidl/options.h b/tools/aidl/options.h
index dc3c45a..e7e62ec 100644
--- a/tools/aidl/options.h
+++ b/tools/aidl/options.h
@@ -1,6 +1,7 @@
#ifndef DEVICE_TOOLS_AIDL_H
#define DEVICE_TOOLS_AIDL_H
+#include <string.h>
#include <string>
#include <vector>
diff --git a/tools/localize/Perforce.cpp b/tools/localize/Perforce.cpp
index 3425668..25c336c 100644
--- a/tools/localize/Perforce.cpp
+++ b/tools/localize/Perforce.cpp
@@ -5,6 +5,8 @@
#include <sstream>
#include <sys/types.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/wait.h>
using namespace std;
diff --git a/tools/localize/XMLHandler.h b/tools/localize/XMLHandler.h
index 1130710..324385f 100644
--- a/tools/localize/XMLHandler.h
+++ b/tools/localize/XMLHandler.h
@@ -3,6 +3,7 @@
#include "SourcePos.h"
+#include <algorithm>
#include <string>
#include <vector>
#include <map>
diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp
index bb82a9c..dc8e86b 100644
--- a/tools/localize/file_utils.cpp
+++ b/tools/localize/file_utils.cpp
@@ -6,6 +6,8 @@
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
#include <host/Directories.h>
#include "log.h"
diff --git a/tools/localize/localize.cpp b/tools/localize/localize.cpp
index c0d84cc..68c03b6 100644
--- a/tools/localize/localize.cpp
+++ b/tools/localize/localize.cpp
@@ -15,6 +15,7 @@
#include <sstream>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
using namespace std;