Merge "Fix uncaught exception in WindowManager#setWallpaperOffsets (issue 5613241)" into ics-mr1
diff --git a/api/current.txt b/api/current.txt
index ea97d6d4..f33c6cb 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -4475,10 +4475,12 @@
method public android.bluetooth.BluetoothSocket createInsecureRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
method public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
method public int describeContents();
+ method public boolean fetchUuidsWithSdp();
method public java.lang.String getAddress();
method public android.bluetooth.BluetoothClass getBluetoothClass();
method public int getBondState();
method public java.lang.String getName();
+ method public android.os.ParcelUuid[] getUuids();
method public void writeToParcel(android.os.Parcel, int);
field public static final java.lang.String ACTION_ACL_CONNECTED = "android.bluetooth.device.action.ACL_CONNECTED";
field public static final java.lang.String ACTION_ACL_DISCONNECTED = "android.bluetooth.device.action.ACL_DISCONNECTED";
@@ -4487,6 +4489,7 @@
field public static final java.lang.String ACTION_CLASS_CHANGED = "android.bluetooth.device.action.CLASS_CHANGED";
field public static final java.lang.String ACTION_FOUND = "android.bluetooth.device.action.FOUND";
field public static final java.lang.String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
+ field public static final java.lang.String ACTION_UUID = "android.bluetooth.device.action.UUID";
field public static final int BOND_BONDED = 12; // 0xc
field public static final int BOND_BONDING = 11; // 0xb
field public static final int BOND_NONE = 10; // 0xa
@@ -4498,6 +4501,7 @@
field public static final java.lang.String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
field public static final java.lang.String EXTRA_PREVIOUS_BOND_STATE = "android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
field public static final java.lang.String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI";
+ field public static final java.lang.String EXTRA_UUID = "android.bluetooth.device.extra.UUID";
}
public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
@@ -8793,6 +8797,7 @@
method public long getTimestamp();
method public void getTransformMatrix(float[]);
method public void release();
+ method public void setDefaultBufferSize(int, int);
method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener);
method public void updateTexImage();
}
@@ -10691,6 +10696,7 @@
field public static final int METADATA_KEY_GENRE = 6; // 0x6
field public static final int METADATA_KEY_HAS_AUDIO = 16; // 0x10
field public static final int METADATA_KEY_HAS_VIDEO = 17; // 0x11
+ field public static final int METADATA_KEY_LOCATION = 23; // 0x17
field public static final int METADATA_KEY_MIMETYPE = 12; // 0xc
field public static final int METADATA_KEY_NUM_TRACKS = 10; // 0xa
field public static final int METADATA_KEY_TITLE = 7; // 0x7
@@ -15127,6 +15133,7 @@
public class RemoteException extends android.util.AndroidException {
ctor public RemoteException();
+ ctor public RemoteException(java.lang.String);
}
public class ResultReceiver implements android.os.Parcelable {
@@ -15221,6 +15228,10 @@
method public abstract void released();
}
+ public class TransactionTooLargeException extends android.os.RemoteException {
+ ctor public TransactionTooLargeException();
+ }
+
public class Vibrator {
method public void cancel();
method public boolean hasVibrator();
@@ -16607,6 +16618,10 @@
field public static final java.lang.String PHOTO_FILE_ID = "data14";
}
+ public static final class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns {
+ field public static final java.lang.String CONTENT_DIRECTORY = "stream_items";
+ }
+
protected static abstract interface ContactsContract.ContactsColumns {
field public static final java.lang.String DISPLAY_NAME = "display_name";
field public static final java.lang.String HAS_PHONE_NUMBER = "has_phone_number";
@@ -16864,6 +16879,10 @@
field public static final java.lang.String DATA_ID = "data_id";
}
+ public static final class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
+ field public static final java.lang.String CONTENT_DIRECTORY = "stream_items";
+ }
+
protected static abstract interface ContactsContract.RawContactsColumns {
field public static final java.lang.String AGGREGATION_MODE = "aggregation_mode";
field public static final java.lang.String CONTACT_ID = "contact_id";
@@ -16927,6 +16946,56 @@
field public static final android.net.Uri PROFILE_CONTENT_URI;
}
+ public static final class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
+ field public static final java.lang.String PHOTO = "photo";
+ }
+
+ protected static abstract interface ContactsContract.StreamItemPhotosColumns {
+ field public static final java.lang.String PHOTO_FILE_ID = "photo_file_id";
+ field public static final java.lang.String PHOTO_URI = "photo_uri";
+ field public static final java.lang.String SORT_INDEX = "sort_index";
+ field public static final java.lang.String STREAM_ITEM_ID = "stream_item_id";
+ field public static final java.lang.String SYNC1 = "stream_item_photo_sync1";
+ field public static final java.lang.String SYNC2 = "stream_item_photo_sync2";
+ field public static final java.lang.String SYNC3 = "stream_item_photo_sync3";
+ field public static final java.lang.String SYNC4 = "stream_item_photo_sync4";
+ }
+
+ public static final class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
+ field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item";
+ field public static final android.net.Uri CONTENT_LIMIT_URI;
+ field public static final android.net.Uri CONTENT_PHOTO_URI;
+ field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item";
+ field public static final android.net.Uri CONTENT_URI;
+ field public static final java.lang.String MAX_ITEMS = "max_items";
+ }
+
+ public static final class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
+ field public static final java.lang.String CONTENT_DIRECTORY = "photo";
+ field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo";
+ field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo";
+ }
+
+ protected static abstract interface ContactsContract.StreamItemsColumns {
+ field public static final java.lang.String ACCOUNT_NAME = "account_name";
+ field public static final java.lang.String ACCOUNT_TYPE = "account_type";
+ field public static final java.lang.String COMMENTS = "comments";
+ field public static final java.lang.String CONTACT_ID = "contact_id";
+ field public static final java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup";
+ field public static final java.lang.String DATA_SET = "data_set";
+ field public static final java.lang.String RAW_CONTACT_ID = "raw_contact_id";
+ field public static final java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
+ field public static final java.lang.String RES_ICON = "icon";
+ field public static final java.lang.String RES_LABEL = "label";
+ field public static final java.lang.String RES_PACKAGE = "res_package";
+ field public static final java.lang.String SYNC1 = "stream_item_sync1";
+ field public static final java.lang.String SYNC2 = "stream_item_sync2";
+ field public static final java.lang.String SYNC3 = "stream_item_sync3";
+ field public static final java.lang.String SYNC4 = "stream_item_sync4";
+ field public static final java.lang.String TEXT = "text";
+ field public static final java.lang.String TIMESTAMP = "timestamp";
+ }
+
protected static abstract interface ContactsContract.SyncColumns implements android.provider.ContactsContract.BaseSyncColumns {
field public static final java.lang.String ACCOUNT_NAME = "account_name";
field public static final java.lang.String ACCOUNT_TYPE = "account_type";
@@ -18822,7 +18891,8 @@
method public int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>);
method public deprecated int setEngineByPackageName(java.lang.String);
method public int setLanguage(java.util.Locale);
- method public int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener);
+ method public deprecated int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener);
+ method public int setOnUtteranceProgressListener(android.speech.tts.UtteranceProgressListener);
method public int setPitch(float);
method public int setSpeechRate(float);
method public void shutdown();
@@ -18895,6 +18965,13 @@
method protected abstract void onSynthesizeText(android.speech.tts.SynthesisRequest, android.speech.tts.SynthesisCallback);
}
+ public abstract class UtteranceProgressListener {
+ ctor public UtteranceProgressListener();
+ method public abstract void onDone(java.lang.String);
+ method public abstract void onError(java.lang.String);
+ method public abstract void onStart(java.lang.String);
+ }
+
}
package android.telephony {
@@ -24761,6 +24838,7 @@
}
public class SpellCheckerSession {
+ method public void cancel();
method public void close();
method public android.view.textservice.SpellCheckerInfo getSpellChecker();
method public void getSuggestions(android.view.textservice.TextInfo, int);
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 4f72289..7c03a2f 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -109,6 +109,10 @@
runStartService();
} else if (op.equals("force-stop")) {
runForceStop();
+ } else if (op.equals("kill")) {
+ runKill();
+ } else if (op.equals("kill-all")) {
+ runKillAll();
} else if (op.equals("instrument")) {
runInstrument();
} else if (op.equals("broadcast")) {
@@ -484,6 +488,14 @@
mAm.forceStopPackage(nextArgRequired());
}
+ private void runKill() throws Exception {
+ mAm.killBackgroundProcesses(nextArgRequired());
+ }
+
+ private void runKillAll() throws Exception {
+ mAm.killAllBackgroundProcesses();
+ }
+
private void sendBroadcast() throws Exception {
Intent intent = makeIntent();
IntentReceiver receiver = new IntentReceiver();
@@ -1179,6 +1191,8 @@
" [--R COUNT] [-S] <INTENT>\n" +
" am startservice <INTENT>\n" +
" am force-stop <PACKAGE>\n" +
+ " am kill <PACKAGE>\n" +
+ " am kill-all\n" +
" am broadcast <INTENT>\n" +
" am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]\n" +
" [--no-window-animation] <COMPONENT>\n" +
@@ -1202,6 +1216,12 @@
"\n" +
"am force-stop: force stop everything associated with <PACKAGE>.\n" +
"\n" +
+ "am kill: Kill all processes associated with <PACKAGE>. Only kills.\n" +
+ " processes that are safe to kill -- that is, will not impact the user\n" +
+ " experience.\n" +
+ "\n" +
+ "am kill-all: Kill all background processes.\n" +
+ "\n" +
"am broadcast: send a broadcast Intent.\n" +
"\n" +
"am instrument: start an Instrumentation. Typically this target <COMPONENT>\n" +
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index d816e7c..154dbb8 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -42,6 +42,7 @@
#include <surfaceflinger/ISurfaceComposerClient.h>
#include <core/SkBitmap.h>
+#include <core/SkStream.h>
#include <images/SkImageDecoder.h>
#include <GLES/gl.h>
@@ -150,9 +151,15 @@
//StopWatch watch("blah");
SkBitmap bitmap;
- SkImageDecoder::DecodeMemory(buffer, len,
- &bitmap, SkBitmap::kRGB_565_Config,
- SkImageDecoder::kDecodePixels_Mode);
+ SkMemoryStream stream(buffer, len);
+ SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
+ codec->setDitherImage(false);
+ if (codec) {
+ codec->decode(&stream, &bitmap,
+ SkBitmap::kRGB_565_Config,
+ SkImageDecoder::kDecodePixels_Mode);
+ delete codec;
+ }
// ensure we can call getPixels(). No need to call unlock, since the
// bitmap will go out of scope when we return from this method.
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index 2378345..bd430d1 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -360,7 +360,7 @@
service->create(getpid(), client, 0);
if (player != NULL && player->setDataSource(source) == NO_ERROR) {
- player->setVideoSurface(surface);
+ player->setVideoSurfaceTexture(surface->getSurfaceTexture());
player->start();
client->waitForEOS();
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index f383af9..7f0ea99 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -657,6 +657,15 @@
*/
private void setupChangeAnimation(final ViewGroup parent, final int changeReason,
Animator baseAnimator, final long duration, final View child) {
+
+ // If we already have a listener for this child, then we've already set up the
+ // changing animation we need. Multiple calls for a child may occur when several
+ // add/remove operations are run at once on a container; each one will trigger
+ // changes for the existing children in the container.
+ if (layoutChangeListenerMap.get(child) != null) {
+ return;
+ }
+
// Make a copy of the appropriate animation
final Animator anim = baseAnimator.clone();
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index b4471f0..7994d7c 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1092,6 +1092,13 @@
reply.writeNoException();
return true;
}
+
+ case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ killAllBackgroundProcesses();
+ reply.writeNoException();
+ return true;
+ }
case FORCE_STOP_PACKAGE_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
@@ -2906,7 +2913,7 @@
data.recycle();
reply.recycle();
}
-
+
public void killBackgroundProcesses(String packageName) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -2917,7 +2924,17 @@
data.recycle();
reply.recycle();
}
-
+
+ public void killAllBackgroundProcesses() throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
+ reply.readException();
+ data.recycle();
+ reply.recycle();
+ }
+
public void forceStopPackage(String packageName) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 00fe953..f9896f7 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -45,6 +45,7 @@
import android.net.IConnectivityManager;
import android.net.Proxy;
import android.net.ProxyProperties;
+import android.opengl.GLUtils;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Debug;
@@ -3714,6 +3715,24 @@
}
}
+ private void setupGraphicsSupport(LoadedApk info) {
+ try {
+ int uid = Process.myUid();
+ String[] packages = getPackageManager().getPackagesForUid(uid);
+
+ // If there are several packages in this application we won't
+ // initialize the graphics disk caches
+ if (packages.length == 1) {
+ ContextImpl appContext = new ContextImpl();
+ appContext.init(info, null, this);
+
+ HardwareRenderer.setupDiskCache(appContext.getCacheDir());
+ }
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ }
+
private void handleBindApplication(AppBindData data) {
mBoundApplication = data;
mConfiguration = new Configuration(data.config);
@@ -3737,7 +3756,7 @@
HardwareRenderer.disable(false);
}
}
-
+
if (mProfiler.profileFd != null) {
mProfiler.startProfiling();
}
@@ -3773,6 +3792,8 @@
data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo);
+ setupGraphicsSupport(data.info);
+
/**
* For system applications on userdebug/eng builds, log stack
* traces of disk and network access to dropbox for analysis.
@@ -3832,11 +3853,16 @@
* Initialize the default http proxy in this process for the reasons we set the time zone.
*/
IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
- IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
- try {
- ProxyProperties proxyProperties = service.getProxy();
- Proxy.setHttpProxySystemProperty(proxyProperties);
- } catch (RemoteException e) {}
+ if (b != null) {
+ // In pre-boot mode (doing initial launch to collect password), not
+ // all system is up. This includes the connectivity service, so don't
+ // crash if we can't get it.
+ IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
+ try {
+ ProxyProperties proxyProperties = service.getProxy();
+ Proxy.setHttpProxySystemProperty(proxyProperties);
+ } catch (RemoteException e) {}
+ }
if (data.instrumentationName != null) {
ContextImpl appContext = new ContextImpl();
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 26813bf..5222d37 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -234,6 +234,7 @@
public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException;
public void killBackgroundProcesses(final String packageName) throws RemoteException;
+ public void killAllBackgroundProcesses() throws RemoteException;
public void forceStopPackage(final String packageName) throws RemoteException;
// Note: probably don't want to allow applications access to these.
@@ -605,4 +606,5 @@
int GET_PROCESS_PSS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+136;
int SHOW_BOOT_MESSAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+137;
int DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+138;
+ int KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+139;
}
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 522f477..0c6baeb 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -901,6 +901,7 @@
private RuntimeException mUnbindLocation;
private boolean mDied;
+ private boolean mForgotten;
private static class ConnectionInfo {
IBinder binder;
@@ -959,6 +960,7 @@
ci.binder.unlinkToDeath(ci.deathMonitor, 0);
}
mActiveConnections.clear();
+ mForgotten = true;
}
}
@@ -1020,6 +1022,11 @@
ServiceDispatcher.ConnectionInfo info;
synchronized (this) {
+ if (mForgotten) {
+ // We unbound before receiving the connection; ignore
+ // any connection received.
+ return;
+ }
old = mActiveConnections.get(name);
if (old != null && old.binder == service) {
// Huh, already have this one. Oh well!
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 4cb8220..0306521 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -247,13 +247,12 @@
* has been fetched. This intent is sent only when the UUIDs of the remote
* device are requested to be fetched using Service Discovery Protocol
* <p> Always contains the extra field {@link #EXTRA_DEVICE}
- * <p> Always contains the extra filed {@link #EXTRA_UUID}
+ * <p> Always contains the extra field {@link #EXTRA_UUID}
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
- * @hide
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_UUID =
- "android.bleutooth.device.action.UUID";
+ "android.bluetooth.device.action.UUID";
/**
* Broadcast Action: Indicates a failure to retrieve the name of a remote
@@ -451,7 +450,6 @@
* Used as an extra field in {@link #ACTION_UUID} intents,
* Contains the {@link android.os.ParcelUuid}s of the remote device which
* is a parcelable version of {@link UUID}.
- * @hide
*/
public static final String EXTRA_UUID = "android.bluetooth.device.extra.UUID";
@@ -770,7 +768,18 @@
return false;
}
- /** @hide */
+ /**
+ * Returns the supported features (UUIDs) of the remote device.
+ *
+ * <p>This method does not start a service discovery procedure to retrieve the UUIDs
+ * from the remote device. Instead, the local cached copy of the service
+ * UUIDs are returned.
+ * <p>Use {@link #fetchUuidsWithSdp} if fresh UUIDs are desired.
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
+ *
+ * @return the supported features (UUIDs) of the remote device,
+ * or null on error
+ */
public ParcelUuid[] getUuids() {
try {
return sService.getRemoteUuids(mAddress);
@@ -779,18 +788,19 @@
}
/**
- * Perform a SDP query on the remote device to get the UUIDs
- * supported. This API is asynchronous and an Intent is sent,
- * with the UUIDs supported by the remote end. If there is an error
- * in getting the SDP records or if the process takes a long time,
- * an Intent is sent with the UUIDs that is currently present in the
- * cache. Clients should use the {@link #getUuids} to get UUIDs
- * is SDP is not to be performed.
+ * Perform a service discovery on the remote device to get the UUIDs supported.
*
- * @return False if the sanity check fails, True if the process
+ * <p>This API is asynchronous and {@link #ACTION_UUID} intent is sent,
+ * with the UUIDs supported by the remote end. If there is an error
+ * in getting the SDP records or if the process takes a long time,
+ * {@link #ACTION_UUID} intent is sent with the UUIDs that is currently
+ * present in the cache. Clients should use the {@link #getUuids} to get UUIDs
+ * if service discovery is not to be performed.
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
+ *
+ * @return False if the sanity check fails, True if the process
* of initiating an ACL connection to the remote device
* was started.
- * @hide
*/
public boolean fetchUuidsWithSdp() {
try {
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
index 7addd4a..b1d0070 100644
--- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java
+++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
@@ -86,7 +86,7 @@
private static final int CONNECTION_ACCESS_REQUEST_REPLY = 104;
private static final int CONNECTION_ACCESS_REQUEST_EXPIRY = 105;
- private static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs
+ public static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs
private static final int CONNECTION_ACCESS_REQUEST_EXPIRY_TIMEOUT = 7000; // 7 secs
private static final int CONNECTION_ACCESS_UNDEFINED = -1;
private static final long INIT_INCOMING_REJECT_TIMER = 1000; // 1 sec
diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl
index fefeb93..deea2b8 100644
--- a/core/java/android/bluetooth/IBluetooth.aidl
+++ b/core/java/android/bluetooth/IBluetooth.aidl
@@ -90,7 +90,7 @@
boolean connectHeadset(String address);
boolean disconnectHeadset(String address);
- boolean notifyIncomingConnection(String address);
+ boolean notifyIncomingConnection(String address, boolean rejected);
// HID profile APIs
boolean connectInputDevice(in BluetoothDevice device);
diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java
index ad1bfb2..bea6529 100644
--- a/core/java/android/content/res/XmlBlock.java
+++ b/core/java/android/content/res/XmlBlock.java
@@ -484,7 +484,7 @@
private final AssetManager mAssets;
private final int mNative;
- private final StringBlock mStrings;
+ /*package*/ final StringBlock mStrings;
private boolean mOpen = true;
private int mOpenCount = 1;
@@ -494,9 +494,9 @@
private static final native int nativeGetStringBlock(int obj);
private static final native int nativeCreateParseState(int obj);
- private static final native int nativeNext(int state);
+ /*package*/ static final native int nativeNext(int state);
private static final native int nativeGetNamespace(int state);
- private static final native int nativeGetName(int state);
+ /*package*/ static final native int nativeGetName(int state);
private static final native int nativeGetText(int state);
private static final native int nativeGetLineNumber(int state);
private static final native int nativeGetAttributeCount(int state);
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 48adfad..3becec0 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -22,9 +22,12 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
+import android.os.SystemProperties;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
@@ -154,6 +157,7 @@
private boolean mOneShot;
private boolean mWithBuffer;
private boolean mFaceDetectionRunning = false;
+ private boolean mReleased = false;
/**
* Broadcast Action: A new picture is taken by the camera, and the entry of
@@ -303,7 +307,7 @@
}
protected void finalize() {
- native_release();
+ release();
}
private native final void native_setup(Object camera_this, int cameraId);
@@ -318,6 +322,15 @@
public final void release() {
native_release();
mFaceDetectionRunning = false;
+ if (mCameraSoundPlayers != null) {
+ for (CameraSoundPlayer csp: mCameraSoundPlayers) {
+ if (csp != null) {
+ csp.release();
+ }
+ }
+ mCameraSoundPlayers = null;
+ }
+ mReleased = true;
}
/**
@@ -2354,7 +2367,7 @@
*
* <p>The reference code is as follows.
*
- * <pre>
+ * <pre>
* public void onOrientationChanged(int orientation) {
* if (orientation == ORIENTATION_UNKNOWN) return;
* android.hardware.Camera.CameraInfo info =
@@ -2369,7 +2382,7 @@
* }
* mParameters.setRotation(rotation);
* }
- * </pre>
+ * </pre>
*
* @param rotation The rotation angle in degrees relative to the
* orientation of the camera. Rotation can only be 0,
@@ -3452,4 +3465,194 @@
return result;
}
};
+
+ /**
+ * <p>The set of default system sounds for camera actions. Use this with
+ * {@link #playSound} to play an appropriate sound when implementing a
+ * custom still or video recording mechanism through the preview
+ * callbacks.</p>
+ *
+ * <p>There is no need to play sounds when using {@link #takePicture} or
+ * {@link android.media.MediaRecorder} for still images or video,
+ * respectively, as these play their own sounds when needed.</p>
+ *
+ * @see #playSound
+ * @hide
+ */
+ public static class Sound {
+ /**
+ * The sound used by {@link android.hardware.Camera#takePicture} to
+ * indicate still image capture.
+ */
+ public static final int SHUTTER_CLICK = 0;
+
+ /**
+ * A sound to indicate that focusing has completed. Because deciding
+ * when this occurs is application-dependent, this sound is not used by
+ * any methods in the Camera class.
+ */
+ public static final int FOCUS_COMPLETE = 1;
+
+ /**
+ * The sound used by {@link android.media.MediaRecorder#start} to
+ * indicate the start of video recording.
+ */
+ public static final int START_VIDEO_RECORDING = 2;
+
+ /**
+ * The sound used by {@link android.media.MediaRecorder#stop} to
+ * indicate the end of video recording.
+ */
+ public static final int STOP_VIDEO_RECORDING = 3;
+
+ private static final int NUM_SOUNDS = 4;
+ };
+
+ /**
+ * <p>Play one of the predefined platform sounds for camera actions.</p>
+ *
+ * <p>Use this method to play a platform-specific sound for various camera
+ * actions. The sound playing is done asynchronously, with the same behavior
+ * and content as the sounds played by {@link #takePicture takePicture},
+ * {@link android.media.MediaRecorder#start MediaRecorder.start}, and
+ * {@link android.media.MediaRecorder#stop MediaRecorder.stop}.</p>
+ *
+ * <p>Using this method makes it easy to match the default device sounds
+ * when recording or capturing data through the preview callbacks
+ * ({@link #setPreviewCallback setPreviewCallback},
+ * {@link #setPreviewTexture setPreviewTexture}).</p>
+ *
+ * @param soundId The type of sound to play, selected from the options in
+ * {@link android.hardware.Camera.Sound}
+ * @see android.hardware.Camera.Sound
+ * @see #takePicture
+ * @see android.media.MediaRecorder
+ * @hide
+ */
+ public void playSound(int soundId) {
+ if (mReleased) return;
+ if (mCameraSoundPlayers == null) {
+ mCameraSoundPlayers = new CameraSoundPlayer[Sound.NUM_SOUNDS];
+ }
+ if (mCameraSoundPlayers[soundId] == null) {
+ mCameraSoundPlayers[soundId] = new CameraSoundPlayer(soundId);
+ }
+ mCameraSoundPlayers[soundId].play();
+ }
+
+ private CameraSoundPlayer[] mCameraSoundPlayers;
+
+ private static class CameraSoundPlayer implements Runnable {
+ private int mSoundId;
+ private int mAudioStreamType;
+ private MediaPlayer mPlayer;
+ private Thread mThread;
+ private boolean mExit;
+ private int mPlayCount;
+
+ private static final String mShutterSound =
+ "/system/media/audio/ui/camera_click.ogg";
+ private static final String mFocusSound =
+ "/system/media/audio/ui/camera_focus.ogg";
+ private static final String mVideoStartSound =
+ "/system/media/audio/ui/VideoRecord.ogg";
+ private static final String mVideoStopSound =
+ "/system/media/audio/ui/VideoRecord.ogg";
+
+ @Override
+ public void run() {
+ String soundFilePath;
+ switch (mSoundId) {
+ case Sound.SHUTTER_CLICK:
+ soundFilePath = mShutterSound;
+ break;
+ case Sound.FOCUS_COMPLETE:
+ soundFilePath = mFocusSound;
+ break;
+ case Sound.START_VIDEO_RECORDING:
+ soundFilePath = mVideoStartSound;
+ break;
+ case Sound.STOP_VIDEO_RECORDING:
+ soundFilePath = mVideoStopSound;
+ break;
+ default:
+ Log.e(TAG, "Unknown sound " + mSoundId + " requested.");
+ return;
+ }
+ mPlayer = new MediaPlayer();
+ try {
+ mPlayer.setAudioStreamType(mAudioStreamType);
+ mPlayer.setDataSource(soundFilePath);
+ mPlayer.setLooping(false);
+ mPlayer.prepare();
+ } catch(IOException e) {
+ Log.e(TAG, "Error setting up sound " + mSoundId, e);
+ return;
+ }
+
+ while(true) {
+ try {
+ synchronized (this) {
+ while(true) {
+ if (mExit) {
+ return;
+ } else if (mPlayCount <= 0) {
+ wait();
+ } else {
+ mPlayCount--;
+ break;
+ }
+ }
+ }
+ mPlayer.start();
+ } catch (Exception e) {
+ Log.e(TAG, "Error playing sound " + mSoundId, e);
+ }
+ }
+ }
+
+ public CameraSoundPlayer(int soundId) {
+ mSoundId = soundId;
+ if (SystemProperties.get("ro.camera.sound.forced", "0").equals("0")) {
+ mAudioStreamType = AudioManager.STREAM_MUSIC;
+ } else {
+ mAudioStreamType = AudioManager.STREAM_SYSTEM_ENFORCED;
+ }
+ }
+
+ public void play() {
+ if (mThread == null) {
+ mThread = new Thread(this);
+ mThread.start();
+ }
+ synchronized (this) {
+ mPlayCount++;
+ notifyAll();
+ }
+ }
+
+ public void release() {
+ if (mThread != null) {
+ synchronized (this) {
+ mExit = true;
+ notifyAll();
+ }
+ try {
+ mThread.join();
+ } catch (InterruptedException e) {
+ }
+ mThread = null;
+ }
+ if (mPlayer != null) {
+ mPlayer.release();
+ mPlayer = null;
+ }
+ }
+
+ @Override
+ protected void finalize() {
+ release();
+ }
+ }
+
}
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index 5c6ef1a..f6e627c 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -165,6 +165,17 @@
dest.writeLongArray(operations);
}
+ @Override
+ public NetworkStats clone() {
+ final NetworkStats clone = new NetworkStats(elapsedRealtime, size);
+ NetworkStats.Entry entry = null;
+ for (int i = 0; i < size; i++) {
+ entry = getValues(i, entry);
+ clone.addValues(entry);
+ }
+ return clone;
+ }
+
// @VisibleForTesting
public NetworkStats addIfaceValues(
String iface, long rxBytes, long rxPackets, long txBytes, long txPackets) {
@@ -453,9 +464,22 @@
* time, and that none of them have disappeared.
*/
public NetworkStats subtract(NetworkStats value) throws NonMonotonicException {
+ return subtract(value, false);
+ }
+
+ /**
+ * Subtract the given {@link NetworkStats}, effectively leaving the delta
+ * between two snapshots in time. Assumes that statistics rows collect over
+ * time, and that none of them have disappeared.
+ *
+ * @param clampNonMonotonic When non-monotonic stats are found, just clamp
+ * to 0 instead of throwing {@link NonMonotonicException}.
+ */
+ public NetworkStats subtract(NetworkStats value, boolean clampNonMonotonic)
+ throws NonMonotonicException {
final long deltaRealtime = this.elapsedRealtime - value.elapsedRealtime;
if (deltaRealtime < 0) {
- throw new IllegalArgumentException("found non-monotonic realtime");
+ throw new NonMonotonicException(this, value);
}
// result will have our rows, and elapsed time between snapshots
@@ -486,7 +510,15 @@
if (entry.rxBytes < 0 || entry.rxPackets < 0 || entry.txBytes < 0
|| entry.txPackets < 0 || entry.operations < 0) {
- throw new NonMonotonicException(this, i, value, j);
+ if (clampNonMonotonic) {
+ entry.rxBytes = Math.max(entry.rxBytes, 0);
+ entry.rxPackets = Math.max(entry.rxPackets, 0);
+ entry.txBytes = Math.max(entry.txBytes, 0);
+ entry.txPackets = Math.max(entry.txPackets, 0);
+ entry.operations = Math.max(entry.operations, 0);
+ } else {
+ throw new NonMonotonicException(this, i, value, j);
+ }
}
}
@@ -575,7 +607,8 @@
pw.print("NetworkStats: elapsedRealtime="); pw.println(elapsedRealtime);
for (int i = 0; i < size; i++) {
pw.print(prefix);
- pw.print(" iface="); pw.print(iface[i]);
+ pw.print(" ["); pw.print(i); pw.print("]");
+ pw.print(" iface="); pw.print(iface[i]);
pw.print(" uid="); pw.print(uid[i]);
pw.print(" set="); pw.print(setToString(set[i]));
pw.print(" tag="); pw.print(tagToString(tag[i]));
@@ -638,6 +671,10 @@
public final int leftIndex;
public final int rightIndex;
+ public NonMonotonicException(NetworkStats left, NetworkStats right) {
+ this(left, -1, right, -1);
+ }
+
public NonMonotonicException(
NetworkStats left, int leftIndex, NetworkStats right, int rightIndex) {
this.left = checkNotNull(left, "missing left");
diff --git a/core/java/android/net/wimax/WimaxManagerConstants.java b/core/java/android/net/wimax/WimaxManagerConstants.java
new file mode 100644
index 0000000..b4aaf5b
--- /dev/null
+++ b/core/java/android/net/wimax/WimaxManagerConstants.java
@@ -0,0 +1,104 @@
+package android.net.wimax;
+
+/**
+ * {@hide}
+ */
+public class WimaxManagerConstants
+{
+
+ /**
+ * Used by android.net.wimax.WimaxManager for handling management of
+ * Wimax access.
+ */
+ public static final String WIMAX_SERVICE = "WiMax";
+
+ /**
+ * Broadcast intent action indicating that Wimax has been enabled, disabled,
+ * enabling, disabling, or unknown. One extra provides this state as an int.
+ * Another extra provides the previous state, if available.
+ */
+ public static final String NET_4G_STATE_CHANGED_ACTION =
+ "android.net.fourG.NET_4G_STATE_CHANGED";
+
+ /**
+ * The lookup key for an int that indicates whether Wimax is enabled,
+ * disabled, enabling, disabling, or unknown.
+ */
+ public static final String EXTRA_WIMAX_STATUS = "wimax_status";
+
+ /**
+ * Broadcast intent action indicating that Wimax state has been changed
+ * state could be scanning, connecting, connected, disconnecting, disconnected
+ * initializing, initialized, unknown and ready. One extra provides this state as an int.
+ * Another extra provides the previous state, if available.
+ */
+ public static final String WIMAX_NETWORK_STATE_CHANGED_ACTION =
+ "android.net.fourG.wimax.WIMAX_NETWORK_STATE_CHANGED";
+
+ /**
+ * Broadcast intent action indicating that Wimax signal level has been changed.
+ * Level varies from 0 to 3.
+ */
+ public static final String SIGNAL_LEVEL_CHANGED_ACTION =
+ "android.net.wimax.SIGNAL_LEVEL_CHANGED";
+
+ /**
+ * The lookup key for an int that indicates whether Wimax state is
+ * scanning, connecting, connected, disconnecting, disconnected
+ * initializing, initialized, unknown and ready.
+ */
+ public static final String EXTRA_WIMAX_STATE = "WimaxState";
+ public static final String EXTRA_4G_STATE = "4g_state";
+ public static final String EXTRA_WIMAX_STATE_INT = "WimaxStateInt";
+ /**
+ * The lookup key for an int that indicates whether state of Wimax
+ * is idle.
+ */
+ public static final String EXTRA_WIMAX_STATE_DETAIL = "WimaxStateDetail";
+
+ /**
+ * The lookup key for an int that indicates Wimax signal level.
+ */
+ public static final String EXTRA_NEW_SIGNAL_LEVEL = "newSignalLevel";
+
+ /**
+ * Indicatates Wimax is disabled.
+ */
+ public static final int NET_4G_STATE_DISABLED = 1;
+
+ /**
+ * Indicatates Wimax is enabled.
+ */
+ public static final int NET_4G_STATE_ENABLED = 3;
+
+ /**
+ * Indicatates Wimax status is known.
+ */
+ public static final int NET_4G_STATE_UNKNOWN = 4;
+
+ /**
+ * Indicatates Wimax is in idle state.
+ */
+ public static final int WIMAX_IDLE = 6;
+
+ /**
+ * Indicatates Wimax is being deregistered.
+ */
+ public static final int WIMAX_DEREGISTRATION = 8;
+
+ /**
+ * Indicatates wimax state is unknown.
+ */
+ public static final int WIMAX_STATE_UNKNOWN = 0;
+
+ /**
+ * Indicatates wimax state is connected.
+ */
+ public static final int WIMAX_STATE_CONNECTED = 7;
+
+ /**
+ * Indicatates wimax state is disconnected.
+ */
+ public static final int WIMAX_STATE_DISCONNECTED = 9;
+
+}
diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl
index 016af58..0b93ad0 100644
--- a/core/java/android/nfc/INfcAdapter.aidl
+++ b/core/java/android/nfc/INfcAdapter.aidl
@@ -32,7 +32,7 @@
interface INfcAdapter
{
INfcTag getNfcTagInterface();
- INfcAdapterExtras getNfcAdapterExtrasInterface();
+ INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
int getState();
boolean disable();
diff --git a/core/java/android/nfc/INfcAdapterExtras.aidl b/core/java/android/nfc/INfcAdapterExtras.aidl
index 0c2a2fd..2b9d4f0 100644
--- a/core/java/android/nfc/INfcAdapterExtras.aidl
+++ b/core/java/android/nfc/INfcAdapterExtras.aidl
@@ -23,10 +23,10 @@
* {@hide}
*/
interface INfcAdapterExtras {
- Bundle open(IBinder b);
- Bundle close();
- Bundle transceive(in byte[] data_in);
- int getCardEmulationRoute();
- void setCardEmulationRoute(int route);
- void authenticate(in byte[] token);
+ Bundle open(in String pkg, IBinder b);
+ Bundle close(in String pkg, IBinder b);
+ Bundle transceive(in String pkg, in byte[] data_in);
+ int getCardEmulationRoute(in String pkg);
+ void setCardEmulationRoute(in String pkg, int route);
+ void authenticate(in String pkg, in byte[] token);
}
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index 33310df..a9f1685 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -16,6 +16,8 @@
package android.nfc;
+import java.util.HashMap;
+
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.Activity;
@@ -197,15 +199,21 @@
static INfcTag sTagService;
/**
- * NfcAdapter is currently a singleton, and does not require a context.
- * However all the public API's are future-proofed to require a context.
- * If we start using that then we'll need to keep a HashMap of
- * Context.getApplicationContext() -> NfcAdapter, such that NfcAdapter
- * is a singleton within each application context.
+ * The NfcAdapter object for each application context.
+ * There is a 1-1 relationship between application context and
+ * NfcAdapter object.
*/
- static NfcAdapter sSingleton; // protected by NfcAdapter.class
+ static HashMap<Context, NfcAdapter> sNfcAdapters = new HashMap(); //guard by NfcAdapter.class
+
+ /**
+ * NfcAdapter used with a null context. This ctor was deprecated but we have
+ * to support it for backwards compatibility. New methods that require context
+ * might throw when called on the null-context NfcAdapter.
+ */
+ static NfcAdapter sNullContextNfcAdapter; // protected by NfcAdapter.class
final NfcActivityManager mNfcActivityManager;
+ final Context mContext;
/**
* A callback to be invoked when the system successfully delivers your {@link NdefMessage}
@@ -280,12 +288,12 @@
}
/**
- * Returns the singleton, or throws if NFC is not available.
+ * Returns the NfcAdapter for application context,
+ * or throws if NFC is not available.
+ * @hide
*/
- static synchronized NfcAdapter getSingleton() {
+ public static synchronized NfcAdapter getNfcAdapter(Context context) {
if (!sIsInitialized) {
- sIsInitialized = true;
-
/* is this device meant to have NFC */
if (!hasNfcFeature()) {
Log.v(TAG, "this device does not have NFC support");
@@ -303,12 +311,21 @@
Log.e(TAG, "could not retrieve NFC Tag service");
throw new UnsupportedOperationException();
}
- sSingleton = new NfcAdapter();
+
+ sIsInitialized = true;
}
- if (sSingleton == null) {
- throw new UnsupportedOperationException();
+ if (context == null) {
+ if (sNullContextNfcAdapter == null) {
+ sNullContextNfcAdapter = new NfcAdapter(null);
+ }
+ return sNullContextNfcAdapter;
}
- return sSingleton;
+ NfcAdapter adapter = sNfcAdapters.get(context);
+ if (adapter == null) {
+ adapter = new NfcAdapter(context);
+ sNfcAdapters.put(context, adapter);
+ }
+ return adapter;
}
/** get handle to NFC service interface */
@@ -336,6 +353,10 @@
* @return the default NFC adapter, or null if no NFC adapter exists
*/
public static NfcAdapter getDefaultAdapter(Context context) {
+ if (context == null) {
+ throw new IllegalArgumentException("context cannot be null");
+ }
+ context = context.getApplicationContext();
/* use getSystemService() instead of just instantiating to take
* advantage of the context's cached NfcManager & NfcAdapter */
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
@@ -343,25 +364,30 @@
}
/**
- * Get a handle to the default NFC Adapter on this Android device.
- * <p>
- * Most Android devices will only have one NFC Adapter (NFC Controller).
- *
- * @return the default NFC adapter, or null if no NFC adapter exists
+ * Legacy NfcAdapter getter, always use {@link #getDefaultAdapter(Context)} instead.<p>
+ * This method was deprecated at API level 10 (Gingerbread MR1) because a context is required
+ * for many NFC API methods. Those methods will fail when called on an NfcAdapter
+ * object created from this method.<p>
* @deprecated use {@link #getDefaultAdapter(Context)}
*/
@Deprecated
public static NfcAdapter getDefaultAdapter() {
Log.w(TAG, "WARNING: NfcAdapter.getDefaultAdapter() is deprecated, use " +
"NfcAdapter.getDefaultAdapter(Context) instead", new Exception());
- return getSingleton();
+
+ return NfcAdapter.getNfcAdapter(null);
+ }
+
+ NfcAdapter(Context context) {
+ mContext = context;
+ mNfcActivityManager = new NfcActivityManager(this);
}
/**
- * Does not currently need a context.
+ * @hide
*/
- NfcAdapter() {
- mNfcActivityManager = new NfcActivityManager(this);
+ public Context getContext() {
+ return mContext;
}
/**
@@ -768,6 +794,61 @@
}
/**
+ * TODO: Remove this once pre-built apk's (Maps, Youtube etc) are updated
+ * @deprecated use {@link CreateNdefMessageCallback} or {@link OnNdefPushCompleteCallback}
+ * @hide
+ */
+ @Deprecated
+ public interface NdefPushCallback {
+ /**
+ * @deprecated use {@link CreateNdefMessageCallback} instead
+ */
+ @Deprecated
+ NdefMessage createMessage();
+ /**
+ * @deprecated use{@link OnNdefPushCompleteCallback} instead
+ */
+ @Deprecated
+ void onMessagePushed();
+ }
+
+ /**
+ * TODO: Remove this
+ * Converts new callbacks to old callbacks.
+ */
+ static final class LegacyCallbackWrapper implements CreateNdefMessageCallback,
+ OnNdefPushCompleteCallback {
+ final NdefPushCallback mLegacyCallback;
+ LegacyCallbackWrapper(NdefPushCallback legacyCallback) {
+ mLegacyCallback = legacyCallback;
+ }
+ @Override
+ public void onNdefPushComplete(NfcEvent event) {
+ mLegacyCallback.onMessagePushed();
+ }
+ @Override
+ public NdefMessage createNdefMessage(NfcEvent event) {
+ return mLegacyCallback.createMessage();
+ }
+ }
+
+ /**
+ * TODO: Remove this once pre-built apk's (Maps, Youtube etc) are updated
+ * @deprecated use {@link #setNdefPushMessageCallback} instead
+ * @hide
+ */
+ @Deprecated
+ public void enableForegroundNdefPush(Activity activity, final NdefPushCallback callback) {
+ if (activity == null || callback == null) {
+ throw new NullPointerException();
+ }
+ enforceResumed(activity);
+ LegacyCallbackWrapper callbackWrapper = new LegacyCallbackWrapper(callback);
+ mNfcActivityManager.setNdefPushMessageCallback(activity, callbackWrapper);
+ mNfcActivityManager.setOnNdefPushCompleteCallback(activity, callbackWrapper);
+ }
+
+ /**
* Enable NDEF Push feature.
* <p>This API is for the Settings application.
* @hide
@@ -820,8 +901,12 @@
* @hide
*/
public INfcAdapterExtras getNfcAdapterExtrasInterface() {
+ if (mContext == null) {
+ throw new UnsupportedOperationException("You need a context on NfcAdapter to use the "
+ + " NFC extras APIs");
+ }
try {
- return sService.getNfcAdapterExtrasInterface();
+ return sService.getNfcAdapterExtrasInterface(mContext.getPackageName());
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
return null;
diff --git a/core/java/android/nfc/NfcManager.java b/core/java/android/nfc/NfcManager.java
index 300ab45..6ec2e21 100644
--- a/core/java/android/nfc/NfcManager.java
+++ b/core/java/android/nfc/NfcManager.java
@@ -39,8 +39,9 @@
*/
public NfcManager(Context context) {
NfcAdapter adapter;
+ context = context.getApplicationContext();
try {
- adapter = NfcAdapter.getSingleton();
+ adapter = NfcAdapter.getNfcAdapter(context);
} catch (UnsupportedOperationException e) {
adapter = null;
}
diff --git a/core/java/android/os/RemoteException.java b/core/java/android/os/RemoteException.java
index 9d76156..e30d24f 100644
--- a/core/java/android/os/RemoteException.java
+++ b/core/java/android/os/RemoteException.java
@@ -24,4 +24,8 @@
public RemoteException() {
super();
}
+
+ public RemoteException(String message) {
+ super(message);
+ }
}
diff --git a/core/java/android/os/TransactionTooLargeException.java b/core/java/android/os/TransactionTooLargeException.java
new file mode 100644
index 0000000..25f09e8
--- /dev/null
+++ b/core/java/android/os/TransactionTooLargeException.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 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.os;
+import android.os.RemoteException;
+
+/**
+ * The Binder transaction failed because it was too large.
+ * <p>
+ * During a remote procedure call, the arguments and the return value of the call
+ * are transferred as {@link Parcel} objects stored in the Binder transaction buffer.
+ * If the arguments or the return value are too large to fit in the transaction buffer,
+ * then the call will fail and {@link TransactionTooLargeException} will be thrown.
+ * </p><p>
+ * The Binder transaction buffer has a limited fixed size, currently 1Mb, which
+ * is shared by all transactions in progress for the process. Consequently this
+ * exception can be thrown when there are many transactions in progress even when
+ * most of the individual transactions are of moderate size.
+ * </p><p>
+ * There are two possible outcomes when a remote procedure call throws
+ * {@link TransactionTooLargeException}. Either the client was unable to send
+ * its request to the service (most likely if the arguments were too large to fit in
+ * the transaction buffer), or the service was unable to send its response back
+ * to the client (most likely if the return value was too large to fit
+ * in the transaction buffer). It is not possible to tell which of these outcomes
+ * actually occurred. The client should assume that a partial failure occurred.
+ * </p><p>
+ * The key to avoiding {@link TransactionTooLargeException} is to keep all
+ * transactions relatively small. Try to minimize the amount of memory needed to create
+ * a {@link Parcel} for the arguments and the return value of the remote procedure call.
+ * Avoid transferring huge arrays of strings or large bitmaps.
+ * If possible, try to break up big requests into smaller pieces.
+ * </p><p>
+ * If you are implementing a service, it may help to impose size or complexity
+ * contraints on the queries that clients can perform. For example, if the result set
+ * could become large, then don't allow the client to request more than a few records
+ * at a time. Alternately, instead of returning all of the available data all at once,
+ * return the essential information first and make the client ask for additional information
+ * later as needed.
+ * </p>
+ */
+public class TransactionTooLargeException extends RemoteException {
+ public TransactionTooLargeException() {
+ super();
+ }
+}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index ff28596..821b6df 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -1673,7 +1673,6 @@
* Querying for social stream data requires android.permission.READ_SOCIAL_STREAM
* permission.
* </p>
- * @hide
*/
public static final class StreamItems implements StreamItemsColumns {
/**
@@ -2736,7 +2735,6 @@
* inserting or updating social stream items requires android.permission.WRITE_SOCIAL_STREAM
* permission.
* </p>
- * @hide
*/
public static final class StreamItems implements BaseColumns, StreamItemsColumns {
/**
@@ -3149,7 +3147,6 @@
* </pre>
* </dd>
* </dl>
- * @hide
*/
public static final class StreamItems implements BaseColumns, StreamItemsColumns {
/**
@@ -3247,7 +3244,6 @@
* Columns in the StreamItems table.
*
* @see ContactsContract.StreamItems
- * @hide
*/
protected interface StreamItemsColumns {
/**
@@ -3538,7 +3534,6 @@
* <pre>
* </dd>
* </dl>
- * @hide
*/
public static final class StreamItemPhotos implements BaseColumns, StreamItemPhotosColumns {
/**
@@ -3566,7 +3561,6 @@
* Columns in the StreamItemPhotos table.
*
* @see ContactsContract.StreamItemPhotos
- * @hide
*/
protected interface StreamItemPhotosColumns {
/**
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a0652f7..b032169 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1183,6 +1183,10 @@
public static final String RADIO_WIFI = "wifi";
/**
+ * {@hide}
+ */
+ public static final String RADIO_WIMAX = "wimax";
+ /**
* Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
*/
public static final String RADIO_CELL = "cell";
@@ -2899,6 +2903,11 @@
*/
public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
"wifi_networks_available_notification_on";
+ /**
+ * {@hide}
+ */
+ public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
+ "wimax_networks_available_notification_on";
/**
* Delay (in seconds) before repeating the Wi-Fi networks available notification.
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 1b473ec..aa62cd7 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -784,11 +784,12 @@
// machine. We don't handle AVCTP signals currently. We only send
// intents for AVDTP state changes. We need to handle both of them in
// some cases. For now, just don't move to incoming state in this case.
- mBluetoothService.notifyIncomingA2dpConnection(address);
+ mBluetoothService.notifyIncomingA2dpConnection(address, true);
} else {
Log.i(TAG, "" + authorized +
"Incoming A2DP / AVRCP connection from " + address);
mA2dp.allowIncomingConnect(device, authorized);
+ mBluetoothService.notifyIncomingA2dpConnection(address, false);
}
} else if (BluetoothUuid.isInputDevice(uuid)) {
// We can have more than 1 input device connected.
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 9ca5847..d604a01 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -89,7 +89,7 @@
private int mNativeData;
private BluetoothEventLoop mEventLoop;
- private BluetoothHeadset mBluetoothHeadset;
+ private BluetoothHeadset mHeadsetProxy;
private BluetoothInputDevice mInputDevice;
private BluetoothPan mPan;
private boolean mIsAirplaneSensitive;
@@ -605,6 +605,7 @@
}
mBondState.initBondState();
initProfileState();
+ getProfileProxy();
}
/**
@@ -1766,8 +1767,8 @@
private void dumpHeadsetService(PrintWriter pw) {
pw.println("\n--Headset Service--");
- if (mBluetoothHeadset != null) {
- List<BluetoothDevice> deviceList = mBluetoothHeadset.getConnectedDevices();
+ if (mHeadsetProxy != null) {
+ List<BluetoothDevice> deviceList = mHeadsetProxy.getConnectedDevices();
if (deviceList.size() == 0) {
pw.println("No headsets connected");
} else {
@@ -1775,21 +1776,20 @@
pw.println("\ngetConnectedDevices[0] = " + device);
dumpHeadsetConnectionState(pw, device);
pw.println("getBatteryUsageHint() = " +
- mBluetoothHeadset.getBatteryUsageHint(device));
+ mHeadsetProxy.getBatteryUsageHint(device));
}
deviceList.clear();
- deviceList = mBluetoothHeadset.getDevicesMatchingConnectionStates(new int[] {
+ deviceList = mHeadsetProxy.getDevicesMatchingConnectionStates(new int[] {
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTED});
pw.println("--Connected and Disconnected Headsets");
for (BluetoothDevice device: deviceList) {
pw.println(device);
- if (mBluetoothHeadset.isAudioConnected(device)) {
+ if (mHeadsetProxy.isAudioConnected(device)) {
pw.println("SCO audio connected to device:" + device);
}
}
}
- mAdapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset);
}
private void dumpInputDeviceProfile(PrintWriter pw) {
@@ -1824,7 +1824,6 @@
pw.println(device);
}
}
- mAdapter.closeProfileProxy(BluetoothProfile.INPUT_DEVICE, mBluetoothHeadset);
}
private void dumpPanProfile(PrintWriter pw) {
@@ -1862,7 +1861,7 @@
private void dumpHeadsetConnectionState(PrintWriter pw,
BluetoothDevice device) {
- switch (mBluetoothHeadset.getConnectionState(device)) {
+ switch (mHeadsetProxy.getConnectionState(device)) {
case BluetoothHeadset.STATE_CONNECTING:
pw.println("getConnectionState() = STATE_CONNECTING");
break;
@@ -1884,7 +1883,6 @@
Integer pid = mServiceRecordToPid.get(handle).first;
pw.println("\tpid " + pid + " handle " + Integer.toHexString(handle));
}
- mAdapter.closeProfileProxy(BluetoothProfile.PAN, mBluetoothHeadset);
}
private void dumpAclConnectedDevices(PrintWriter pw) {
@@ -1927,11 +1925,16 @@
}
}
+ private void getProfileProxy() {
+ mAdapter.getProfileProxy(mContext,
+ mBluetoothProfileServiceListener, BluetoothProfile.HEADSET);
+ }
+
private BluetoothProfile.ServiceListener mBluetoothProfileServiceListener =
new BluetoothProfile.ServiceListener() {
public void onServiceConnected(int profile, BluetoothProfile proxy) {
if (profile == BluetoothProfile.HEADSET) {
- mBluetoothHeadset = (BluetoothHeadset) proxy;
+ mHeadsetProxy = (BluetoothHeadset) proxy;
} else if (profile == BluetoothProfile.INPUT_DEVICE) {
mInputDevice = (BluetoothInputDevice) proxy;
} else if (profile == BluetoothProfile.PAN) {
@@ -1940,7 +1943,7 @@
}
public void onServiceDisconnected(int profile) {
if (profile == BluetoothProfile.HEADSET) {
- mBluetoothHeadset = null;
+ mHeadsetProxy = null;
} else if (profile == BluetoothProfile.INPUT_DEVICE) {
mInputDevice = null;
} else if (profile == BluetoothProfile.PAN) {
@@ -2424,25 +2427,43 @@
}
}
- public boolean notifyIncomingConnection(String address) {
- BluetoothDeviceProfileState state =
- mDeviceProfileState.get(address);
+ public boolean notifyIncomingConnection(String address, boolean rejected) {
+ BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
if (state != null) {
Message msg = new Message();
- msg.what = BluetoothDeviceProfileState.CONNECT_HFP_INCOMING;
- state.sendMessage(msg);
+ if (rejected) {
+ if (mA2dpService.getPriority(getRemoteDevice(address)) >=
+ BluetoothProfile.PRIORITY_ON) {
+ msg.what = BluetoothDeviceProfileState.CONNECT_OTHER_PROFILES;
+ msg.arg1 = BluetoothDeviceProfileState.CONNECT_A2DP_OUTGOING;
+ state.sendMessageDelayed(msg,
+ BluetoothDeviceProfileState.CONNECT_OTHER_PROFILES_DELAY);
+ }
+ } else {
+ msg.what = BluetoothDeviceProfileState.CONNECT_HFP_INCOMING;
+ state.sendMessage(msg);
+ }
return true;
}
return false;
}
- /*package*/ boolean notifyIncomingA2dpConnection(String address) {
- BluetoothDeviceProfileState state =
- mDeviceProfileState.get(address);
+ /*package*/ boolean notifyIncomingA2dpConnection(String address, boolean rejected) {
+ BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
if (state != null) {
Message msg = new Message();
- msg.what = BluetoothDeviceProfileState.CONNECT_A2DP_INCOMING;
- state.sendMessage(msg);
+ if (rejected) {
+ if (mHeadsetProxy.getPriority(getRemoteDevice(address)) >=
+ BluetoothProfile.PRIORITY_ON) {
+ msg.what = BluetoothDeviceProfileState.CONNECT_OTHER_PROFILES;
+ msg.arg1 = BluetoothDeviceProfileState.CONNECT_HFP_OUTGOING;
+ state.sendMessageDelayed(msg,
+ BluetoothDeviceProfileState.CONNECT_OTHER_PROFILES_DELAY);
+ }
+ } else {
+ msg.what = BluetoothDeviceProfileState.CONNECT_A2DP_INCOMING;
+ state.sendMessage(msg);
+ }
return true;
}
return false;
diff --git a/core/java/android/speech/tts/AudioMessageParams.java b/core/java/android/speech/tts/AudioMessageParams.java
index 68d8738..29b4367 100644
--- a/core/java/android/speech/tts/AudioMessageParams.java
+++ b/core/java/android/speech/tts/AudioMessageParams.java
@@ -15,12 +15,12 @@
*/
package android.speech.tts;
-import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher;
+import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
class AudioMessageParams extends MessageParams {
private final BlockingMediaPlayer mPlayer;
- AudioMessageParams(UtteranceCompletedDispatcher dispatcher,
+ AudioMessageParams(UtteranceProgressDispatcher dispatcher,
String callingApp, BlockingMediaPlayer player) {
super(dispatcher, callingApp);
mPlayer = player;
diff --git a/core/java/android/speech/tts/AudioPlaybackHandler.java b/core/java/android/speech/tts/AudioPlaybackHandler.java
index d970ae6..0194240 100644
--- a/core/java/android/speech/tts/AudioPlaybackHandler.java
+++ b/core/java/android/speech/tts/AudioPlaybackHandler.java
@@ -312,10 +312,11 @@
private void handleSilence(MessageParams msg) {
if (DBG) Log.d(TAG, "handleSilence()");
SilenceMessageParams params = (SilenceMessageParams) msg;
+ params.getDispatcher().dispatchOnStart();
if (params.getSilenceDurationMs() > 0) {
params.getConditionVariable().block(params.getSilenceDurationMs());
}
- params.getDispatcher().dispatchUtteranceCompleted();
+ params.getDispatcher().dispatchOnDone();
if (DBG) Log.d(TAG, "handleSilence() done.");
}
@@ -323,11 +324,12 @@
private void handleAudio(MessageParams msg) {
if (DBG) Log.d(TAG, "handleAudio()");
AudioMessageParams params = (AudioMessageParams) msg;
+ params.getDispatcher().dispatchOnStart();
// Note that the BlockingMediaPlayer spawns a separate thread.
//
// TODO: This can be avoided.
params.getPlayer().startAndWait();
- params.getDispatcher().dispatchUtteranceCompleted();
+ params.getDispatcher().dispatchOnDone();
if (DBG) Log.d(TAG, "handleAudio() done.");
}
@@ -361,6 +363,7 @@
if (DBG) Log.d(TAG, "Created audio track [" + audioTrack.hashCode() + "]");
param.setAudioTrack(audioTrack);
+ msg.getDispatcher().dispatchOnStart();
}
// More data available to be flushed to the audio track.
@@ -411,6 +414,7 @@
final AudioTrack audioTrack = params.getAudioTrack();
if (audioTrack == null) {
+ params.getDispatcher().dispatchOnError();
return;
}
@@ -439,7 +443,7 @@
audioTrack.release();
params.setAudioTrack(null);
}
- params.getDispatcher().dispatchUtteranceCompleted();
+ params.getDispatcher().dispatchOnDone();
mLastSynthesisRequest = null;
params.mLogger.onWriteData();
}
diff --git a/core/java/android/speech/tts/ITextToSpeechCallback.aidl b/core/java/android/speech/tts/ITextToSpeechCallback.aidl
index 40902ae..f0287d4 100755
--- a/core/java/android/speech/tts/ITextToSpeechCallback.aidl
+++ b/core/java/android/speech/tts/ITextToSpeechCallback.aidl
@@ -21,5 +21,7 @@
* {@hide}
*/
oneway interface ITextToSpeechCallback {
- void utteranceCompleted(String utteranceId);
+ void onStart(String utteranceId);
+ void onDone(String utteranceId);
+ void onError(String utteranceId);
}
diff --git a/core/java/android/speech/tts/MessageParams.java b/core/java/android/speech/tts/MessageParams.java
index e7d6da3..de9cc07 100644
--- a/core/java/android/speech/tts/MessageParams.java
+++ b/core/java/android/speech/tts/MessageParams.java
@@ -15,22 +15,22 @@
*/
package android.speech.tts;
-import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher;
+import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
abstract class MessageParams {
static final int TYPE_SYNTHESIS = 1;
static final int TYPE_AUDIO = 2;
static final int TYPE_SILENCE = 3;
- private final UtteranceCompletedDispatcher mDispatcher;
+ private final UtteranceProgressDispatcher mDispatcher;
private final String mCallingApp;
- MessageParams(UtteranceCompletedDispatcher dispatcher, String callingApp) {
+ MessageParams(UtteranceProgressDispatcher dispatcher, String callingApp) {
mDispatcher = dispatcher;
mCallingApp = callingApp;
}
- UtteranceCompletedDispatcher getDispatcher() {
+ UtteranceProgressDispatcher getDispatcher() {
return mDispatcher;
}
diff --git a/core/java/android/speech/tts/PlaybackSynthesisCallback.java b/core/java/android/speech/tts/PlaybackSynthesisCallback.java
index 0cca06ac..ce3522b 100644
--- a/core/java/android/speech/tts/PlaybackSynthesisCallback.java
+++ b/core/java/android/speech/tts/PlaybackSynthesisCallback.java
@@ -15,7 +15,7 @@
*/
package android.speech.tts;
-import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher;
+import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
import android.util.Log;
/**
@@ -62,12 +62,12 @@
private volatile boolean mDone = false;
- private final UtteranceCompletedDispatcher mDispatcher;
+ private final UtteranceProgressDispatcher mDispatcher;
private final String mCallingApp;
private final EventLogger mLogger;
PlaybackSynthesisCallback(int streamType, float volume, float pan,
- AudioPlaybackHandler audioTrackHandler, UtteranceCompletedDispatcher dispatcher,
+ AudioPlaybackHandler audioTrackHandler, UtteranceProgressDispatcher dispatcher,
String callingApp, EventLogger logger) {
mStreamType = streamType;
mVolume = volume;
diff --git a/core/java/android/speech/tts/SilenceMessageParams.java b/core/java/android/speech/tts/SilenceMessageParams.java
index 7a4ff1c..9909126 100644
--- a/core/java/android/speech/tts/SilenceMessageParams.java
+++ b/core/java/android/speech/tts/SilenceMessageParams.java
@@ -16,13 +16,13 @@
package android.speech.tts;
import android.os.ConditionVariable;
-import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher;
+import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
class SilenceMessageParams extends MessageParams {
private final ConditionVariable mCondVar = new ConditionVariable();
private final long mSilenceDurationMs;
- SilenceMessageParams(UtteranceCompletedDispatcher dispatcher,
+ SilenceMessageParams(UtteranceProgressDispatcher dispatcher,
String callingApp, long silenceDurationMs) {
super(dispatcher, callingApp);
mSilenceDurationMs = silenceDurationMs;
diff --git a/core/java/android/speech/tts/SynthesisMessageParams.java b/core/java/android/speech/tts/SynthesisMessageParams.java
index 779721e..0c0f033 100644
--- a/core/java/android/speech/tts/SynthesisMessageParams.java
+++ b/core/java/android/speech/tts/SynthesisMessageParams.java
@@ -17,7 +17,7 @@
import android.media.AudioFormat;
import android.media.AudioTrack;
-import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher;
+import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
import java.util.LinkedList;
@@ -56,7 +56,7 @@
SynthesisMessageParams(int streamType, int sampleRate,
int audioFormat, int channelCount,
- float volume, float pan, UtteranceCompletedDispatcher dispatcher,
+ float volume, float pan, UtteranceProgressDispatcher dispatcher,
String callingApp, EventLogger logger) {
super(dispatcher, callingApp);
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index 954a6fe..38699ea 100755
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -482,7 +482,7 @@
private OnInitListener mInitListener;
// Written from an unspecified application thread, read from
// a binder thread.
- private volatile OnUtteranceCompletedListener mUtteranceCompletedListener;
+ private volatile UtteranceProgressListener mUtteranceProgressListener;
private final Object mStartLock = new Object();
private String mRequestedEngine;
@@ -1089,6 +1089,7 @@
// Copy feature strings defined by the framework.
copyStringParam(bundle, params, Engine.KEY_FEATURE_NETWORK_SYNTHESIS);
+ copyStringParam(bundle, params, Engine.KEY_FEATURE_EMBEDDED_SYNTHESIS);
// Copy over all parameters that start with the name of the
// engine that we are currently connected to. The engine is
@@ -1145,9 +1146,28 @@
* @param listener The listener to use.
*
* @return {@link #ERROR} or {@link #SUCCESS}.
+ *
+ * @deprecated Use {@link #setOnUtteranceProgressListener(UtteranceProgressListener)}
+ * instead.
*/
+ @Deprecated
public int setOnUtteranceCompletedListener(final OnUtteranceCompletedListener listener) {
- mUtteranceCompletedListener = listener;
+ mUtteranceProgressListener = UtteranceProgressListener.from(listener);
+ return TextToSpeech.SUCCESS;
+ }
+
+ /**
+ * Sets the listener that will be notified of various events related to the
+ * synthesis of a given utterance.
+ *
+ * See {@link UtteranceProgressListener} and
+ * {@link TextToSpeech.Engine#KEY_PARAM_UTTERANCE_ID}.
+ *
+ * @param listener the listener to use.
+ * @return {@link #ERROR} or {@link #SUCCESS}
+ */
+ public int setOnUtteranceProgressListener(UtteranceProgressListener listener) {
+ mUtteranceProgressListener = listener;
return TextToSpeech.SUCCESS;
}
@@ -1203,10 +1223,26 @@
private ITextToSpeechService mService;
private final ITextToSpeechCallback.Stub mCallback = new ITextToSpeechCallback.Stub() {
@Override
- public void utteranceCompleted(String utteranceId) {
- OnUtteranceCompletedListener listener = mUtteranceCompletedListener;
+ public void onDone(String utteranceId) {
+ UtteranceProgressListener listener = mUtteranceProgressListener;
if (listener != null) {
- listener.onUtteranceCompleted(utteranceId);
+ listener.onDone(utteranceId);
+ }
+ }
+
+ @Override
+ public void onError(String utteranceId) {
+ UtteranceProgressListener listener = mUtteranceProgressListener;
+ if (listener != null) {
+ listener.onError(utteranceId);
+ }
+ }
+
+ @Override
+ public void onStart(String utteranceId) {
+ UtteranceProgressListener listener = mUtteranceProgressListener;
+ if (listener != null) {
+ listener.onStart(utteranceId);
}
}
};
diff --git a/core/java/android/speech/tts/TextToSpeechService.java b/core/java/android/speech/tts/TextToSpeechService.java
index 245271d..39922da 100644
--- a/core/java/android/speech/tts/TextToSpeechService.java
+++ b/core/java/android/speech/tts/TextToSpeechService.java
@@ -306,6 +306,7 @@
*/
public int enqueueSpeechItem(int queueMode, final SpeechItem speechItem) {
if (!speechItem.isValid()) {
+ speechItem.dispatchOnError();
return TextToSpeech.ERROR;
}
@@ -332,6 +333,7 @@
return TextToSpeech.SUCCESS;
} else {
Log.w(TAG, "SynthThread has quit");
+ speechItem.dispatchOnError();
return TextToSpeech.ERROR;
}
}
@@ -381,14 +383,16 @@
}
}
- interface UtteranceCompletedDispatcher {
- public void dispatchUtteranceCompleted();
+ interface UtteranceProgressDispatcher {
+ public void dispatchOnDone();
+ public void dispatchOnStart();
+ public void dispatchOnError();
}
/**
* An item in the synth thread queue.
*/
- private abstract class SpeechItem implements UtteranceCompletedDispatcher {
+ private abstract class SpeechItem implements UtteranceProgressDispatcher {
private final String mCallingApp;
protected final Bundle mParams;
private boolean mStarted = false;
@@ -443,10 +447,27 @@
stopImpl();
}
- public void dispatchUtteranceCompleted() {
+ @Override
+ public void dispatchOnDone() {
final String utteranceId = getUtteranceId();
if (!TextUtils.isEmpty(utteranceId)) {
- mCallbacks.dispatchUtteranceCompleted(getCallingApp(), utteranceId);
+ mCallbacks.dispatchOnDone(getCallingApp(), utteranceId);
+ }
+ }
+
+ @Override
+ public void dispatchOnStart() {
+ final String utteranceId = getUtteranceId();
+ if (!TextUtils.isEmpty(utteranceId)) {
+ mCallbacks.dispatchOnStart(getCallingApp(), utteranceId);
+ }
+ }
+
+ @Override
+ public void dispatchOnError() {
+ final String utteranceId = getUtteranceId();
+ if (!TextUtils.isEmpty(utteranceId)) {
+ mCallbacks.dispatchOnError(getCallingApp(), utteranceId);
}
}
@@ -617,9 +638,12 @@
@Override
protected int playImpl() {
+ dispatchOnStart();
int status = super.playImpl();
if (status == TextToSpeech.SUCCESS) {
- dispatchUtteranceCompleted();
+ dispatchOnDone();
+ } else {
+ dispatchOnError();
}
return status;
}
@@ -792,8 +816,13 @@
public String[] getFeaturesForLanguage(String lang, String country, String variant) {
Set<String> features = onGetFeaturesForLanguage(lang, country, variant);
- String[] featuresArray = new String[features.size()];
- features.toArray(featuresArray);
+ String[] featuresArray = null;
+ if (features != null) {
+ featuresArray = new String[features.size()];
+ features.toArray(featuresArray);
+ } else {
+ featuresArray = new String[0];
+ }
return featuresArray;
}
@@ -851,16 +880,34 @@
}
}
- public void dispatchUtteranceCompleted(String packageName, String utteranceId) {
- ITextToSpeechCallback cb;
- synchronized (mAppToCallback) {
- cb = mAppToCallback.get(packageName);
- }
+ public void dispatchOnDone(String packageName, String utteranceId) {
+ ITextToSpeechCallback cb = getCallbackFor(packageName);
if (cb == null) return;
try {
- cb.utteranceCompleted(utteranceId);
+ cb.onDone(utteranceId);
} catch (RemoteException e) {
- Log.e(TAG, "Callback failed: " + e);
+ Log.e(TAG, "Callback onDone failed: " + e);
+ }
+ }
+
+ public void dispatchOnStart(String packageName, String utteranceId) {
+ ITextToSpeechCallback cb = getCallbackFor(packageName);
+ if (cb == null) return;
+ try {
+ cb.onStart(utteranceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Callback onStart failed: " + e);
+ }
+
+ }
+
+ public void dispatchOnError(String packageName, String utteranceId) {
+ ITextToSpeechCallback cb = getCallbackFor(packageName);
+ if (cb == null) return;
+ try {
+ cb.onError(utteranceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Callback onError failed: " + e);
}
}
@@ -881,6 +928,15 @@
}
}
+ private ITextToSpeechCallback getCallbackFor(String packageName) {
+ ITextToSpeechCallback cb;
+ synchronized (mAppToCallback) {
+ cb = mAppToCallback.get(packageName);
+ }
+
+ return cb;
+ }
+
}
}
diff --git a/core/java/android/speech/tts/UtteranceProgressListener.java b/core/java/android/speech/tts/UtteranceProgressListener.java
new file mode 100644
index 0000000..a04458a
--- /dev/null
+++ b/core/java/android/speech/tts/UtteranceProgressListener.java
@@ -0,0 +1,68 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+
+package android.speech.tts;
+
+/**
+ * Listener for events relating to the progress of an utterance through
+ * the synthesis queue. Each utterance is associated with a call to
+ * {@link TextToSpeech#speak} or {@link TextToSpeech#synthesizeToFile} with an
+ * associated utterance identifier, as per {@link TextToSpeech.Engine#KEY_PARAM_UTTERANCE_ID}.
+ *
+ * The callbacks specified in this method can be called from multiple threads.
+ */
+public abstract class UtteranceProgressListener {
+ /**
+ * Called when an utterance "starts" as perceived by the caller. This will
+ * be soon before audio is played back in the case of a {@link TextToSpeech#speak}
+ * or before the first bytes of a file are written to storage in the case
+ * of {@link TextToSpeech#synthesizeToFile}.
+ *
+ * @param utteranceId the utterance ID of the utterance.
+ */
+ public abstract void onStart(String utteranceId);
+
+ /**
+ * Called when an utterance has successfully completed processing.
+ * All audio will have been played back by this point for audible output, and all
+ * output will have been written to disk for file synthesis requests.
+ *
+ * This request is guaranteed to be called after {@link #onStart(String)}.
+ *
+ * @param utteranceId the utterance ID of the utterance.
+ */
+ public abstract void onDone(String utteranceId);
+
+ /**
+ * Called when an error has occurred during processing. This can be called
+ * at any point in the synthesis process. Note that there might be calls
+ * to {@link #onStart(String)} for specified utteranceId but there will never
+ * be a call to both {@link #onDone(String)} and {@link #onError(String)} for
+ * the same utterance.
+ *
+ * @param utteranceId the utterance ID of the utterance.
+ */
+ public abstract void onError(String utteranceId);
+
+ /**
+ * Wraps an old deprecated OnUtteranceCompletedListener with a shiny new
+ * progress listener.
+ *
+ * @hide
+ */
+ static UtteranceProgressListener from(
+ final TextToSpeech.OnUtteranceCompletedListener listener) {
+ return new UtteranceProgressListener() {
+ @Override
+ public synchronized void onDone(String utteranceId) {
+ listener.onUtteranceCompleted(utteranceId);
+ }
+
+ // The following methods are left unimplemented.
+ @Override
+ public void onStart(String utteranceId) { }
+
+ @Override
+ public void onError(String utteranceId) { }
+ };
+ }
+}
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index c934c7b..d948ec2 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -315,6 +315,27 @@
private static native void nFlushCaches(int level);
+ /**
+ * Release all resources associated with the underlying caches. This should
+ * only be called after a full flushCaches().
+ *
+ * @hide
+ */
+ public static void terminateCaches() {
+ nTerminateCaches();
+ }
+
+ private static native void nTerminateCaches();
+
+ /**
+ * @hide
+ */
+ public static void initCaches() {
+ nInitCaches();
+ }
+
+ private static native void nInitCaches();
+
///////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index b86d21d..e0167d8 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -25,6 +25,7 @@
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
+import com.google.android.gles_jni.EGLImpl;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGL11;
@@ -34,6 +35,8 @@
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
+import java.io.File;
+
import static javax.microedition.khronos.egl.EGL10.*;
/**
@@ -45,6 +48,11 @@
static final String LOG_TAG = "HardwareRenderer";
/**
+ * Name of the file that holds the shaders cache.
+ */
+ private static final String CACHE_PATH_SHADERS = "com.android.opengl.shaders_cache";
+
+ /**
* Turn on to only refresh the parts of the screen that need updating.
* When turned on the property defined by {@link #RENDER_DIRTY_REGIONS_PROPERTY}
* must also have the value "true".
@@ -200,6 +208,18 @@
abstract int getHeight();
/**
+ * Sets the directory to use as a persistent storage for hardware rendering
+ * resources.
+ *
+ * @param cacheDir A directory the current process can write to
+ */
+ public static void setupDiskCache(File cacheDir) {
+ nSetupShadersDiskCache(new File(cacheDir, CACHE_PATH_SHADERS).getAbsolutePath());
+ }
+
+ private static native void nSetupShadersDiskCache(String cacheFile);
+
+ /**
* Interface used to receive callbacks whenever a view is drawn by
* a hardware renderer instance.
*/
@@ -325,6 +345,15 @@
}
/**
+ * Invoke this method when the system needs to clean up all resources
+ * associated with hardware rendering.
+ */
+ static void terminate() {
+ Log.d(LOG_TAG, "Terminating hardware rendering");
+ Gl20Renderer.terminate();
+ }
+
+ /**
* Indicates whether hardware acceleration is currently enabled.
*
* @return True if hardware acceleration is in use, false otherwise.
@@ -632,6 +661,8 @@
throw new Surface.OutOfResourcesException("eglMakeCurrent failed "
+ GLUtils.getEGLErrorString(sEgl.eglGetError()));
}
+
+ initCaches();
// If mDirtyRegions is set, this means we have an EGL configuration
// with EGL_SWAP_BEHAVIOR_PRESERVED_BIT set
@@ -652,6 +683,8 @@
return mEglContext.getGL();
}
+ abstract void initCaches();
+
EGLContext createContext(EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig) {
int[] attribs = { EGL_CONTEXT_CLIENT_VERSION, mGlVersion, EGL_NONE };
@@ -895,6 +928,11 @@
EGL_NONE
};
}
+
+ @Override
+ void initCaches() {
+ GLES20Canvas.initCaches();
+ }
@Override
boolean canDraw() {
@@ -987,16 +1025,7 @@
if (eglContext == null) {
return;
} else {
- synchronized (sPbufferLock) {
- // Create a temporary 1x1 pbuffer so we have a context
- // to clear our OpenGL objects
- if (sPbuffer == null) {
- sPbuffer = sEgl.eglCreatePbufferSurface(sEglDisplay, sEglConfig, new int[] {
- EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE
- });
- }
- }
- sEgl.eglMakeCurrent(sEglDisplay, sPbuffer, sPbuffer, eglContext);
+ usePbufferSurface(eglContext);
}
switch (level) {
@@ -1010,5 +1039,46 @@
break;
}
}
+
+ private static void usePbufferSurface(EGLContext eglContext) {
+ synchronized (sPbufferLock) {
+ // Create a temporary 1x1 pbuffer so we have a context
+ // to clear our OpenGL objects
+ if (sPbuffer == null) {
+ sPbuffer = sEgl.eglCreatePbufferSurface(sEglDisplay, sEglConfig, new int[] {
+ EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE
+ });
+ }
+ }
+ sEgl.eglMakeCurrent(sEglDisplay, sPbuffer, sPbuffer, eglContext);
+ }
+
+ static void terminate() {
+ synchronized (sEglLock) {
+ if (sEgl == null) return;
+
+ if (EGLImpl.getInitCount(sEglDisplay) == 1) {
+ EGLContext eglContext = sEglContextStorage.get();
+ if (eglContext == null) return;
+
+ usePbufferSurface(eglContext);
+ GLES20Canvas.terminateCaches();
+
+ sEgl.eglDestroyContext(sEglDisplay, eglContext);
+ sEglContextStorage.remove();
+
+ sEgl.eglDestroySurface(sEglDisplay, sPbuffer);
+ sEgl.eglMakeCurrent(sEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+ sEgl.eglReleaseThread();
+ sEgl.eglTerminate(sEglDisplay);
+
+ sEgl = null;
+ sEglDisplay = null;
+ sEglConfig = null;
+ sPbuffer = null;
+ }
+ }
+ }
}
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 62e6ebd..dc46d42 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -11402,8 +11402,12 @@
* {@link SystemClock#uptimeMillis} timebase.
*/
public void scheduleDrawable(Drawable who, Runnable what, long when) {
- if (verifyDrawable(who) && what != null && mAttachInfo != null) {
- mAttachInfo.mHandler.postAtTime(what, who, when);
+ if (verifyDrawable(who) && what != null) {
+ if (mAttachInfo != null) {
+ mAttachInfo.mHandler.postAtTime(what, who, when);
+ } else {
+ ViewRootImpl.getRunQueue().postDelayed(what, when - SystemClock.uptimeMillis());
+ }
}
}
@@ -11414,8 +11418,12 @@
* @param what the action to cancel
*/
public void unscheduleDrawable(Drawable who, Runnable what) {
- if (verifyDrawable(who) && what != null && mAttachInfo != null) {
- mAttachInfo.mHandler.removeCallbacks(what, who);
+ if (verifyDrawable(who) && what != null) {
+ if (mAttachInfo != null) {
+ mAttachInfo.mHandler.removeCallbacks(what, who);
+ } else {
+ ViewRootImpl.getRunQueue().removeCallbacks(what);
+ }
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index f7078ec..b15b155 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -567,7 +567,7 @@
}
}
- private void destroyHardwareResources() {
+ void destroyHardwareResources() {
if (mAttachInfo.mHardwareRenderer != null) {
if (mAttachInfo.mHardwareRenderer.isEnabled()) {
mAttachInfo.mHardwareRenderer.destroyLayers(mView);
@@ -880,12 +880,10 @@
|| mNewSurfaceNeeded;
WindowManager.LayoutParams params = null;
- int windowAttributesChanges = 0;
if (mWindowAttributesChanged) {
mWindowAttributesChanged = false;
surfaceChanged = true;
params = lp;
- windowAttributesChanges = mWindowAttributesChangesFlag;
}
CompatibilityInfo compatibilityInfo = mCompatibilityInfo.get();
if (compatibilityInfo.supportsScreen() == mLastInCompatMode) {
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index 5ef4f3e..d89bc36 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -16,6 +16,8 @@
package android.view;
+import android.app.ActivityManager;
+import android.content.ComponentCallbacks2;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
@@ -409,7 +411,30 @@
*/
public void trimMemory(int level) {
if (HardwareRenderer.isAvailable()) {
- HardwareRenderer.trimMemory(level);
+ switch (level) {
+ case ComponentCallbacks2.TRIM_MEMORY_COMPLETE:
+ case ComponentCallbacks2.TRIM_MEMORY_MODERATE:
+ // On low and medium end gfx devices
+ if (!ActivityManager.isHighEndGfx(getDefaultDisplay())) {
+ // Force a full memory flush
+ HardwareRenderer.trimMemory(ComponentCallbacks2.TRIM_MEMORY_COMPLETE);
+ // Destroy all hardware surfaces and resources associated to
+ // known windows
+ synchronized (this) {
+ if (mViews == null) return;
+ int count = mViews.length;
+ for (int i = 0; i < count; i++) {
+ mRoots[i].destroyHardwareResources();
+ }
+ }
+ // Terminate the hardware renderer to free all resources
+ HardwareRenderer.terminate();
+ break;
+ }
+ // high end gfx devices fall through to next case
+ default:
+ HardwareRenderer.trimMemory(level);
+ }
}
}
diff --git a/core/java/android/view/textservice/SpellCheckerSession.java b/core/java/android/view/textservice/SpellCheckerSession.java
index 01b114c..0eb6e27 100644
--- a/core/java/android/view/textservice/SpellCheckerSession.java
+++ b/core/java/android/view/textservice/SpellCheckerSession.java
@@ -146,6 +146,13 @@
}
/**
+ * Cancel pending and running spell check tasks
+ */
+ public void cancel() {
+ mSpellCheckerSessionListenerImpl.cancel();
+ }
+
+ /**
* Finish this session and allow TextServicesManagerService to disconnect the bound spell
* checker.
*/
@@ -242,6 +249,13 @@
}
}
+ public void cancel() {
+ if (DBG) {
+ Log.w(TAG, "cancel");
+ }
+ processOrEnqueueTask(new SpellCheckerParams(TASK_CANCEL, null, 0, false));
+ }
+
public void getSuggestionsMultiple(
TextInfo[] textInfos, int suggestionsLimit, boolean sequentialWords) {
if (DBG) {
@@ -275,8 +289,22 @@
if (DBG) {
Log.d(TAG, "process or enqueue task: " + mISpellCheckerSession);
}
+ SpellCheckerParams closeTask = null;
if (mISpellCheckerSession == null) {
+ if (scp.mWhat == TASK_CANCEL) {
+ while (!mPendingTasks.isEmpty()) {
+ final SpellCheckerParams tmp = mPendingTasks.poll();
+ if (tmp.mWhat == TASK_CLOSE) {
+ // Only one close task should be processed, while we need to remove all
+ // close tasks from the queue
+ closeTask = tmp;
+ }
+ }
+ }
mPendingTasks.offer(scp);
+ if (closeTask != null) {
+ mPendingTasks.offer(closeTask);
+ }
} else {
processTask(scp);
}
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 2cc928f..c194559 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -813,8 +813,6 @@
boolean synchronous,
String username,
String password) {
- PerfChecker checker = new PerfChecker();
-
if (mSettings.getCacheMode() != WebSettings.LOAD_DEFAULT) {
cacheMode = mSettings.getCacheMode();
}
@@ -872,11 +870,6 @@
|| headers.containsKey("If-None-Match") ?
WebSettings.LOAD_NO_CACHE : cacheMode);
// Set referrer to current URL?
- if (!loader.executeLoad()) {
- checker.responseAlert("startLoadingResource fail");
- }
- checker.responseAlert("startLoadingResource succeed");
-
return !synchronous ? loadListener : null;
}
@@ -1411,4 +1404,17 @@
native void nativeSslClientCert(int handle,
byte[] pkcs8EncodedPrivateKey,
byte[][] asn1DerEncodedCertificateChain);
+
+ /**
+ * Returns true when the contents of the frame is an RTL or vertical-rl
+ * page. This is used for determining whether a frame should be initially
+ * scrolled right-most as opposed to left-most.
+ * @return true when the frame should be initially scrolled right-most
+ * based on the text direction and writing mode.
+ */
+ /* package */ boolean getShouldStartScrolledRight() {
+ return nativeGetShouldStartScrolledRight(mNativeFrame);
+ }
+
+ private native boolean nativeGetShouldStartScrolledRight(int nativeBrowserFrame);
}
diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java
index b85fd17..fffa90b 100644
--- a/core/java/android/webkit/FindActionModeCallback.java
+++ b/core/java/android/webkit/FindActionModeCallback.java
@@ -18,6 +18,8 @@
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Point;
+import android.graphics.Rect;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
@@ -254,13 +256,18 @@
// Does nothing. Needed to implement TextWatcher.
}
- public int getActionModeHeight() {
+ private Rect mGlobalVisibleRect = new Rect();
+ private Point mGlobalVisibleOffset = new Point();
+ public int getActionModeGlobalBottom() {
if (mActionMode == null) {
return 0;
}
- View parent = (View) mCustomView.getParent();
- return parent != null ? parent.getMeasuredHeight()
- : mCustomView.getMeasuredHeight();
+ View view = (View) mCustomView.getParent();
+ if (view == null) {
+ view = mCustomView;
+ }
+ view.getGlobalVisibleRect(mGlobalVisibleRect, mGlobalVisibleOffset);
+ return mGlobalVisibleRect.bottom;
}
}
diff --git a/core/java/android/webkit/JWebCoreJavaBridge.java b/core/java/android/webkit/JWebCoreJavaBridge.java
index 5b78586..b498435 100644
--- a/core/java/android/webkit/JWebCoreJavaBridge.java
+++ b/core/java/android/webkit/JWebCoreJavaBridge.java
@@ -87,11 +87,9 @@
* Call native timer callbacks.
*/
private void fireSharedTimer() {
- PerfChecker checker = new PerfChecker();
// clear the flag so that sharedTimerFired() can set a new timer
mHasInstantTimer = false;
sharedTimerFired();
- checker.responseAlert("sharedTimer");
}
/**
diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java
index 04af738..37e8bc0 100644
--- a/core/java/android/webkit/LoadListener.java
+++ b/core/java/android/webkit/LoadListener.java
@@ -1136,7 +1136,6 @@
// Give the data to WebKit now. We don't have to synchronize on
// mDataBuilder here because pulling each chunk removes it from the
// internal list so it cannot be modified.
- PerfChecker checker = new PerfChecker();
ByteArrayBuilder.Chunk c;
while (true) {
c = mDataBuilder.getFirstChunk();
@@ -1152,7 +1151,6 @@
} else {
c.release();
}
- checker.responseAlert("res nativeAddData");
}
}
@@ -1173,13 +1171,11 @@
WebViewWorker.MSG_REMOVE_CACHE, this).sendToTarget();
}
if (mNativeLoader != 0) {
- PerfChecker checker = new PerfChecker();
if (!mSetNativeResponse) {
setNativeResponse();
}
nativeFinished();
- checker.responseAlert("res nativeFinished");
clearNativeLoader();
}
}
diff --git a/core/java/android/webkit/PerfChecker.java b/core/java/android/webkit/PerfChecker.java
deleted file mode 100644
index 8c5f86e..0000000
--- a/core/java/android/webkit/PerfChecker.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2007 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.webkit;
-
-import android.os.SystemClock;
-import android.util.Log;
-
-class PerfChecker {
-
- private long mTime;
- private static final long mResponseThreshold = 2000; // 2s
-
- public PerfChecker() {
- if (false) {
- mTime = SystemClock.uptimeMillis();
- }
- }
-
- /**
- * @param what log string
- * Logs given string if mResponseThreshold time passed between either
- * instantiation or previous responseAlert call
- */
- public void responseAlert(String what) {
- if (false) {
- long upTime = SystemClock.uptimeMillis();
- long time = upTime - mTime;
- if (time > mResponseThreshold) {
- Log.w("webkit", what + " used " + time + " ms");
- }
- // Reset mTime, to permit reuse
- mTime = upTime;
- }
- }
-}
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 5ee1b8a..8aafc3d 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -16,14 +16,9 @@
package android.webkit;
-import com.android.internal.widget.EditableInputConnection;
-
import android.content.Context;
-import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.ColorFilter;
import android.graphics.Paint;
-import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
@@ -60,12 +55,12 @@
import android.widget.AutoCompleteTextView;
import android.widget.TextView;
+import junit.framework.Assert;
+
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import junit.framework.Assert;
-
/**
* WebTextView is a specialized version of EditText used by WebView
* to overlay html textfields (and textareas) to use our standard
@@ -926,18 +921,23 @@
*/
/* package */ void setRect(int x, int y, int width, int height) {
LayoutParams lp = (LayoutParams) getLayoutParams();
+ boolean needsUpdate = false;
if (null == lp) {
lp = new LayoutParams(width, height, x, y);
} else {
- lp.x = x;
- lp.y = y;
- lp.width = width;
- lp.height = height;
+ if ((lp.x != x) || (lp.y != y) || (lp.width != width)
+ || (lp.height != height)) {
+ needsUpdate = true;
+ lp.x = x;
+ lp.y = y;
+ lp.width = width;
+ lp.height = height;
+ }
}
if (getParent() == null) {
// Insert the view so that it's drawn first (at index 0)
mWebView.addView(this, 0, lp);
- } else {
+ } else if (needsUpdate) {
setLayoutParams(lp);
}
// Set up a measure spec so a layout can always be recreated.
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index f0dc732..7249497 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -683,7 +683,6 @@
private static final int SWITCH_TO_LONGPRESS = 4;
private static final int RELEASE_SINGLE_TAP = 5;
private static final int REQUEST_FORM_DATA = 6;
- private static final int RESUME_WEBCORE_PRIORITY = 7;
private static final int DRAG_HELD_MOTIONLESS = 8;
private static final int AWAKEN_SCROLL_BARS = 9;
private static final int PREVENT_DEFAULT_TIMEOUT = 10;
@@ -1485,7 +1484,21 @@
private int getVisibleTitleHeightImpl() {
// need to restrict mScrollY due to over scroll
return Math.max(getTitleHeight() - Math.max(0, mScrollY),
- mFindCallback != null ? mFindCallback.getActionModeHeight() : 0);
+ getOverlappingActionModeHeight());
+ }
+
+ private int mCachedOverlappingActionModeHeight = -1;
+
+ private int getOverlappingActionModeHeight() {
+ if (mFindCallback == null) {
+ return 0;
+ }
+ if (mCachedOverlappingActionModeHeight < 0) {
+ getGlobalVisibleRect(mGlobalVisibleRect, mGlobalVisibleOffset);
+ mCachedOverlappingActionModeHeight = Math.max(0,
+ mFindCallback.getActionModeGlobalBottom() - mGlobalVisibleRect.top);
+ }
+ return mCachedOverlappingActionModeHeight;
}
/*
@@ -2848,48 +2861,49 @@
}
// Used to avoid sending many visible rect messages.
- private Rect mLastVisibleRectSent;
- private Rect mLastGlobalRect;
+ private Rect mLastVisibleRectSent = new Rect();
+ private Rect mLastGlobalRect = new Rect();
+ private Rect mVisibleRect = new Rect();
+ private Rect mGlobalVisibleRect = new Rect();
+ private Point mScrollOffset = new Point();
Rect sendOurVisibleRect() {
if (mZoomManager.isPreventingWebkitUpdates()) return mLastVisibleRectSent;
- Rect rect = new Rect();
- calcOurContentVisibleRect(rect);
+ calcOurContentVisibleRect(mVisibleRect);
// Rect.equals() checks for null input.
- if (!rect.equals(mLastVisibleRectSent)) {
+ if (!mVisibleRect.equals(mLastVisibleRectSent)) {
if (!mBlockWebkitViewMessages) {
- Point pos = new Point(rect.left, rect.top);
+ mScrollOffset.set(mVisibleRect.left, mVisibleRect.top);
mWebViewCore.removeMessages(EventHub.SET_SCROLL_OFFSET);
mWebViewCore.sendMessage(EventHub.SET_SCROLL_OFFSET,
- nativeMoveGeneration(), mSendScrollEvent ? 1 : 0, pos);
+ nativeMoveGeneration(), mSendScrollEvent ? 1 : 0, mScrollOffset);
}
- mLastVisibleRectSent = rect;
+ mLastVisibleRectSent.set(mVisibleRect);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
}
- Rect globalRect = new Rect();
- if (getGlobalVisibleRect(globalRect)
- && !globalRect.equals(mLastGlobalRect)) {
+ if (getGlobalVisibleRect(mGlobalVisibleRect)
+ && !mGlobalVisibleRect.equals(mLastGlobalRect)) {
if (DebugFlags.WEB_VIEW) {
- Log.v(LOGTAG, "sendOurVisibleRect=(" + globalRect.left + ","
- + globalRect.top + ",r=" + globalRect.right + ",b="
- + globalRect.bottom);
+ Log.v(LOGTAG, "sendOurVisibleRect=(" + mGlobalVisibleRect.left + ","
+ + mGlobalVisibleRect.top + ",r=" + mGlobalVisibleRect.right + ",b="
+ + mGlobalVisibleRect.bottom);
}
// TODO: the global offset is only used by windowRect()
// in ChromeClientAndroid ; other clients such as touch
// and mouse events could return view + screen relative points.
if (!mBlockWebkitViewMessages) {
- mWebViewCore.sendMessage(EventHub.SET_GLOBAL_BOUNDS, globalRect);
+ mWebViewCore.sendMessage(EventHub.SET_GLOBAL_BOUNDS, mGlobalVisibleRect);
}
- mLastGlobalRect = globalRect;
+ mLastGlobalRect.set(mGlobalVisibleRect);
}
- return rect;
+ return mVisibleRect;
}
+ private Point mGlobalVisibleOffset = new Point();
// Sets r to be the visible rectangle of our webview in view coordinates
private void calcOurVisibleRect(Rect r) {
- Point p = new Point();
- getGlobalVisibleRect(r, p);
- r.offset(-p.x, -p.y);
+ getGlobalVisibleRect(r, mGlobalVisibleOffset);
+ r.offset(-mGlobalVisibleOffset.x, -mGlobalVisibleOffset.y);
}
// Sets r to be our visible rectangle in content coordinates
@@ -2905,21 +2919,21 @@
r.bottom = viewToContentY(r.bottom);
}
+ private Rect mContentVisibleRect = new Rect();
// Sets r to be our visible rectangle in content coordinates. We use this
// method on the native side to compute the position of the fixed layers.
// Uses floating coordinates (necessary to correctly place elements when
// the scale factor is not 1)
private void calcOurContentVisibleRectF(RectF r) {
- Rect ri = new Rect(0,0,0,0);
- calcOurVisibleRect(ri);
- r.left = viewToContentXf(ri.left);
+ calcOurVisibleRect(mContentVisibleRect);
+ r.left = viewToContentXf(mContentVisibleRect.left);
// viewToContentY will remove the total height of the title bar. Add
// the visible height back in to account for the fact that if the title
// bar is partially visible, the part of the visible rect which is
// displaying our content is displaced by that amount.
- r.top = viewToContentYf(ri.top + getVisibleTitleHeightImpl());
- r.right = viewToContentXf(ri.right);
- r.bottom = viewToContentYf(ri.bottom);
+ r.top = viewToContentYf(mContentVisibleRect.top + getVisibleTitleHeightImpl());
+ r.right = viewToContentXf(mContentVisibleRect.right);
+ r.bottom = viewToContentYf(mContentVisibleRect.bottom);
}
static class ViewSizeData {
@@ -3240,6 +3254,26 @@
if (mHTML5VideoViewProxy != null) {
mHTML5VideoViewProxy.pauseAndDispatch();
}
+ if (mNativeClass != 0) {
+ nativeSetPauseDrawing(mNativeClass, true);
+ }
+ }
+ }
+
+ @Override
+ protected void onWindowVisibilityChanged(int visibility) {
+ super.onWindowVisibilityChanged(visibility);
+ updateDrawingState();
+ }
+
+ void updateDrawingState() {
+ if (mNativeClass == 0 || mIsPaused) return;
+ if (getWindowVisibility() != VISIBLE) {
+ nativeSetPauseDrawing(mNativeClass, true);
+ } else if (getVisibility() != VISIBLE) {
+ nativeSetPauseDrawing(mNativeClass, true);
+ } else {
+ nativeSetPauseDrawing(mNativeClass, false);
}
}
@@ -3251,6 +3285,9 @@
if (mIsPaused) {
mIsPaused = false;
mWebViewCore.sendMessage(EventHub.ON_RESUME);
+ if (mNativeClass != 0) {
+ nativeSetPauseDrawing(mNativeClass, false);
+ }
}
}
@@ -3375,6 +3412,7 @@
// Could not start the action mode, so end Find on page
return false;
}
+ mCachedOverlappingActionModeHeight = -1;
mFindCallback = callback;
setFindIsUp(true);
mFindCallback.setWebView(this);
@@ -3492,6 +3530,7 @@
*/
void notifyFindDialogDismissed() {
mFindCallback = null;
+ mCachedOverlappingActionModeHeight = -1;
if (mWebViewCore == null) {
return;
}
@@ -3569,7 +3608,6 @@
mScrollingLayerRect.top = y;
}
abortAnimation();
- mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
nativeSetIsScrolling(false);
if (!mBlockWebkitViewMessages) {
WebViewCore.resumePriority();
@@ -4342,6 +4380,7 @@
@Override
protected void onConfigurationChanged(Configuration newConfig) {
+ mCachedOverlappingActionModeHeight = -1;
if (mSelectingText && mOrientation != newConfig.orientation) {
selectionDone();
}
@@ -5583,6 +5622,7 @@
if (visibility != View.VISIBLE && mZoomManager != null) {
mZoomManager.dismissZoomPicker();
}
+ updateDrawingState();
}
/**
@@ -5992,7 +6032,6 @@
mScroller.abortAnimation();
mTouchMode = TOUCH_DRAG_START_MODE;
mConfirmMove = true;
- mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
nativeSetIsScrolling(false);
} else if (mPrivateHandler.hasMessages(RELEASE_SINGLE_TAP)) {
mPrivateHandler.removeMessages(RELEASE_SINGLE_TAP);
@@ -7329,7 +7368,6 @@
mLastTouchTime = eventTime;
if (!mScroller.isFinished()) {
abortAnimation();
- mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
}
mSnapScrollMode = SNAP_NONE;
mVelocityTracker = VelocityTracker.obtain();
@@ -8389,6 +8427,9 @@
setNewPicture(mDelaySetPicture, true);
mDelaySetPicture = null;
}
+ if (mIsPaused) {
+ nativeSetPauseDrawing(mNativeClass, true);
+ }
break;
case UPDATE_TEXTFIELD_TEXT_MSG_ID:
// Make sure that the textfield is currently focused
@@ -8461,10 +8502,6 @@
mWebTextView.setAdapterCustom(adapter);
}
break;
- case RESUME_WEBCORE_PRIORITY:
- WebViewCore.resumePriority();
- WebViewCore.resumeUpdatePicture(mWebViewCore);
- break;
case LONG_PRESS_CENTER:
// as this is shared by keydown and trackballdown, reset all
@@ -8723,27 +8760,6 @@
isPictureAfterFirstLayout, registerPageSwapCallback);
}
final Point viewSize = draw.mViewSize;
- if (isPictureAfterFirstLayout) {
- // Reset the last sent data here since dealing with new page.
- mLastWidthSent = 0;
- mZoomManager.onFirstLayout(draw);
- if (!mDrawHistory) {
- // Do not send the scroll event for this particular
- // scroll message. Note that a scroll event may
- // still be fired if the user scrolls before the
- // message can be handled.
- mSendScrollEvent = false;
- setContentScrollTo(viewState.mScrollX, viewState.mScrollY);
- mSendScrollEvent = true;
-
- // As we are on a new page, remove the WebTextView. This
- // is necessary for page loads driven by webkit, and in
- // particular when the user was on a password field, so
- // the WebTextView was visible.
- clearTextEntry();
- }
- }
-
// We update the layout (i.e. request a layout from the
// view system) if the last view size that we sent to
// WebCore matches the view size of the picture we just
@@ -8756,7 +8772,25 @@
mSendScrollEvent = false;
recordNewContentSize(draw.mContentSize.x,
draw.mContentSize.y, updateLayout);
+
+ if (isPictureAfterFirstLayout) {
+ // Reset the last sent data here since dealing with new page.
+ mLastWidthSent = 0;
+ mZoomManager.onFirstLayout(draw);
+ int scrollX = viewState.mShouldStartScrolledRight
+ ? getContentWidth() : viewState.mScrollX;
+ int scrollY = viewState.mScrollY;
+ setContentScrollTo(scrollX, scrollY);
+ if (!mDrawHistory) {
+ // As we are on a new page, remove the WebTextView. This
+ // is necessary for page loads driven by webkit, and in
+ // particular when the user was on a password field, so
+ // the WebTextView was visible.
+ clearTextEntry();
+ }
+ }
mSendScrollEvent = true;
+
if (DebugFlags.WEB_VIEW) {
Rect b = draw.mInvalRegion.getBounds();
Log.v(LOGTAG, "NEW_PICTURE_MSG_ID {" +
@@ -9574,4 +9608,5 @@
* See {@link ComponentCallbacks2} for the trim levels and descriptions
*/
private static native void nativeOnTrimMemory(int level);
+ private static native void nativeSetPauseDrawing(int instance, boolean pause);
}
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 754d6e9..cd61481 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -1982,6 +1982,7 @@
int mScrollY;
boolean mMobileSite;
boolean mIsRestored;
+ boolean mShouldStartScrolledRight;
}
static class DrawData {
@@ -2382,6 +2383,7 @@
viewState.mMobileSite = false;
// for non-mobile site, we don't need minPrefWidth, set it as 0
viewState.mScrollX = 0;
+ viewState.mShouldStartScrolledRight = false;
Message.obtain(mWebView.mPrivateHandler,
WebView.UPDATE_ZOOM_RANGE, viewState).sendToTarget();
return;
@@ -2412,6 +2414,11 @@
mInitialViewState.mDefaultScale = adjust;
mInitialViewState.mScrollX = mRestoredX;
mInitialViewState.mScrollY = mRestoredY;
+ mInitialViewState.mShouldStartScrolledRight = (mRestoredX == 0)
+ && (mRestoredY == 0)
+ && (mBrowserFrame != null)
+ && mBrowserFrame.getShouldStartScrolledRight();
+
mInitialViewState.mMobileSite = (0 == mViewportWidth);
if (mIsRestored) {
mInitialViewState.mIsRestored = true;
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java
index fd2abc2..326587e 100644
--- a/core/java/android/widget/EdgeEffect.java
+++ b/core/java/android/widget/EdgeEffect.java
@@ -129,7 +129,7 @@
mEdge = res.getDrawable(R.drawable.overscroll_edge);
mGlow = res.getDrawable(R.drawable.overscroll_glow);
- mMinWidth = (int) (context.getResources().getDisplayMetrics().density * MIN_WIDTH + 0.5f);
+ mMinWidth = (int) (res.getDisplayMetrics().density * MIN_WIDTH + 0.5f);
mInterpolator = new DecelerateInterpolator();
}
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index b24dd69..73e1273 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -1035,4 +1035,29 @@
mDrawable.setAlpha(mAlpha * mViewAlphaScale >> 8);
}
}
+
+ @RemotableViewMethod
+ @Override
+ public void setVisibility(int visibility) {
+ super.setVisibility(visibility);
+ if (mDrawable != null) {
+ mDrawable.setVisible(visibility == VISIBLE, false);
+ }
+ }
+
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ if (mDrawable != null) {
+ mDrawable.setVisible(getVisibility() == VISIBLE, false);
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ if (mDrawable != null) {
+ mDrawable.setVisible(false, false);
+ }
+ }
}
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 5ab99dc..1a1b8d0 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -741,9 +741,16 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- final int newWidthMeasureSpec = makeMeasureSpec(widthMeasureSpec, mMinWidth, mMaxWidth);
- final int newHeightMeasureSpec = makeMeasureSpec(heightMeasureSpec, mMinHeight, mMaxHeight);
+ // Try greedily to fit the max width and height.
+ final int newWidthMeasureSpec = makeMeasureSpec(widthMeasureSpec, mMaxWidth);
+ final int newHeightMeasureSpec = makeMeasureSpec(heightMeasureSpec, mMaxHeight);
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
+ // Flag if we are measured with width or height less than the respective min.
+ final int desiredWidth = Math.max(mMinWidth, getMeasuredWidth());
+ final int desiredHeight = Math.max(mMinHeight, getMeasuredHeight());
+ final int widthSize = resolveSizeAndState(desiredWidth, newWidthMeasureSpec, 0);
+ final int heightSize = resolveSizeAndState(desiredHeight, newHeightMeasureSpec, 0);
+ setMeasuredDimension(widthSize, heightSize);
}
@Override
@@ -1357,23 +1364,19 @@
* Makes a measure spec that tries greedily to use the max value.
*
* @param measureSpec The measure spec.
- * @param maxValue The max value for the size.
+ * @param maxSize The max value for the size.
* @return A measure spec greedily imposing the max size.
*/
- private int makeMeasureSpec(int measureSpec, int minValue, int maxValue) {
+ private int makeMeasureSpec(int measureSpec, int maxSize) {
final int size = MeasureSpec.getSize(measureSpec);
- if (size < minValue) {
- throw new IllegalArgumentException("Available space is less than min size: "
- + size + " < " + minValue);
- }
final int mode = MeasureSpec.getMode(measureSpec);
switch (mode) {
case MeasureSpec.EXACTLY:
return measureSpec;
case MeasureSpec.AT_MOST:
- return MeasureSpec.makeMeasureSpec(Math.min(size, maxValue), MeasureSpec.EXACTLY);
+ return MeasureSpec.makeMeasureSpec(Math.min(size, maxSize), MeasureSpec.EXACTLY);
case MeasureSpec.UNSPECIFIED:
- return MeasureSpec.makeMeasureSpec(maxValue, MeasureSpec.EXACTLY);
+ return MeasureSpec.makeMeasureSpec(maxSize, MeasureSpec.EXACTLY);
default:
throw new IllegalArgumentException("Unknown measure mode: " + mode);
}
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 8ba7bee..5fa4ad0 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -1248,6 +1248,8 @@
*/
public void dismiss() {
if (isShowing() && mPopupView != null) {
+ mIsShowing = false;
+
unregisterForScrollChanged();
try {
@@ -1257,7 +1259,6 @@
((ViewGroup) mPopupView).removeView(mContentView);
}
mPopupView = null;
- mIsShowing = false;
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss();
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index e929e7d..ebb2604 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -76,12 +76,14 @@
mIds = new int[size];
mSpellCheckSpans = new SpellCheckSpan[size];
- setLocale(mTextView.getLocale());
+ setLocale(mTextView.getTextServicesLocale());
mCookie = hashCode();
}
private void setLocale(Locale locale) {
+ closeSession();
+
final TextServicesManager textServicesManager = (TextServicesManager)
mTextView.getContext().getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
if (!textServicesManager.isSpellCheckerEnabled()) {
@@ -104,12 +106,6 @@
// Change SpellParsers' wordIterator locale
mWordIterator = new WordIterator(locale);
- // Stop all SpellParsers
- final int length = mSpellParsers.length;
- for (int i = 0; i < length; i++) {
- mSpellParsers[i].finish();
- }
-
// Remove existing misspelled SuggestionSpans
mTextView.removeMisspelledSpans((Editable) mTextView.getText());
@@ -177,7 +173,7 @@
}
public void spellCheck(int start, int end) {
- final Locale locale = mTextView.getLocale();
+ final Locale locale = mTextView.getTextServicesLocale();
if (mCurrentLocale == null || (!(mCurrentLocale.equals(locale)))) {
setLocale(locale);
// Re-check the entire text
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 27d44bf..ec3790e 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -68,6 +68,7 @@
int mDropDownWidth;
private int mGravity;
+ private boolean mDisableChildrenWhenDisabled;
private Rect mTempRect = new Rect();
@@ -186,6 +187,9 @@
mPopup.setPromptText(a.getString(com.android.internal.R.styleable.Spinner_prompt));
+ mDisableChildrenWhenDisabled = a.getBoolean(
+ com.android.internal.R.styleable.Spinner_disableChildrenWhenDisabled, false);
+
a.recycle();
// Base constructor can call setAdapter before we initialize mPopup.
@@ -196,6 +200,17 @@
}
}
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (mDisableChildrenWhenDisabled) {
+ final int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ getChildAt(i).setEnabled(enabled);
+ }
+ }
+ }
+
/**
* Describes how the selected item view is positioned. Currently only the horizontal component
* is used. The default is determined by the current theme.
@@ -398,6 +413,9 @@
addViewInLayout(child, 0, lp);
child.setSelected(hasFocus());
+ if (mDisableChildrenWhenDisabled) {
+ child.setEnabled(isEnabled());
+ }
// Get measure specs
int childHeightSpec = ViewGroup.getChildMeasureSpec(mHeightMeasureSpec,
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a8680d4..b106cc5 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -24,6 +24,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
+import android.content.res.CompatibilityInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
@@ -36,7 +37,6 @@
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.inputmethodservice.ExtractEditText;
-import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -101,7 +101,6 @@
import android.util.TypedValue;
import android.view.ActionMode;
import android.view.ActionMode.Callback;
-import android.view.ContextMenu;
import android.view.DragEvent;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
@@ -133,6 +132,8 @@
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
+import android.view.textservice.SpellCheckerSubtype;
+import android.view.textservice.TextServicesManager;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.RemoteViews.RemoteView;
@@ -449,18 +450,19 @@
super(context, attrs, defStyle);
mText = "";
+ final Resources res = getResources();
+ final CompatibilityInfo compat = res.getCompatibilityInfo();
+
mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
- mTextPaint.density = getResources().getDisplayMetrics().density;
- mTextPaint.setCompatibilityScaling(
- getResources().getCompatibilityInfo().applicationScale);
+ mTextPaint.density = res.getDisplayMetrics().density;
+ mTextPaint.setCompatibilityScaling(compat.applicationScale);
// If we get the paint from the skin, we should set it to left, since
// the layout always wants it to be left.
// mTextPaint.setTextAlign(Paint.Align.LEFT);
mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
- mHighlightPaint.setCompatibilityScaling(
- getResources().getCompatibilityInfo().applicationScale);
+ mHighlightPaint.setCompatibilityScaling(compat.applicationScale);
mMovement = getDefaultMovementMethod();
mTransformation = null;
@@ -8355,10 +8357,12 @@
// When the cursor moves, the word that was typed may need spell check
mSpellChecker.onSelectionChanged();
}
- if (isCursorInsideEasyCorrectionSpan()) {
- showSuggestions();
- } else if (hasInsertionController()) {
- getInsertionController().show();
+ if (!extractedTextModeWillBeStarted()) {
+ if (isCursorInsideEasyCorrectionSpan()) {
+ showSuggestions();
+ } else if (hasInsertionController()) {
+ getInsertionController().show();
+ }
}
}
@@ -8904,21 +8908,18 @@
/**
* This is a temporary method. Future versions may support multi-locale text.
*
- * @return The current locale used in this TextView, based on the current IME's locale,
- * or the system default locale if this is not defined.
+ * @return The locale that should be used for a word iterator and a spell checker
+ * in this TextView, based on the current spell checker settings,
+ * the current IME's locale, or the system default locale.
* @hide
*/
- public Locale getLocale() {
+ public Locale getTextServicesLocale() {
Locale locale = Locale.getDefault();
- final InputMethodManager imm = InputMethodManager.peekInstance();
- if (imm != null) {
- final InputMethodSubtype currentInputMethodSubtype = imm.getCurrentInputMethodSubtype();
- if (currentInputMethodSubtype != null) {
- String localeString = currentInputMethodSubtype.getLocale();
- if (!TextUtils.isEmpty(localeString)) {
- locale = new Locale(localeString);
- }
- }
+ final TextServicesManager textServicesManager = (TextServicesManager)
+ mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
+ final SpellCheckerSubtype subtype = textServicesManager.getCurrentSpellCheckerSubtype(true);
+ if (subtype != null) {
+ locale = new Locale(subtype.getLocale());
}
return locale;
}
@@ -8933,7 +8934,7 @@
*/
public WordIterator getWordIterator() {
if (mWordIterator == null) {
- mWordIterator = new WordIterator(getLocale());
+ mWordIterator = new WordIterator(getTextServicesLocale());
}
return mWordIterator;
}
@@ -9059,51 +9060,6 @@
sendAccessibilityEventUnchecked(event);
}
- @Override
- protected void onCreateContextMenu(ContextMenu menu) {
- super.onCreateContextMenu(menu);
- boolean added = false;
- mContextMenuTriggeredByKey = mDPadCenterIsDown || mEnterKeyIsDown;
- // Problem with context menu on long press: the menu appears while the key in down and when
- // the key is released, the view does not receive the key_up event.
- // We need two layers of flags: mDPadCenterIsDown and mEnterKeyIsDown are set in key down/up
- // events. We cannot simply clear these flags in onTextContextMenuItem since
- // it may not be called (if the user/ discards the context menu with the back key).
- // We clear these flags here and mContextMenuTriggeredByKey saves that state so that it is
- // available in onTextContextMenuItem.
- mDPadCenterIsDown = mEnterKeyIsDown = false;
-
- MenuHandler handler = new MenuHandler();
-
- if (mText instanceof Spanned && hasSelectionController()) {
- long lastTouchOffset = getLastTouchOffsets();
- final int selStart = extractRangeStartFromLong(lastTouchOffset);
- final int selEnd = extractRangeEndFromLong(lastTouchOffset);
-
- URLSpan[] urls = ((Spanned) mText).getSpans(selStart, selEnd, URLSpan.class);
- if (urls.length > 0) {
- menu.add(0, ID_COPY_URL, 0, com.android.internal.R.string.copyUrl).
- setOnMenuItemClickListener(handler);
-
- added = true;
- }
- }
-
- // The context menu is not empty, which will prevent the selection mode from starting.
- // Add a entry to start it in the context menu.
- // TODO Does not handle the case where a subclass does not call super.thisMethod or
- // populates the menu AFTER this call.
- if (menu.size() > 0) {
- menu.add(0, ID_SELECTION_MODE, 0, com.android.internal.R.string.selectTextMode).
- setOnMenuItemClickListener(handler);
- added = true;
- }
-
- if (added) {
- menu.setHeaderTitle(com.android.internal.R.string.editTextMenuTitle);
- }
- }
-
/**
* Returns whether this text view is a current input method target. The
* default implementation just checks with {@link InputMethodManager}.
@@ -9118,9 +9074,6 @@
private static final int ID_CUT = android.R.id.cut;
private static final int ID_COPY = android.R.id.copy;
private static final int ID_PASTE = android.R.id.paste;
- // Context menu entries
- private static final int ID_COPY_URL = android.R.id.copyUrl;
- private static final int ID_SELECTION_MODE = android.R.id.selectTextMode;
private class MenuHandler implements MenuItem.OnMenuItemClickListener {
public boolean onMenuItemClick(MenuItem item) {
@@ -9130,9 +9083,8 @@
/**
* Called when a context menu option for the text view is selected. Currently
- * this will be {@link android.R.id#copyUrl}, {@link android.R.id#selectTextMode},
- * {@link android.R.id#selectAll}, {@link android.R.id#paste}, {@link android.R.id#cut}
- * or {@link android.R.id#copy}.
+ * this will be one of {@link android.R.id#selectAll}, {@link android.R.id#cut},
+ * {@link android.R.id#copy} or {@link android.R.id#paste}.
*
* @return true if the context menu item action was performed.
*/
@@ -9149,34 +9101,6 @@
}
switch (id) {
- case ID_COPY_URL:
- URLSpan[] urls = ((Spanned) mText).getSpans(min, max, URLSpan.class);
- if (urls.length >= 1) {
- ClipData clip = null;
- for (int i=0; i<urls.length; i++) {
- Uri uri = Uri.parse(urls[0].getURL());
- if (clip == null) {
- clip = ClipData.newRawUri(null, uri);
- } else {
- clip.addItem(new ClipData.Item(uri));
- }
- }
- if (clip != null) {
- setPrimaryClip(clip);
- }
- }
- stopSelectionActionMode();
- return true;
-
- case ID_SELECTION_MODE:
- if (mSelectionActionMode != null) {
- // Selection mode is already started, simply change selected part.
- selectCurrentWord();
- } else {
- startSelectionActionMode();
- }
- return true;
-
case ID_SELECT_ALL:
// This does not enter text selection mode. Text is highlighted, so that it can be
// bulk edited, like selectAllOnFocus does. Returns true even if text is empty.
@@ -10190,27 +10114,35 @@
}
}
- final InputMethodManager imm = InputMethodManager.peekInstance();
- boolean extractedTextModeWillBeStartedFullScreen = !(this instanceof ExtractEditText) &&
- imm != null && imm.isFullscreenMode();
+ boolean willExtract = extractedTextModeWillBeStarted();
// Do not start the action mode when extracted text will show up full screen, thus
// immediately hiding the newly created action bar, which would be visually distracting.
- if (!extractedTextModeWillBeStartedFullScreen) {
+ if (!willExtract) {
ActionMode.Callback actionModeCallback = new SelectionActionModeCallback();
mSelectionActionMode = startActionMode(actionModeCallback);
}
- final boolean selectionStarted = mSelectionActionMode != null ||
- extractedTextModeWillBeStartedFullScreen;
- if (selectionStarted && !mTextIsSelectable && imm != null && mSoftInputShownOnFocus) {
+ final boolean selectionStarted = mSelectionActionMode != null || willExtract;
+ if (selectionStarted && !mTextIsSelectable && mSoftInputShownOnFocus) {
// Show the IME to be able to replace text, except when selecting non editable text.
- imm.showSoftInput(this, 0, null);
+ final InputMethodManager imm = InputMethodManager.peekInstance();
+ if (imm != null) {
+ imm.showSoftInput(this, 0, null);
+ }
}
return selectionStarted;
}
+ private boolean extractedTextModeWillBeStarted() {
+ if (!(this instanceof ExtractEditText)) {
+ final InputMethodManager imm = InputMethodManager.peekInstance();
+ return imm != null && imm.isFullscreenMode();
+ }
+ return false;
+ }
+
private void stopSelectionActionMode() {
if (mSelectionActionMode != null) {
// This will hide the mSelectionModifierCursorController
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 4714be8..b689f53 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -537,7 +537,7 @@
if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
- final int vis = showHome ? VISIBLE : GONE;
+ final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
mHomeLayout.setVisibility(vis);
if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index d5450e4..89f9d4e 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -25,14 +25,11 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
-import android.hardware.Camera;
-import android.hardware.Camera.CameraInfo;
import android.os.FileObserver;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
-import android.os.SystemProperties;
import android.os.storage.IMountService;
import android.provider.Settings;
import android.security.KeyStore;
@@ -41,7 +38,6 @@
import android.util.Log;
import android.view.View;
import android.widget.Button;
-import android.widget.TextView;
import java.io.File;
import java.io.FileNotFoundException;
@@ -439,17 +435,6 @@
}
/**
- * Calls back SetupFaceLock to save the temporary gallery file if this is the backup lock.
- * This doesn't have to verify that biometric is enabled because it's only called in that case
- */
- void moveTempGallery() {
- Intent intent = new Intent().setClassName("com.android.facelock",
- "com.android.facelock.SetupFaceLock");
- intent.putExtra("moveTempGallery", true);
- mContext.startActivity(intent);
- }
-
- /**
* Calls back SetupFaceLock to delete the temporary gallery file
*/
public void deleteTempGallery() {
@@ -501,8 +486,7 @@
setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK);
setLong(PASSWORD_TYPE_ALTERNATE_KEY,
DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
- setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);
- moveTempGallery();
+ finishBiometricWeak();
}
dpm.setActivePasswordState(DevicePolicyManager.PASSWORD_QUALITY_SOMETHING, pattern
.size(), 0, 0, 0, 0, 0, 0);
@@ -619,8 +603,7 @@
} else {
setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK);
setLong(PASSWORD_TYPE_ALTERNATE_KEY, Math.max(quality, computedQuality));
- setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);
- moveTempGallery();
+ finishBiometricWeak();
}
if (computedQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
int letters = 0;
@@ -981,6 +964,11 @@
com.android.internal.R.bool.config_enable_puk_unlock_screen);
}
+ public boolean isEmergencyCallEnabledWhileSimLocked() {
+ return mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_enable_emergency_call_while_sim_locked);
+ }
+
/**
* @return A formatted string of the next alarm (for showing on the lock screen),
* or null if there is no next alarm.
@@ -1044,12 +1032,10 @@
* {@link TelephonyManager#CALL_STATE_IDLE}
* {@link TelephonyManager#CALL_STATE_RINGING}
* {@link TelephonyManager#CALL_STATE_OFFHOOK}
- * @param showIfCapable indicates whether the button should be shown if emergency calls are
- * possible on the device
+ * @param shown indicates whether the given screen wants the emergency button to show at all
*/
- public void updateEmergencyCallButtonState(Button button, int phoneState,
- boolean showIfCapable) {
- if (isEmergencyCallCapable() && showIfCapable) {
+ public void updateEmergencyCallButtonState(Button button, int phoneState, boolean shown) {
+ if (isEmergencyCallCapable() && shown) {
button.setVisibility(View.VISIBLE);
} else {
button.setVisibility(View.GONE);
@@ -1087,4 +1073,16 @@
}
return false;
}
+
+ private void finishBiometricWeak() {
+ setBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, true);
+
+ // Launch intent to show final screen, this also
+ // moves the temporary gallery to the actual gallery
+ Intent intent = new Intent();
+ intent.setClassName("com.android.facelock",
+ "com.android.facelock.SetupEndScreen");
+ mContext.startActivity(intent);
+ }
+
}
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index a2fc6e2..0d9cf9a 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -463,7 +463,7 @@
result = desired;
break;
case MeasureSpec.AT_MOST:
- result = Math.min(specSize, desired);
+ result = Math.max(specSize, desired);
break;
case MeasureSpec.EXACTLY:
default:
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 59a03e7..71c5d26 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -53,6 +53,7 @@
android_view_InputQueue.cpp \
android_view_KeyEvent.cpp \
android_view_KeyCharacterMap.cpp \
+ android_view_HardwareRenderer.cpp \
android_view_GLES20Canvas.cpp \
android_view_MotionEvent.cpp \
android_view_PointerIcon.cpp \
@@ -160,6 +161,7 @@
$(JNI_H_INCLUDE) \
$(LOCAL_PATH)/android/graphics \
$(LOCAL_PATH)/../../libs/hwui \
+ $(LOCAL_PATH)/../../opengl/libs \
$(call include-path-for, bluedroid) \
$(call include-path-for, libhardware)/hardware \
$(call include-path-for, libhardware_legacy)/hardware_legacy \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 12ec1b6..c00e6c9 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -116,6 +116,7 @@
extern int register_android_graphics_PixelFormat(JNIEnv* env);
extern int register_android_view_Display(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
+extern int register_android_view_HardwareRenderer(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
extern int register_android_view_TextureView(JNIEnv* env);
extern int register_android_database_CursorWindow(JNIEnv* env);
@@ -1101,6 +1102,7 @@
REG_JNI(register_android_graphics_PixelFormat),
REG_JNI(register_android_graphics_Graphics),
REG_JNI(register_android_view_GLES20Canvas),
+ REG_JNI(register_android_view_HardwareRenderer),
REG_JNI(register_android_view_Surface),
REG_JNI(register_android_view_TextureView),
REG_JNI(register_com_google_android_gles_jni_EGLImpl),
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index ffcd1a0..de2d8c4 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -212,10 +212,10 @@
surfaceTexture->setDefaultBufferSize(width, height);
}
-static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz)
+static jint SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz)
{
sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
- surfaceTexture->updateTexImage();
+ return surfaceTexture->updateTexImage();
}
static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz,
@@ -246,7 +246,7 @@
{"nativeInit", "(ILjava/lang/Object;Z)V", (void*)SurfaceTexture_init },
{"nativeFinalize", "()V", (void*)SurfaceTexture_finalize },
{"nativeSetDefaultBufferSize", "(II)V", (void*)SurfaceTexture_setDefaultBufferSize },
- {"nativeUpdateTexImage", "()V", (void*)SurfaceTexture_updateTexImage },
+ {"nativeUpdateTexImage", "()I", (void*)SurfaceTexture_updateTexImage },
{"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix },
{"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp },
{"nativeRelease", "()V", (void*)SurfaceTexture_release },
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 79aa43b..7076e2a 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -249,7 +249,7 @@
flags(other.flags),
hinting(other.hinting) {
if (other.text) {
- textCopy.setTo(other.text);
+ textCopy.setTo(other.text, other.contextCount);
}
}
diff --git a/core/jni/android_nfc_NdefRecord.cpp b/core/jni/android_nfc_NdefRecord.cpp
index e8cc4c6..67907b6 100644
--- a/core/jni/android_nfc_NdefRecord.cpp
+++ b/core/jni/android_nfc_NdefRecord.cpp
@@ -149,7 +149,7 @@
/* Set flags field */
mFlags = e->GetFieldID(record_cls, "mFlags", "B");
- e->SetIntField(o, mFlags, record.Flags);
+ e->SetByteField(o, mFlags, record.Flags);
ret = 0;
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 1718e74..2bd4fa0 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -38,6 +38,7 @@
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <utils/threads.h>
+#include <utils/String8.h>
#include <ScopedUtfChars.h>
#include <ScopedLocalRef.h>
@@ -651,7 +652,8 @@
gParcelFileDescriptorOffsets.mClass, gParcelFileDescriptorOffsets.mConstructor, fileDesc);
}
-void signalExceptionForError(JNIEnv* env, jobject obj, status_t err)
+static void signalExceptionForError(JNIEnv* env, jobject obj, status_t err,
+ bool canThrowRemoteException = false)
{
switch (err) {
case UNKNOWN_ERROR:
@@ -688,14 +690,25 @@
jniThrowException(env, "java/lang/RuntimeException", "Item already exists");
break;
case DEAD_OBJECT:
- jniThrowException(env, "android/os/DeadObjectException", NULL);
+ // DeadObjectException is a checked exception, only throw from certain methods.
+ jniThrowException(env, canThrowRemoteException
+ ? "android/os/DeadObjectException"
+ : "java/lang/RuntimeException", NULL);
break;
case UNKNOWN_TRANSACTION:
jniThrowException(env, "java/lang/RuntimeException", "Unknown transaction code");
break;
case FAILED_TRANSACTION:
LOGE("!!! FAILED BINDER TRANSACTION !!!");
- //jniThrowException(env, "java/lang/OutOfMemoryError", "Binder transaction too large");
+ // TransactionTooLargeException is a checked exception, only throw from certain methods.
+ // FIXME: Transaction too large is the most common reason for FAILED_TRANSACTION
+ // but it is not the only one. The Binder driver can return BR_FAILED_REPLY
+ // for other reasons also, such as if the transaction is malformed or
+ // refers to an FD that has been closed. We should change the driver
+ // to enable us to distinguish these cases in the future.
+ jniThrowException(env, canThrowRemoteException
+ ? "android/os/TransactionTooLargeException"
+ : "java/lang/RuntimeException", NULL);
break;
case FDS_NOT_ALLOWED:
jniThrowException(env, "java/lang/RuntimeException",
@@ -703,6 +716,12 @@
break;
default:
LOGE("Unknown binder error code. 0x%x", err);
+ String8 msg;
+ msg.appendFormat("Unknown binder error code. 0x%x", err);
+ // RemoteException is a checked exception, only throw from certain methods.
+ jniThrowException(env, canThrowRemoteException
+ ? "android/os/RemoteException" : "java/lang/RuntimeException", msg.string());
+ break;
}
}
@@ -1036,8 +1055,7 @@
}
static jboolean android_os_BinderProxy_transact(JNIEnv* env, jobject obj,
- jint code, jobject dataObj,
- jobject replyObj, jint flags)
+ jint code, jobject dataObj, jobject replyObj, jint flags) // throws RemoteException
{
if (dataObj == NULL) {
jniThrowNullPointerException(env, NULL);
@@ -1084,12 +1102,12 @@
return JNI_FALSE;
}
- signalExceptionForError(env, obj, err);
+ signalExceptionForError(env, obj, err, true /*canThrowRemoteException*/);
return JNI_FALSE;
}
static void android_os_BinderProxy_linkToDeath(JNIEnv* env, jobject obj,
- jobject recipient, jint flags)
+ jobject recipient, jint flags) // throws RemoteException
{
if (recipient == NULL) {
jniThrowNullPointerException(env, NULL);
@@ -1114,7 +1132,7 @@
// Failure adding the death recipient, so clear its reference
// now.
jdr->clearReference();
- signalExceptionForError(env, obj, err);
+ signalExceptionForError(env, obj, err, true /*canThrowRemoteException*/);
}
}
}
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index e79de2d..4f75fad 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -134,6 +134,18 @@
}
}
+static void android_view_GLES20Canvas_initCaches(JNIEnv* env, jobject clazz) {
+ if (Caches::hasInstance()) {
+ Caches::getInstance().init();
+ }
+}
+
+static void android_view_GLES20Canvas_terminateCaches(JNIEnv* env, jobject clazz) {
+ if (Caches::hasInstance()) {
+ Caches::getInstance().terminate();
+ }
+}
+
// ----------------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------------
@@ -756,6 +768,8 @@
{ "nPreserveBackBuffer", "()Z", (void*) android_view_GLES20Canvas_preserveBackBuffer },
{ "nDisableVsync", "()V", (void*) android_view_GLES20Canvas_disableVsync },
{ "nFlushCaches", "(I)V", (void*) android_view_GLES20Canvas_flushCaches },
+ { "nInitCaches", "()V", (void*) android_view_GLES20Canvas_initCaches },
+ { "nTerminateCaches", "()V", (void*) android_view_GLES20Canvas_terminateCaches },
{ "nCreateRenderer", "()I", (void*) android_view_GLES20Canvas_createRenderer },
{ "nDestroyRenderer", "(I)V", (void*) android_view_GLES20Canvas_destroyRenderer },
diff --git a/core/jni/android_view_HardwareRenderer.cpp b/core/jni/android_view_HardwareRenderer.cpp
new file mode 100644
index 0000000..09809ec
--- /dev/null
+++ b/core/jni/android_view_HardwareRenderer.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#define LOG_TAG "HardwareRenderer"
+
+#include "jni.h"
+#include <nativehelper/JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <EGL/egl_cache.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+// Misc
+// ----------------------------------------------------------------------------
+
+static void android_view_HardwareRenderer_setupShadersDiskCache(JNIEnv* env, jobject clazz,
+ jstring diskCachePath) {
+
+ const char* cacheArray = env->GetStringUTFChars(diskCachePath, NULL);
+ egl_cache_t::get()->setCacheFilename(cacheArray);
+ env->ReleaseStringUTFChars(diskCachePath, cacheArray);
+}
+
+// ----------------------------------------------------------------------------
+// JNI Glue
+// ----------------------------------------------------------------------------
+
+const char* const kClassPathName = "android/view/HardwareRenderer";
+
+static JNINativeMethod gMethods[] = {
+ { "nSetupShadersDiskCache", "(Ljava/lang/String;)V",
+ (void*) android_view_HardwareRenderer_setupShadersDiskCache },
+};
+
+int register_android_view_HardwareRenderer(JNIEnv* env) {
+ return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods));
+}
+
+};
diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index 02974f9a..4fe7600 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -24,6 +24,8 @@
#include <EGL/egl.h>
#include <GLES/gl.h>
+#include <EGL/egl_display.h>
+
#include <surfaceflinger/Surface.h>
#include <SkBitmap.h>
#include <SkPixelRef.h>
@@ -173,6 +175,16 @@
return success;
}
+static jint jni_getInitCount(JNIEnv *_env, jobject _clazz, jobject display) {
+ EGLDisplay dpy = getDisplay(_env, display);
+ egl_display_t* eglDisplay = get_display(dpy);
+ return eglDisplay ? eglDisplay->getRefsCount() : 0;
+}
+
+static jboolean jni_eglReleaseThread(JNIEnv *_env, jobject _this) {
+ return eglReleaseThread();
+}
+
static jboolean jni_eglChooseConfig(JNIEnv *_env, jobject _this, jobject display,
jintArray attrib_list, jobjectArray configs, jint config_size, jintArray num_config) {
if (display == NULL
@@ -526,6 +538,8 @@
{"eglInitialize", "(" DISPLAY "[I)Z", (void*)jni_eglInitialize },
{"eglQueryContext", "(" DISPLAY CONTEXT "I[I)Z", (void*)jni_eglQueryContext },
{"eglQuerySurface", "(" DISPLAY SURFACE "I[I)Z", (void*)jni_eglQuerySurface },
+{"eglReleaseThread","()Z", (void*)jni_eglReleaseThread },
+{"getInitCount", "(" DISPLAY ")I", (void*)jni_getInitCount },
{"eglChooseConfig", "(" DISPLAY "[I[" CONFIG "I[I)Z", (void*)jni_eglChooseConfig },
{"_eglCreateContext","(" DISPLAY CONFIG CONTEXT "[I)I", (void*)jni_eglCreateContext },
{"eglGetConfigs", "(" DISPLAY "[" CONFIG "I[I)Z", (void*)jni_eglGetConfigs },
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 18194ee..230df39 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -423,6 +423,12 @@
android:description="@string/permdesc_accessWifiState"
android:label="@string/permlab_accessWifiState" />
+ <!-- @hide -->
+ <permission android:name="android.permission.ACCESS_WIMAX_STATE"
+ android:permissionGroup="android.permission-group.NETWORK"
+ android:protectionLevel="normal"
+ android:description="@string/permdesc_accessWimaxState"
+ android:label="@string/permlab_accessWimaxState" />
<!-- Allows applications to connect to paired bluetooth devices -->
<permission android:name="android.permission.BLUETOOTH"
android:permissionGroup="android.permission-group.NETWORK"
@@ -984,6 +990,12 @@
android:description="@string/permdesc_changeWifiState"
android:label="@string/permlab_changeWifiState" />
+ <!-- @hide -->
+ <permission android:name="android.permission.CHANGE_WIMAX_STATE"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_changeWimaxState"
+ android:label="@string/permlab_changeWimaxState" />
<!-- Allows applications to enter Wi-Fi Multicast mode -->
<permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1015,6 +1027,13 @@
android:label="@string/permlab_readLogs"
android:description="@string/permdesc_readLogs" />
+ <!-- Allows an application to use any media decoder when decoding for playback
+ @hide -->
+ <permission android:name="android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK"
+ android:protectionLevel="signatureOrSystem"
+ android:label="@string/permlab_anyCodecForPlayback"
+ android:description="@string/permdesc_anyCodecForPlayback" />
+
<!-- ========================================= -->
<!-- Permissions for special development tools -->
<!-- ========================================= -->
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index a686975..0000000
--- a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index 92db8ef..0000000
--- a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png b/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
new file mode 100644
index 0000000..c2e4b78
--- /dev/null
+++ b/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png b/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
new file mode 100644
index 0000000..51b839f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png b/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png
deleted file mode 100644
index 45cc20d..0000000
--- a/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png b/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png
deleted file mode 100644
index 45cc20d..0000000
--- a/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png
deleted file mode 100644
index fe72d00..0000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png
deleted file mode 100644
index be666c6..0000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png
deleted file mode 100644
index 9627197..0000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index 89d209c..0000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index 1d4cb32..0000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index 9627197..0000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_red_up.png b/core/res/res/drawable-sw600dp-mdpi/indicator_code_lock_drag_direction_red_up.png
similarity index 100%
rename from core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_red_up.png
rename to core/res/res/drawable-sw600dp-mdpi/indicator_code_lock_drag_direction_red_up.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index 66c1b58..0000000
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index b5f807f..0000000
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png b/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png
deleted file mode 100644
index 719eb89..0000000
--- a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png b/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png
deleted file mode 100644
index 719eb89..0000000
--- a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png
deleted file mode 100644
index 29cd471..0000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png
deleted file mode 100644
index 211aa0b..0000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png
deleted file mode 100644
index 683ba22..0000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png
deleted file mode 100644
index f4383f3..0000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png
deleted file mode 100644
index a798863..0000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png
deleted file mode 100644
index 07e6165..0000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png
deleted file mode 100644
index ec17841..0000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index a0cb1ec..0000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
deleted file mode 100644
index 8cc5535..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
deleted file mode 100644
index 4441ba2..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
deleted file mode 100644
index 73891a3..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
deleted file mode 100644
index db68eea..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
deleted file mode 100644
index 7af6921..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png
deleted file mode 100644
index 16424b9..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png
deleted file mode 100644
index 95cdc45..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png
deleted file mode 100644
index f61ccfa..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png
deleted file mode 100644
index 5666654..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png
deleted file mode 100644
index f9f4d81..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png
deleted file mode 100644
index 973ccc23..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png
deleted file mode 100644
index 1c7d446..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png
deleted file mode 100644
index 2120bdc..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png
deleted file mode 100644
index a526fcf..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png
deleted file mode 100644
index 85be2e3..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png
deleted file mode 100644
index 589b30b..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png
deleted file mode 100644
index 4debfc0..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png
deleted file mode 100644
index 3920ab1..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png
deleted file mode 100644
index a15716f..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png
deleted file mode 100644
index 8d7352f..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png
deleted file mode 100644
index 45f8e81..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png
deleted file mode 100644
index 696d9fb..0000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_default.png b/core/res/res/drawable-xlarge-hdpi/unlock_default.png
deleted file mode 100644
index 67311b9..0000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_halo.png b/core/res/res/drawable-xlarge-hdpi/unlock_halo.png
deleted file mode 100644
index d841dea..0000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_halo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_ring.png b/core/res/res/drawable-xlarge-hdpi/unlock_ring.png
deleted file mode 100644
index 172efb8..0000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_ring.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_wave.png b/core/res/res/drawable-xlarge-hdpi/unlock_wave.png
deleted file mode 100644
index 1ad26c3..0000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_wave.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
deleted file mode 100644
index 97ac023..0000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
deleted file mode 100644
index 4210db2..0000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
deleted file mode 100644
index 1060f5a..0000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
deleted file mode 100644
index 72e4afa..0000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
deleted file mode 100644
index 22adc67..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
deleted file mode 100644
index c434d12..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
deleted file mode 100644
index daf3b84..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
deleted file mode 100644
index 7b097b1..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
deleted file mode 100644
index 8daef7c..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png
deleted file mode 100644
index ad48321..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png
deleted file mode 100644
index 16481d6..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png
deleted file mode 100644
index c3cdcc8..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png
deleted file mode 100644
index ec58d31..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png
deleted file mode 100644
index 1fb3696..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png
deleted file mode 100644
index d6d143a..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png
deleted file mode 100644
index 8de99fa..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png
deleted file mode 100644
index 4600b25..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png
deleted file mode 100644
index 3640f55..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png
deleted file mode 100644
index 53af703..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png
deleted file mode 100644
index c2282e6..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png
deleted file mode 100644
index 704f962..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png
deleted file mode 100644
index b275dbb..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png
deleted file mode 100644
index 5b0649f..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png
deleted file mode 100644
index 8bc888e..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png
deleted file mode 100644
index ede370d..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png
deleted file mode 100644
index 5f39f62..0000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png b/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png
deleted file mode 100644
index 9f7a132..0000000
--- a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png b/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png
deleted file mode 100644
index 9f7a132..0000000
--- a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png
deleted file mode 100644
index 6662eb1..0000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png
deleted file mode 100644
index dce220a..0000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index 746a3ea..0000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/tab_indicator_ab_holo.xml b/core/res/res/drawable/tab_indicator_ab_holo.xml
new file mode 100644
index 0000000..d8a5750
--- /dev/null
+++ b/core/res/res/drawable/tab_indicator_ab_holo.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Non focused states -->
+ <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@color/transparent" />
+ <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_holo" />
+
+ <!-- Focused states -->
+ <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/list_focused_holo" />
+ <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_focused_holo" />
+
+ <!-- Pressed -->
+ <!-- Non focused states -->
+ <item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/list_pressed_holo_dark" />
+ <item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_holo" />
+
+ <!-- Focused states -->
+ <item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_holo" />
+ <item android:state_focused="true" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_holo" />
+</selector>
diff --git a/core/res/res/layout/action_menu_layout.xml b/core/res/res/layout/action_menu_layout.xml
index 5696d87..c401fec 100644
--- a/core/res/res/layout/action_menu_layout.xml
+++ b/core/res/res/layout/action_menu_layout.xml
@@ -18,6 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:divider="?android:attr/dividerVertical"
+ android:divider="?android:attr/actionBarDivider"
android:dividerPadding="12dip"
android:gravity="center_vertical" />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index a40e24c..d0ab8b1 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3331,6 +3331,9 @@
<attr name="popupPromptView" format="reference" />
<!-- Gravity setting for positioning the currently selected item. -->
<attr name="gravity" />
+ <!-- Whether this spinner should mark child views as enabled/disabled when
+ the spinner itself is enabled/disabled. -->
+ <attr name="disableChildrenWhenDisabled" format="boolean" />
</declare-styleable>
<declare-styleable name="DatePicker">
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 48e8f1e..767cafe 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -166,6 +166,12 @@
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable
+ WiMAX interfaces. If the device doesn't want to support tethering over Wifi this
+ should be empty. An example would be "softap.*" -->
+ <string-array translatable="false" name="config_tether_wimax_regexs">
+ </string-array>
+
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
should be empty. -->
<string-array translatable="false" name="config_tether_bluetooth_regexs">
@@ -447,6 +453,11 @@
If unlock screen is disabled, the puk should be unlocked through Emergency Dialer -->
<bool name="config_enable_puk_unlock_screen">true</bool>
+ <!-- Enable emergency call when sim is locked or puk locked. Some countries/carriers do not
+ allow emergency calls to be placed without the IMSI, which is locked in the SIM.
+ If so, this should be set to 'false' in an overlay. -->
+ <bool name="config_enable_emergency_call_while_sim_locked">true</bool>
+
<!-- Control the behavior when the user long presses the home button.
0 - Nothing
1 - Recent apps dialog
@@ -718,4 +729,16 @@
<!-- Default network policy warning threshold, in megabytes. -->
<integer name="config_networkPolicyDefaultWarning">2048</integer>
+ <!-- Set and Unsets WiMAX -->
+ <bool name="config_wimaxEnabled">false</bool>
+ <!-- Location of the wimax framwork jar location -->
+ <string name="config_wimaxServiceJarLocation"></string>
+ <!-- Location of the wimax native library locaiton -->
+ <string name="config_wimaxNativeLibLocation"></string>
+ <!-- Name of the wimax manager class -->
+ <string name="config_wimaxManagerClassname"></string>
+ <!-- Name of the wimax service class -->
+ <string name="config_wimaxServiceClassname"></string>
+ <!-- Name of the wimax state tracker clas -->
+ <string name="config_wimaxStateTrackerClassname"></string>
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index a819173..c8ba26a 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/strings.xml
**
@@ -831,6 +831,12 @@
including personal or private information.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_anyCodecForPlayback">use any media decoder for playback</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permdesc_anyCodecForPlayback">Allows an application to use any installed
+ media decoder to decode for playback.</string>
+
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_diagnostic">read/write to resources owned by diag</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_diagnostic">Allows an application to read and write to
@@ -1362,6 +1368,12 @@
than the non-multicast mode.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_accessWimaxState">view WiMAX state</string>
+ <string name="permdesc_accessWimaxState">Allows an application to view
+ the information about the state of WiMAX.</string>
+ <string name="permlab_changeWimaxState">change WiMAX state</string>
+ <string name="permdesc_changeWimaxState">Allows an application to connect
+ to and disconnect from WiMAX network.</string>
<string name="permlab_bluetoothAdmin">bluetooth administration</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_bluetoothAdmin" product="tablet">Allows an application to configure
@@ -3353,4 +3365,13 @@
<!-- Delimeter used between each item in a textual list; for example "Alpha, Beta". [CHAR LIMIT=3] -->
<string name="list_delimeter">", "</string>
+ <!-- STK sending DTMF, SMS, USSD, SS -->
+ <string name="sending">Sending...</string>
+
+ <!-- STK launch Browser -->
+ <string name="launchBrowserDefault">Launch Browser?</string>
+
+ <!-- STK setup Call -->
+ <string name="SetupCallDefault">Accept Call?</string>
+
</resources>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 8d95d86e5..73e1a7c 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1798,6 +1798,7 @@
<item name="android:dropDownWidth">wrap_content</item>
<item name="android:popupPromptView">@android:layout/simple_dropdown_hint</item>
<item name="android:gravity">left|center_vertical</item>
+ <item name="android:disableChildrenWhenDisabled">true</item>
</style>
<style name="Widget.Holo.Spinner.DropDown">
@@ -1823,6 +1824,7 @@
</style>
<style name="Widget.Holo.Tab" parent="Widget.Holo.ActionBar.TabView">
+ <item name="android:background">@android:drawable/tab_indicator_holo</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:minWidth">80dip</item>
@@ -1910,7 +1912,7 @@
</style>
<style name="Widget.Holo.ActionBar.TabView" parent="Widget.ActionBar.TabView">
- <item name="android:background">@drawable/tab_indicator_holo</item>
+ <item name="android:background">@drawable/tab_indicator_ab_holo</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
</style>
@@ -2277,6 +2279,10 @@
</style>
<style name="Widget.Holo.Light.Tab" parent="Widget.Holo.Light.ActionBar.TabView">
+ <item name="android:background">@android:drawable/tab_indicator_holo</item>
+ <item name="android:layout_width">0dip</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:minWidth">80dip</item>
</style>
<style name="Widget.Holo.Light.ActionBar.TabBar" parent="Widget.Holo.ActionBar.TabBar">
diff --git a/core/tests/coretests/src/android/net/NetworkStatsTest.java b/core/tests/coretests/src/android/net/NetworkStatsTest.java
index b37eb46..098464f 100644
--- a/core/tests/coretests/src/android/net/NetworkStatsTest.java
+++ b/core/tests/coretests/src/android/net/NetworkStatsTest.java
@@ -294,6 +294,22 @@
assertValues(after, 1, TEST_IFACE, 101, SET_DEFAULT, 0xF00D, 128L, 8L, 0L, 0L, 0L);
}
+ public void testClone() throws Exception {
+ final NetworkStats original = new NetworkStats(TEST_START, 5)
+ .addValues(TEST_IFACE, 100, SET_DEFAULT, TAG_NONE, 128L, 8L, 0L, 2L, 20L)
+ .addValues(TEST_IFACE2, 100, SET_DEFAULT, TAG_NONE, 512L, 32L, 0L, 0L, 0L);
+
+ // make clone and mutate original
+ final NetworkStats clone = original.clone();
+ original.addValues(TEST_IFACE, 101, SET_DEFAULT, TAG_NONE, 128L, 8L, 0L, 0L, 0L);
+
+ assertEquals(3, original.size());
+ assertEquals(2, clone.size());
+
+ assertEquals(128L + 512L + 128L, original.getTotalBytes());
+ assertEquals(128L + 512L, clone.getTotalBytes());
+ }
+
private static void assertValues(NetworkStats stats, int index, String iface, int uid, int set,
int tag, long rxBytes, long rxPackets, long txBytes, long txPackets, long operations) {
final NetworkStats.Entry entry = stats.getValues(index, null);
diff --git a/data/sounds/AudioPackage5.mk b/data/sounds/AudioPackage5.mk
index 550f990..5961f06 100755
--- a/data/sounds/AudioPackage5.mk
+++ b/data/sounds/AudioPackage5.mk
@@ -20,6 +20,7 @@
$(LOCAL_PATH)/effects/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \
$(LOCAL_PATH)/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
$(LOCAL_PATH)/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
+ $(LOCAL_PATH)/effects/ogg/camera_focus.ogg:system/media/audio/ui/camera_focus.ogg \
$(LOCAL_PATH)/effects/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \
$(LOCAL_PATH)/effects/Dock.ogg:system/media/audio/ui/Dock.ogg \
$(LOCAL_PATH)/effects/Undock.ogg:system/media/audio/ui/Undock.ogg \
diff --git a/data/sounds/AudioPackage6.mk b/data/sounds/AudioPackage6.mk
index 610e821..d113a29 100755
--- a/data/sounds/AudioPackage6.mk
+++ b/data/sounds/AudioPackage6.mk
@@ -19,6 +19,7 @@
$(LOCAL_PATH)/effects/ogg/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \
$(LOCAL_PATH)/effects/ogg/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
$(LOCAL_PATH)/effects/ogg/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
+ $(LOCAL_PATH)/effects/ogg/camera_focus.ogg:system/media/audio/ui/camera_focus.ogg \
$(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \
$(LOCAL_PATH)/effects/ogg/Dock.ogg:system/media/audio/ui/Dock.ogg \
$(LOCAL_PATH)/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg \
diff --git a/data/sounds/AudioPackage7.mk b/data/sounds/AudioPackage7.mk
index 93e0fa0..6ae624e 100755
--- a/data/sounds/AudioPackage7.mk
+++ b/data/sounds/AudioPackage7.mk
@@ -21,6 +21,7 @@
$(LOCAL_PATH)/effects/ogg/KeypressReturn_120.ogg:system/media/audio/ui/KeypressReturn.ogg \
$(LOCAL_PATH)/effects/ogg/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
$(LOCAL_PATH)/effects/ogg/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
+ $(LOCAL_PATH)/effects/ogg/camera_focus.ogg:system/media/audio/ui/camera_focus.ogg \
$(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \
$(LOCAL_PATH)/effects/ogg/Dock.ogg:system/media/audio/ui/Dock.ogg \
$(LOCAL_PATH)/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg \
diff --git a/data/sounds/effects/ogg/camera_focus.ogg b/data/sounds/effects/ogg/camera_focus.ogg
new file mode 100644
index 0000000..0db2683
--- /dev/null
+++ b/data/sounds/effects/ogg/camera_focus.ogg
Binary files differ
diff --git a/docs/html/guide/developing/building/building-cmdline.jd b/docs/html/guide/developing/building/building-cmdline.jd
index d78a4f5..c43962a 100644
--- a/docs/html/guide/developing/building/building-cmdline.jd
+++ b/docs/html/guide/developing/building/building-cmdline.jd
@@ -365,7 +365,7 @@
<dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
runs the tests.</dd>
- <dt><code>ant emma debug installt test</code></dt>
+ <dt><code>ant emma debug install test</code></dt>
<dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
runs the tests with code coverage enabled.</dd>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index a3bb6d4..0338685 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -82,9 +82,17 @@
</a></li>
</ul>
</li>
- <li><a href="<?cs var:toroot ?>guide/topics/providers/content-providers.html">
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/providers/content-providers.html">
<span class="en">Content Providers</span>
- </a></li>
+ </a><span class="new">updated</span></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/calendar-provider.html">
+ <span class="en">Calendar Provider</span></a>
+ <span class="new">new!</span>
+ </li>
+ </ul>
+ </li>
<li><a href="<?cs var:toroot ?>guide/topics/intents/intents-filters.html">
<span class="en">Intents and Intent Filters</span>
</a></li>
diff --git a/docs/html/guide/topics/providers/calendar-provider.jd b/docs/html/guide/topics/providers/calendar-provider.jd
new file mode 100644
index 0000000..3ab5125
--- /dev/null
+++ b/docs/html/guide/topics/providers/calendar-provider.jd
@@ -0,0 +1,1185 @@
+page.title=Calendar Provider
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#overview">Basics</a></li>
+ <li><a href="#manifest">User Permissions</a></li>
+ <li><a href="#calendar">Calendars table</a>
+<ol>
+ <li><a href="#query">Querying a calendar</a></li>
+ <li><a href="#modify-calendar">Modifying a calendar</a></li>
+ <li><a href="#insert-calendar">Inserting a calendar</a></li>
+ </ol>
+ </li>
+ <li><a href="#events">Events table</a>
+<ol>
+ <li><a href="#add-event">Adding Events</a></li>
+ <li><a href="#update-event">Updating Events</a></li>
+ <li><a href="#delete-event">Deleting Events</a></li>
+ </ol>
+ </li>
+ <li><a href="#attendees">Attendees table</a>
+<ol>
+ <li><a href="#add-attendees">Adding Attendees</a></li>
+ </ol>
+ </li>
+ <li><a href="#reminders">Reminders table</a>
+<ol>
+ <li><a href="#add-reminders">Adding Reminders</a></li>
+ </ol>
+ </li>
+ <li><a href="#instances">Instances table</a>
+ <ol>
+ <li><a href="#query-instances">Querying the Instances table</a></li>
+ </ol></li>
+ <li><a href="#intents">Calendar Intents</a>
+ <ol>
+ <li><a href="#intent-insert">Using an intent to insert an event</a></li>
+ <li><a href="#intent-edit">Using an intent to edit an event</a></li>
+ <li><a href="#intent-view">Using intents to view calendar data</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#sync-adapter">Sync Adapters</a></li>
+</ol>
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.provider.CalendarContract.Calendars}</li>
+ <li>{@link android.provider.CalendarContract.Events}</li>
+ <li>{@link android.provider.CalendarContract.Attendees}</li>
+ <li>{@link android.provider.CalendarContract.Reminders}</li>
+ </ol>
+</div>
+</div>
+
+<p>The Calendar Provider is a repository for a user's calendar events. The
+Calendar Provider API allows you to perform query, insert, update, and delete
+operations on calendars, events, attendees, reminders, and so on.</p>
+
+
+<p>The Calender Provider API can be used by applications and sync adapters. The
+rules vary depending on what type of program is making the calls. This document
+focuses primarily on using the Calendar Provider API as an application. For
+a discussion of how sync adapters are different, see
+<a href="#sync-adapter">Sync Adapters</a>.</p>
+
+
+<p>Normally, to read or write calendar data, an application's manifest must
+include the proper permissions, described in <a href="#manifest">User
+Permissions</a>. To make performing common operations easier, the Calendar
+Provider offers a set of intents, as described in <a href="#intents">Calendar
+Intents</a>. These intents take users to the Calendar application to insert, view,
+and edit events. The user interacts with the Calendar application and then
+returns to the original application. Thus your application doesn't need to request permissions,
+nor does it need to provide a user interface to view or create events.</p>
+
+<h2 id="overview">Basics</h2>
+
+<p><a href="{@docRoot}guide/topics/providers/content-providers.html">Content providers</a> store data and make it accessible to
+applications. The content providers offered by the Android platform (including the Calendar Provider) typically expose data as a set of tables based on a
+relational database model, where each row is a record and each column is data of
+a particular type and meaning. Through the Calendar Provider API, applications
+and sync adapters can get read/write access to the database tables that hold a
+user's calendar data.</p>
+
+<p>Every content provider exposes a public URI (wrapped as a
+{@link android.net.Uri}
+object) that uniquely identifies its data set. A content provider that controls
+ multiple data sets (multiple tables) exposes a separate URI for each one. All
+URIs for providers begin with the string "content://". This
+identifies the data as being controlled by a content provider. The Calendar
+Provider defines constants for the URIs for each of its classes (tables). These
+URIs have the format <code><em><class></em>.CONTENT_URI</code>. For
+example, {@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.</p>
+
+<p>Figure 1 shows a graphical representation of the Calendar Provider data model. It shows the
+main tables and the fields that link them to each other.</p>
+
+<img src="{@docRoot}images/providers/datamodel.png" alt="Calendar Provider Data Model"/>
+<p class="img-caption"><strong>Figure 1.</strong> Calendar Provider data model.</p>
+
+<p>A user can have multiple calendars, and different calendars can be associated with different types of accounts (Google Calendar, Exchange, and so on).</p>
+
+<p>The {@link android.provider.CalendarContract} defines the data model of calendar and event related information. This data is stored in a number of tables, listed below.</p>
+
+<table>
+ <tr>
+ <th>Table (Class)</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><p>{@link android.provider.CalendarContract.Calendars}</p></td>
+
+ <td>This table holds
+the calendar-specific information. Each row in this table contains the details for
+a single calendar, such as the name, color, sync information, and so on.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Events}</td>
+
+ <td>This table holds the
+event-specific information. Each row in this table has the information for a single
+event—for example, event title, location, start time, end
+time, and so on. The event can occur one-time or can recur multiple times. Attendees,
+reminders, and extended properties are stored in separate tables.
+They each have an {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+that references the {@link android.provider.BaseColumns#_ID} in the Events table.</td>
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances}</td>
+
+ <td>This table holds the
+start and end time for each occurrence of an event. Each row in this table
+represents a single event occurrence. For one-time events there is a 1:1 mapping
+of instances to events. For recurring events, multiple rows are automatically
+ generated that correspond to multiple occurrences of that event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Attendees}</td>
+
+ <td>This table holds the
+event attendee (guest) information. Each row represents a single guest of an
+event. It specifies the type of guest and the guest's attendance response
+for the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Reminders}</td>
+
+ <td>This table holds the
+alert/notification data. Each row represents a single alert for an event. An
+event can have multiple reminders. The maximum number of reminders per event is
+specified in
+{@link android.provider.CalendarContract.CalendarColumns#MAX_REMINDERS},
+which is set by the sync adapter that
+owns the given calendar. Reminders are specified in minutes before the event
+and have a method that determines how the user will be alerted.</td>
+ </tr>
+
+</table>
+
+<p>The Calendar Provider API is designed to be flexible and powerful. At the
+same time, it's important to provide a good end user experience and
+protect the integrity of the calendar and its data. To this end, here are
+some things to keep in mind when using the API:</p>
+
+<ul>
+
+<li><strong>Inserting, updating, and viewing calendar events.</strong> To directly insert, modify, and read events from the Calendar Provider, you need the appropriate <a href="#manifest">permissions</a>. However, if you're not building a full-fledged calendar application or sync adapter, requesting these permissions isn't necessary. You can instead use intents supported by Android's Calendar application to hand off read and write operations to that application. When you use the intents, your application sends users to the Calendar application to perform the desired operation
+in a pre-filled form. After they're done, they're returned to your application.
+By designing your application to perform common operations through the Calendar,
+you provide users with a consistent, robust user interface. This is the
+recommended approach. For more information, see <a href="#intents">Calendar
+Intents</a>.</p>
+
+
+<li><strong>Sync adapters.</strong> A sync adapter synchronizes the calendar data
+on a user's device with another server or data source. In the
+{@link android.provider.CalendarContract.Calendars} and
+{@link android.provider.CalendarContract.Events} tables,
+there are columns that are reserved for the sync adapters to use.
+The provider and applications should not modify them. In fact, they are not
+visible unless they are accessed as a sync adapter. For more information about
+sync adapters, see <a href="#sync-adapter">Sync Adapters</a>.</li>
+
+</ul>
+
+
+<h2 id="manifest">User Permissions</h2>
+
+<p>To read calendar data, an application must include the {@link
+android.Manifest.permission#READ_CALENDAR} permission in its manifest file. It
+must include the {@link android.Manifest.permission#WRITE_CALENDAR} permission
+to delete, insert or update calendar data:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"...>
+ <uses-sdk android:minSdkVersion="14" />
+ <uses-permission android:name="android.permission.READ_CALENDAR" />
+ <uses-permission android:name="android.permission.WRITE_CALENDAR" />
+ ...
+</manifest>
+</pre>
+
+
+<h2 id="calendar">Calendars Table</h2>
+
+<p>The {@link android.provider.CalendarContract.Calendars} table contains details
+for individual calendars. The following
+Calendars columns are writable by both an application and a <a href="#sync-adapter">sync adapter</a>.
+For a full list of supported fields, see the
+{@link android.provider.CalendarContract.Calendars} reference.</p>
+<table>
+ <tr>
+ <th>Constant</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Calendars#NAME}</td>
+ <td>The name of the calendar.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Calendars#CALENDAR_DISPLAY_NAME}</td>
+ <td>The name of this calendar that is displayed to the user.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Calendars#VISIBLE}</td>
+
+ <td>A boolean indicating whether the calendar is selected to be displayed. A
+value of 0 indicates that events associated with this calendar should not be
+shown. A value of 1 indicates that events associated with this calendar should
+be shown. This value affects the generation of rows in the {@link
+android.provider.CalendarContract.Instances} table.</td>
+
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.CalendarColumns#SYNC_EVENTS}</td>
+
+ <td>A boolean indicating whether the calendar should be synced and have its
+events stored on the device. A value of 0 says do not sync this calendar or
+store its events on the device. A value of 1 says sync events for this calendar
+and store its events on the device.</td>
+ </tr>
+</table>
+
+<h3 id="query">Querying a calendar</h3>
+
+<p>Here is an example that shows how to get all the calendars for a particular
+user. For simplicity's sake, in this example the query operation is shown in the
+user interface thread ("main thread"). In practice, this should be done in an asynchronous
+thread instead of on the main thread. For more discussion, see
+<a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a>. If you are not just reading data but modifying it, see {@link android.content.AsyncQueryHandler}.
+</p>
+
+
+<pre>
+ // Projection array. Creating indices for this array instead of doing
+ // dynamic lookups improves performance.
+ public static final String[] EVENT_PROJECTION = new String[] {
+ Calendars._ID, // 0
+ Calendars.ACCOUNT_NAME, // 1
+ Calendars.CALENDAR_DISPLAY_NAME // 2
+ };
+
+ // The indices for the projection array above.
+ private static final int PROJECTION_ID_INDEX = 0;
+ private static final int PROJECTION_ACCOUNT_NAME_INDEX = 1;
+ private static final int PROJECTION_DISPLAY_NAME_INDEX = 2;</pre>
+
+
+<div class="sidebox-wrapper"> <div class="sidebox"> <h3>Why must you include
+ACCOUNT_TYPE?</h3> <p>If you query on a {@link
+android.provider.CalendarContract.Calendars#ACCOUNT_NAME
+Calendars.ACCOUNT_NAME}, you must also include
+{@link android.provider.CalendarContract.Calendars#ACCOUNT_TYPE Calendars.ACCOUNT_TYPE}
+in the selection. That is because a given account is
+only considered unique given both its <code>ACCOUNT_NAME</code> and its
+<code>ACCOUNT_TYPE</code>. The <code>ACCOUNT_TYPE</code> refers to the way that
+the account is being synced. It is often but not always the domain. For
+example, an account could be synced through a corporate pop3 sync adapter, in which
+case the <code>ACCOUNT_TYPE</code> would not be a domain. There is also a
+special type of account called {@link
+android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL} for calendars not
+associated with a device account. {@link
+android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL} accounts do not get
+synced.</p> </div> </div>
+
+
+<p> In the next part of the example, you construct your query. The selection
+specifies the criteria for the query. In this example the query is looking for
+all calendars that have the <code>ACCOUNT_NAME</code>
+"sampleuser@google.com" and the <code>ACCOUNT_TYPE</code>
+"com.google". The query returns a {@link android.database.Cursor}
+object that you can use to traverse the result set returned by the database
+query. For more discussion of using queries in content providers, see <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
+
+
+<pre>// Run query
+Cursor cur = null;
+ContentResolver cr = getContentResolver();
+Uri uri = Calendars.CONTENT_URI;
+String selection = "((" + Calendars.ACCOUNT_NAME + " = ?) AND ("
+ + Calendars.ACCOUNT_TYPE + " = ?))";
+String[] selectionArgs = new String[] {"sampleuser@gmail.com", "com.google"};
+// Submit the query and get a Cursor object back.
+cur = cr.query(uri, EVENT_PROJECTION, selection, selectionArgs, null);</pre>
+
+<p>This next section uses the cursor to step through the result set. It uses the
+constants that were set up at the beginning of the example to return the values
+for each field.</p>
+
+<pre>// Use the cursor to step through the returned records
+while (cur.moveToNext()) {
+ long calID = 0;
+ String displayName = null;
+ String accountName = null;
+
+ // Get the field values
+ calID = cur.getLong(PROJECTION_ID_INDEX);
+ displayName = cur.getString(PROJECTION_DISPLAY_NAME_INDEX);
+ accountName = cur.getString(PROJECTION_ACCOUNT_NAME_INDEX);
+
+ // Do something with the values...
+
+ ...
+}
+</pre>
+
+<h3 id="modify-calendar">Modifying a calendar</h3>
+
+<p>To perform an update of an calendar, you can provide the {@link
+android.provider.BaseColumns#_ID} of the calendar either as an appended ID to
+the Uri
+
+({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+or as the first selection item. The selection
+should start with <code>"_id=?"</code>, and the first
+<code>selectionArg</code> should be the {@link
+android.provider.BaseColumns#_ID} of the calendar.
+You can also do updates by encoding the ID in the URI. This example changes a
+calendar's display name using the
+({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+approach:</p>
+
+<pre>private static final String DEBUG_TAG = "MyActivity";
+...
+long calID = 2;
+ContentValues values = new ContentValues();
+// The new display name for the calendar
+values.put(Calendars.CALENDAR_DISPLAY_NAME, "Trevor's Calendar");
+Uri updateUri = ContentUris.withAppendedId(Calendars.CONTENT_URI, calID);
+int rows = getContentResolver().update(updateUri, values, null, null);
+Log.i(DEBUG_TAG, "Rows updated: " + rows);</pre>
+
+<h3 id="insert-calendar">Inserting a calendar</h2>
+
+<p>Calendars are designed to be primarily managed by a sync adapter, so you
+should only insert new calendars as a sync adapter. For the most part,
+applications can only make superficial changes to calendars, such as changing the display name. If
+an application needs to create a local calendar, it can do this by performing
+the calendar insertion as a sync adapter, using an {@link
+android.provider.CalendarContract.SyncColumns#ACCOUNT_TYPE} of {@link
+android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL}.
+{@link android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL}
+is a special account type for calendars that are not
+associated with a device account. Calendars of this type are not synced to a server. For a
+discussion of sync adapters, see <a href="#sync-adapter">Sync Adapters</a>.</p>
+
+<h2 id="events">Events Table</h2>
+
+<p>The {@link android.provider.CalendarContract.Events} table contains details
+for individual events. To add, update, or delete events, an application must
+include the {@link android.Manifest.permission#WRITE_CALENDAR} permission in its
+<a href="#manifest">manifest file</a>.</p>
+
+<p>The following Events columns are writable by both an application and a sync
+adapter. For a full list of supported fields, see the {@link
+android.provider.CalendarContract.Events} reference.</p>
+
+<table>
+ <tr>
+ <th>Constant</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#CALENDAR_ID}</td>
+ <td>The {@link android.provider.BaseColumns#_ID} of the calendar the event belongs to.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#ORGANIZER}</td>
+ <td>Email of the organizer (owner) of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#TITLE}</td>
+ <td>The title of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#EVENT_LOCATION}</td>
+ <td>Where the event takes place. </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#DESCRIPTION}</td>
+ <td>The description of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#DTSTART}</td>
+ <td>The time the event starts in UTC milliseconds since the epoch. </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#DTEND}</td>
+ <td>The time the event ends in UTC milliseconds since the epoch. </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#EVENT_TIMEZONE}</td>
+ <td>The time zone for the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#EVENT_END_TIMEZONE}</td>
+ <td>The time zone for the end time of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#DURATION}</td>
+
+ <td>The duration of the event in <a
+href="http://tools.ietf.org/html/rfc5545#section-3.8.2.5">RFC5545</a> format.
+For example, a value of <code>"PT1H"</code> states that the event
+should last one hour, and a value of <code>"P2W"</code> indicates a
+duration of 2 weeks. </td>
+
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#ALL_DAY}</td>
+
+ <td>A value of 1 indicates this event occupies the entire day, as defined by
+the local time zone. A value of 0 indicates it is a regular event that may start
+and end at any time during a day.</td>
+
+
+ </tr>
+
+
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#RRULE}</td>
+
+ <td>The recurrence rule for the event format. For
+example, <code>"FREQ=WEEKLY;COUNT=10;WKST=SU"</code>. You can find
+more examples <a
+href="http://tools.ietf.org/html/rfc5545#section-3.8.5.3">here</a>.</td>
+
+ </tr>
+
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#RDATE}</td>
+ <td>The recurrence dates for the event.
+ You typically use {@link android.provider.CalendarContract.EventsColumns#RDATE}
+ in conjunction with {@link android.provider.CalendarContract.EventsColumns#RRULE}
+ to define an aggregate set of
+repeating occurrences. For more discussion, see the <a
+href="http://tools.ietf.org/html/rfc5545#section-3.8.5.2">RFC5545 spec</a>.</td>
+</tr>
+
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY}</td>
+
+ <td>If this event counts as busy time or is free time that can be
+scheduled over. </td>
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#GUESTS_CAN_MODIFY}</td>
+ <td>Whether guests can modify the event. </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#GUESTS_CAN_INVITE_OTHERS}</td>
+ <td>Whether guests can invite other guests. </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#GUESTS_CAN_SEE_GUESTS}</td>
+ <td>Whether guests can see the list of attendees.</td>
+ </tr>
+</table>
+
+<h3 id="add-event">Adding Events</h3>
+
+<p>When your application inserts a new event, we recommend that you use an
+{@link android.content.Intent#ACTION_INSERT INSERT} Intent, as described in <a
+href="#intent-insert">Using an intent to insert an event</a>. However, if you
+need to, you can insert events directly. This section describes how to do
+this.</p>
+
+
+<p>Here are the rules for inserting a new event: </p>
+<ul>
+
+ <li>You must include {@link
+android.provider.CalendarContract.EventsColumns#CALENDAR_ID} and {@link
+android.provider.CalendarContract.EventsColumns#DTSTART}.</li>
+
+<li>You must include an {@link
+android.provider.CalendarContract.EventsColumns#EVENT_TIMEZONE}. To get a list
+of the system's installed time zone IDs, use {@link
+java.util.TimeZone#getAvailableIDs()}. Note that this rule does not apply if
+you're inserting an event through the {@link
+android.content.Intent#ACTION_INSERT INSERT} Intent, described in <a
+href="#intent-insert">Using an intent to insert an event</a>—in that
+scenario, a default time zone is supplied.</li>
+
+ <li>For non-recurring events, you must include {@link
+android.provider.CalendarContract.EventsColumns#DTEND}. </li>
+
+
+ <li>For recurring events, you must include a {@link
+android.provider.CalendarContract.EventsColumns#DURATION} in addition to {@link
+android.provider.CalendarContract.EventsColumns#RRULE} or {@link
+android.provider.CalendarContract.EventsColumns#RDATE}. Note that this rule does not apply if
+you're inserting an event through the {@link
+android.content.Intent#ACTION_INSERT INSERT} Intent, described in <a
+href="#intent-insert">Using an intent to insert an event</a>—in that
+scenario, you can use an {@link
+android.provider.CalendarContract.EventsColumns#RRULE} in conjunction with {@link android.provider.CalendarContract.EventsColumns#DTSTART} and {@link android.provider.CalendarContract.EventsColumns#DTEND}, and the Calendar application
+converts it to a duration automatically.</li>
+
+</ul>
+
+<p>Here is an example of inserting an event. This is being performed in the UI
+thread for simplicity. In practice, inserts and updates should be done in an
+asynchronous thread to move the action into a background thread. For more
+information, see {@link android.content.AsyncQueryHandler}.</p>
+
+
+<pre>
+long calID = 3;
+long startMillis = 0;
+long endMillis = 0;
+Calendar beginTime = Calendar.getInstance();
+beginTime.set(2012, 9, 14, 7, 30);
+startMillis = beginTime.getTimeInMillis();
+Calendar endTime = Calendar.getInstance();
+endTime.set(2012, 9, 14, 8, 45);
+endMillis = endTime.getTimeInMillis();
+...
+
+ContentResolver cr = getContentResolver();
+ContentValues values = new ContentValues();
+values.put(Events.DTSTART, startMillis);
+values.put(Events.DTEND, endMillis);
+values.put(Events.TITLE, "Jazzercise");
+values.put(Events.DESCRIPTION, "Group workout");
+values.put(Events.CALENDAR_ID, calID);
+values.put(Events.EVENT_TIMEZONE, "America/Los_Angeles");
+Uri uri = cr.insert(Events.CONTENT_URI, values);
+
+// get the event ID that is the last element in the Uri
+long eventID = Long.parseLong(uri.getLastPathSegment());
+//
+// ... do something with event ID
+//
+//</pre>
+
+<p class="note"><strong>Note:</strong> See how this example captures the event
+ID after the event is created. This is the easiest way to get an event ID. You often
+need the event ID to perform other calendar operations—for example, to add
+attendees or reminders to an event.</p>
+
+
+<h3 id="update-event">Updating Events</h3>
+
+<p>When your application wants to allow the user to edit an event, we recommend
+that you use an {@link android.content.Intent#ACTION_EDIT EDIT} Intent, as
+described in <a href="#intent-edit">Using an intent to edit an event</a>.
+However, if you need to, you can edit events directly. To perform an update of
+an Event, you can provide the <code>_ID</code> of the
+event either as an appended ID to the Uri ({@link
+android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+or as the first selection item.
+The selection should start with <code>"_id=?"</code>, and the first
+<code>selectionArg</code> should be the <code>_ID</code> of the event. You can
+also do updates using a selection with no ID. Here is an example of updating an
+event. It changes the title of the event using the
+{@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()}
+approach:</p>
+
+
+<pre>private static final String DEBUG_TAG = "MyActivity";
+...
+long eventID = 188;
+...
+ContentResolver cr = getContentResolver();
+ContentValues values = new ContentValues();
+Uri updateUri = null;
+// The new title for the event
+values.put(Events.TITLE, "Kickboxing");
+myUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
+int rows = getContentResolver().update(updateUri, values, null, null);
+Log.i(DEBUG_TAG, "Rows updated: " + rows); </pre>
+
+<h3 id="delete-event">Deleting Events</h3>
+
+<p>You can delete an event either by its {@link
+android.provider.BaseColumns#_ID} as an appended ID on the URI, or by using
+standard selection. If you use an appended ID, you can't also do a selection.
+There are two versions of delete: as an application and as a sync adapter. An
+application delete sets the <em>deleted</em> column to 1. This flag that tells
+the sync adapter that the row was deleted and that this deletion should be
+propagated to the server. A sync adapter delete removes the event from the
+database along with all its associated data. Here is an example of application
+deleting an event through its {@link android.provider.BaseColumns#_ID}:</p>
+
+
+<pre>private static final String DEBUG_TAG = "MyActivity";
+...
+long eventID = 201;
+...
+ContentResolver cr = getContentResolver();
+ContentValues values = new ContentValues();
+Uri deleteUri = null;
+deleteUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
+int rows = getContentResolver().delete(deleteUri, null, null);
+Log.i(DEBUG_TAG, "Rows deleted: " + rows);
+</pre>
+
+<h2 id="attendees">Attendees Table</h2>
+
+<p>Each row of the {@link android.provider.CalendarContract.Attendees} table
+represents a single attendee or guest of an event. Calling
+{@link android.provider.CalendarContract.Reminders#query(android.content.ContentResolver, long, java.lang.String[]) query()}
+returns a list of attendees for the
+event with the given {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}.
+This {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+must match the {@link
+android.provider.BaseColumns#_ID} of a particular event.</p>
+
+<p>The following table lists the
+writable fields. When inserting a new attendee, you must include all of them
+except <code>ATTENDEE_NAME</code>.
+</p>
+
+
+<table>
+ <tr>
+ <th>Constant</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}</td>
+ <td>The ID of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_NAME}</td>
+ <td>The name of the attendee.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_EMAIL}</td>
+ <td>The email address of the attendee.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_RELATIONSHIP}</td>
+ <td><p>The relationship of the attendee to the event. One of:</p>
+ <ul>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#RELATIONSHIP_ATTENDEE}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#RELATIONSHIP_NONE}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#RELATIONSHIP_ORGANIZER}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#RELATIONSHIP_PERFORMER}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#RELATIONSHIP_SPEAKER}</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_TYPE}</td>
+ <td><p>The type of attendee. One of: </p>
+ <ul>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#TYPE_REQUIRED}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#TYPE_OPTIONAL}</li>
+ </ul></td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS}</td>
+ <td><p>The attendance status of the attendee. One of:</p>
+ <ul>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS_ACCEPTED}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS_DECLINED}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS_INVITED}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS_NONE}</li>
+ <li>{@link android.provider.CalendarContract.AttendeesColumns#ATTENDEE_STATUS_TENTATIVE}</li>
+ </ul></td>
+ </tr>
+</table>
+
+<h3 id="add-attendees">Adding Attendees</h3>
+
+<p>Here is an example that adds a single attendee to an event. Note that the
+{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+is required:</p>
+
+<pre>
+long eventID = 202;
+...
+ContentResolver cr = getContentResolver();
+ContentValues values = new ContentValues();
+values.put(Attendees.ATTENDEE_NAME, "Trevor");
+values.put(Attendees.ATTENDEE_EMAIL, "trevor@example.com");
+values.put(Attendees.ATTENDEE_RELATIONSHIP, Attendees.RELATIONSHIP_ATTENDEE);
+values.put(Attendees.ATTENDEE_TYPE, Attendees.TYPE_OPTIONAL);
+values.put(Attendees.ATTENDEE_STATUS, Attendees.ATTENDEE_STATUS_INVITED);
+values.put(Attendees.EVENT_ID, eventID);
+Uri uri = cr.insert(Attendees.CONTENT_URI, values);
+</pre>
+
+<h2 id="reminders">Reminders Table</h2>
+
+<p>Each row of the {@link android.provider.CalendarContract.Reminders} table
+represents a single reminder for an event. Calling
+{@link android.provider.CalendarContract.Reminders#query(android.content.ContentResolver, long, java.lang.String[]) query()} returns a list of reminders for the
+event with the given
+{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}.</p>
+
+
+<p>The following table lists the writable fields for reminders. All of them must
+be included when inserting a new reminder. Note that sync adapters specify the
+types of reminders they support in the {@link
+android.provider.CalendarContract.Calendars} table. See
+{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_REMINDERS}
+for details.</p>
+
+
+<table>
+ <tr>
+ <th>Constant</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.RemindersColumns#EVENT_ID}</td>
+ <td>The ID of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.RemindersColumns#MINUTES}</td>
+ <td>The minutes prior to the event that the reminder should fire.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.RemindersColumns#METHOD}</td>
+ <td><p>The alarm method, as set on the server. One of:</p>
+ <ul>
+ <li>{@link android.provider.CalendarContract.RemindersColumns#METHOD_ALERT}</li>
+ <li>{@link android.provider.CalendarContract.RemindersColumns#METHOD_DEFAULT}</li>
+ <li>{@link android.provider.CalendarContract.RemindersColumns#METHOD_EMAIL}</li>
+ <li>{@link android.provider.CalendarContract.RemindersColumns#METHOD_SMS}</li>
+ </ul></td>
+ </tr>
+</table>
+
+<h3 id="add-reminders">Adding Reminders</h3>
+
+<p>This example adds a reminder to an event. The reminder fires 15
+minutes before the event.</p>
+<pre>
+long eventID = 221;
+...
+ContentResolver cr = getContentResolver();
+ContentValues values = new ContentValues();
+values.put(Reminders.MINUTES, 15);
+values.put(Reminders.EVENT_ID, eventID);
+values.put(Reminders.METHOD, Reminders.METHOD_ALERT);
+Uri uri = cr.insert(Reminders.CONTENT_URI, values);</pre>
+
+<h2 id="instances">Instances Table</h2>
+
+<p>The
+{@link android.provider.CalendarContract.Instances} table holds the
+start and end time for occurrences of an event. Each row in this table
+represents a single event occurrence. The instances table is not writable and only
+provides a way to query event occurrences. </p>
+
+<p>The following table lists some of the fields you can query on for an instance. Note
+that time zone is defined by
+{@link android.provider.CalendarContract.CalendarCache#KEY_TIMEZONE_TYPE}
+and
+{@link android.provider.CalendarContract.CalendarCache#KEY_TIMEZONE_INSTANCES}.</p>
+
+
+<table>
+ <tr>
+ <th>Constant</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#BEGIN}</td>
+ <td>The beginning time of the instance, in UTC milliseconds.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#END}</td>
+ <td>The ending time of the instance, in UTC milliseconds.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#END_DAY}</td>
+
+ <td>The Julian end day of the instance, relative to the Calendar's time
+zone.
+
+</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#END_MINUTE}</td>
+
+ <td>The end minute of the instance measured from midnight in the the
+Calendar's time zone.</td>
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#EVENT_ID}</td>
+ <td>The <code>_ID</code> of the event for this instance.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#START_DAY}</td>
+ <td>The Julian start day of the instance, relative to the Calendar's time zone.
+ </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.Instances#START_MINUTE}</td>
+
+ <td>The start minute of the instance measured from midnight, relative to the
+Calendar's time zone.
+</td>
+
+ </tr>
+
+</table>
+
+<h3 id="query-instances">Querying the Instances table</h3>
+
+<p>To query the Instances table, you need to specify a range time for the query
+in the URI. In this example, {@link android.provider.CalendarContract.Instances}
+gets access to the {@link
+android.provider.CalendarContract.EventsColumns#TITLE} field through its
+implementation of the {@link android.provider.CalendarContract.EventsColumns} interface.
+In other words, {@link
+android.provider.CalendarContract.EventsColumns#TITLE} is returned through a
+database view, not through querying the raw {@link
+android.provider.CalendarContract.Instances} table.</p>
+
+<pre>
+private static final String DEBUG_TAG = "MyActivity";
+public static final String[] INSTANCE_PROJECTION = new String[] {
+ Instances.EVENT_ID, // 0
+ Instances.BEGIN, // 1
+ Instances.TITLE // 2
+ };
+
+// The indices for the projection array above.
+private static final int PROJECTION_ID_INDEX = 0;
+private static final int PROJECTION_BEGIN_INDEX = 1;
+private static final int PROJECTION_TITLE_INDEX = 2;
+...
+
+// Specify the date range you want to search for recurring
+// event instances
+Calendar beginTime = Calendar.getInstance();
+beginTime.set(2011, 9, 23, 8, 0);
+long startMillis = beginTime.getTimeInMillis();
+Calendar endTime = Calendar.getInstance();
+endTime.set(2011, 10, 24, 8, 0);
+long endMillis = endTime.getTimeInMillis();
+
+Cursor cur = null;
+ContentResolver cr = getContentResolver();
+
+// The ID of the recurring event whose instances you are searching
+// for in the Instances table
+String selection = Instances.EVENT_ID + " = ?";
+String[] selectionArgs = new String[] {"207"};
+
+// Construct the query with the desired date range.
+Uri.Builder builder = Instances.CONTENT_URI.buildUpon();
+ContentUris.appendId(builder, startMillis);
+ContentUris.appendId(builder, endMillis);
+
+// Submit the query
+cur = cr.query(builder.build(),
+ INSTANCE_PROJECTION,
+ selection,
+ selectionArgs,
+ null);
+
+while (cur.moveToNext()) {
+ String title = null;
+ long eventID = 0;
+ long beginVal = 0;
+
+ // Get the field values
+ eventID = cur.getLong(PROJECTION_ID_INDEX);
+ beginVal = cur.getLong(PROJECTION_BEGIN_INDEX);
+ title = cur.getString(PROJECTION_TITLE_INDEX);
+
+ // Do something with the values.
+ Log.i(DEBUG_TAG, "Event: " + title);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTimeInMillis(beginVal);
+ DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
+ Log.i(DEBUG_TAG, "Date: " + formatter.format(calendar.getTime()));
+ }
+ }</pre>
+
+<h2 id="intents">Calendar Intents</h2>
+<p>Your application doesn't need <a href="#manifest">permissions</a> to read and write calendar data. It can instead use intents supported by Android's Calendar application to hand off read and write operations to that application. The following table lists the intents supported by the Calendar Provider:</p>
+<table>
+ <tr>
+ <th>Action</th>
+ <th>URI</th>
+
+ <th>Description</th>
+ <th>Extras</th>
+ </tr>
+ <tr>
+ <td><br>
+ {@link android.content.Intent#ACTION_VIEW VIEW} <br></td>
+ <td><p><code>content://com.android.calendar/time/<ms_since_epoch></code></p>
+ You can also refer to the URI with
+{@link android.provider.CalendarContract#CONTENT_URI CalendarContract.CONTENT_URI}.
+For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-view">Using intents to view calendar data</a>.
+
+ </td>
+ <td>Open calendar to the time specified by <code><ms_since_epoch></code>.</td>
+ <td>None.</td>
+ </tr>
+ <tr>
+ <td><p>{@link android.content.Intent#ACTION_VIEW VIEW} </p>
+
+ </td>
+ <td><p><code>content://com.android.calendar/events/<event_id></code></p>
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-view">Using intents to view calendar data</a>.
+
+ </td>
+ <td>View the event specified by <code><event_id></code>.</td>
+
+ <td>{@link android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME CalendarContract.EXTRA_EVENT_BEGIN_TIME}<br>
+ <br>
+ <br>
+ {@link android.provider.CalendarContract#EXTRA_EVENT_END_TIME CalendarContract.EXTRA_EVENT_END_TIME}</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.content.Intent#ACTION_EDIT EDIT} </td>
+ <td><p><code>content://com.android.calendar/events/<event_id></code></p>
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-edit">Using an intent to edit an event</a>.
+
+
+ </td>
+ <td>Edit the event specified by <code><event_id></code>.</td>
+
+ <td>{@link android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME CalendarContract.EXTRA_EVENT_BEGIN_TIME}<br>
+ <br>
+ <br>
+ {@link android.provider.CalendarContract#EXTRA_EVENT_END_TIME CalendarContract.EXTRA_EVENT_END_TIME}</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.content.Intent#ACTION_EDIT EDIT} <br>
+ <br>
+ {@link android.content.Intent#ACTION_INSERT INSERT} </td>
+ <td><p><code>content://com.android.calendar/events</code></p>
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-insert">Using an intent to insert an event</a>.
+
+ </td>
+
+ <td>Create an event.</td>
+ <td>Any of the extras listed in the table below.</td>
+ </tr>
+</table>
+
+<p>The following table lists the intent extras supported by the Calendar Provider:
+</p>
+<table>
+ <tr>
+ <th>Intent Extra</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#TITLE Events.TITLE}</td>
+ <td>Name for the event.</td>
+ </tr>
+ <tr>
+
+ <td>{@link android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME
+CalendarContract.EXTRA_EVENT_BEGIN_TIME}</td>
+ <td>Event begin time in milliseconds from the epoch.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract#EXTRA_EVENT_END_TIME
+CalendarContract.EXTRA_EVENT_END_TIME}</td>
+
+ <td>Event end time in milliseconds from the epoch.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract#EXTRA_EVENT_ALL_DAY
+CalendarContract.EXTRA_EVENT_ALL_DAY}</td>
+
+ <td>A boolean that indicates that an event is all day. Value can be
+<code>true</code> or <code>false</code>.</td> </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#EVENT_LOCATION
+Events.EVENT_LOCATION}</td>
+
+ <td>Location of the event.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#DESCRIPTION
+Events.DESCRIPTION}</td>
+
+ <td>Event description.</td>
+ </tr>
+ <tr>
+ <td>
+ {@link android.content.Intent#EXTRA_EMAIL Intent.EXTRA_EMAIL}</td>
+ <td>Email addresses of those to invite as a comma-separated list.</td>
+ </tr>
+ <tr>
+ <td>
+ {@link android.provider.CalendarContract.EventsColumns#RRULE Events.RRULE}</td>
+ <td>The recurrence rule for the event.</td>
+ </tr>
+ <tr>
+ <td>
+ {@link android.provider.CalendarContract.EventsColumns#ACCESS_LEVEL
+Events.ACCESS_LEVEL}</td>
+
+ <td>Whether the event is private or public.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY
+Events.AVAILABILITY}</td>
+
+ <td>If this event counts as busy time or is free time that can be scheduled over.</td>
+
+</table>
+<p>The following sections describe how to use these intents.</p>
+
+
+<h3 id="intent-insert">Using an intent to insert an event</h3>
+
+<p>Using the {@link android.content.Intent#ACTION_INSERT INSERT} Intent
+lets your application hand off the event insertion task to the Calendar itself.
+With this approach, your application doesn't even need to have the {@link
+android.Manifest.permission#WRITE_CALENDAR} permission included in its <a
+href="#manifest">manifest file</a>.</p>
+
+
+<p>When users run an application that uses this approach, the application sends
+them to the Calendar to finish adding the event. The {@link
+android.content.Intent#ACTION_INSERT INSERT} Intent uses extra fields to
+pre-populate a form with the details of the event in the Calendar. Users can
+then cancel the event, edit the form as needed, or save the event to their
+calendars.</p>
+
+
+
+<p>Here is a code snippet that schedules an event on January 19, 2012, that runs
+from 7:30 a.m. to 8:30 a.m. Note the following about this code snippet:</p>
+
+<ul>
+ <li>It specifies {@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}
+ as the Uri.</li>
+
+ <li>It uses the {@link
+android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME
+CalendarContract.EXTRA_EVENT_BEGIN_TIME} and {@link
+android.provider.CalendarContract#EXTRA_EVENT_END_TIME
+CalendarContract.EXTRA_EVENT_END_TIME} extra fields to pre-populate the form
+with the time of the event. The values for these times must be in UTC milliseconds
+from the epoch.</li>
+
+ <li>It uses the {@link android.content.Intent#EXTRA_EMAIL Intent.EXTRA_EMAIL}
+extra field to provide a comma-separated list of invitees, specified by email address.</li>
+
+</ul>
+<pre>
+Calendar beginTime = Calendar.getInstance();
+beginTime.set(2012, 0, 19, 7, 30);
+Calendar endTime = Calendar.getInstance();
+endTime.set(2012, 0, 19, 8, 30);
+Intent intent = new Intent(Intent.ACTION_INSERT)
+ .setData(Events.CONTENT_URI)
+ .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, beginTime.getTimeInMillis())
+ .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endTime.getTimeInMillis())
+ .putExtra(Events.TITLE, "Yoga")
+ .putExtra(Events.DESCRIPTION, "Group class")
+ .putExtra(Events.EVENT_LOCATION, "The gym")
+ .putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY)
+ .putExtra(Intent.EXTRA_EMAIL, "rowan@example.com,trevor@example.com");
+startActivity(intent);
+</pre>
+
+<h3 id="intent-edit">Using an intent to edit an event</h3>
+
+<p>You can update an event directly, as described in <a
+href="#update-event">Updating events</a>. But using the {@link
+android.content.Intent#ACTION_EDIT EDIT} Intent allows an application that
+doesn't have permission to hand off event editing to the Calendar application.
+When users finish editing their event in Calendar, they're returned to the
+original application.</p> <p>Here is an example of an intent that sets a new
+title for a specified event and lets users edit the event in the Calendar.</p>
+
+
+<pre>long eventID = 208;
+Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
+Intent intent = new Intent(Intent.ACTION_EDIT)
+ .setData(uri)
+ .putExtra(Events.TITLE, "My New Title");
+startActivity(intent);</pre>
+
+<h3 id="intent-view">Using intents to view calendar data</h3>
+<p>Calender Provider offers two different ways to use the {@link android.content.Intent#ACTION_VIEW VIEW} Intent:</p>
+<ul>
+ <li>To open the Calendar to a particular date.</li>
+ <li>To view an event.</li>
+
+</ul>
+<p>Here is an example that shows how to open the Calendar to a particular date:</p>
+<pre>// A date-time specified in milliseconds since the epoch.
+long startMillis;
+...
+Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();
+builder.appendPath("time");
+ContentUris.appendId(builder, startMillis);
+Intent intent = new Intent(Intent.ACTION_VIEW)
+ .setData(builder.build());
+startActivity(intent);</pre>
+
+<p>Here is an example that shows how to open an event for viewing:</p>
+<pre>long eventID = 208;
+...
+Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
+Intent intent = new Intent(Intent.ACTION_VIEW)
+ .setData(uri);
+startActivity(intent);
+</pre>
+
+
+<h2 id="sync-adapter">Sync Adapters</h2>
+
+
+<p>There are only minor differences in how an application and a sync adapter
+access the Calendar Provider:</p>
+
+<ul>
+ <li>A sync adapter needs to specify that it's a sync adapter by setting {@link android.provider.CalendarContract#CALLER_IS_SYNCADAPTER} to <code>true</code>.</li>
+
+
+ <li>A sync adapter needs to provide an {@link
+android.provider.CalendarContract.SyncColumns#ACCOUNT_NAME} and an {@link
+android.provider.CalendarContract.SyncColumns#ACCOUNT_TYPE} as query parameters in the URI. </li>
+
+ <li>A sync adapter has write access to more columns than an application or widget.
+ For example, an application can only modify a few characteristics of a calendar,
+ such as its name, display name, visibility setting, and whether the calendar is
+ synced. By comparison, a sync adapter can access not only those columns, but many others,
+ such as calendar color, time zone, access level, location, and so on.
+However, a sync adapter is restricted to the <code>ACCOUNT_NAME</code> and
+<code>ACCOUNT_TYPE</code> it specified.</li> </ul>
+
+<p>Here is a helper method you can use to return a URI for use with a sync adapter:</p>
+<pre> static Uri asSyncAdapter(Uri uri, String account, String accountType) {
+ return uri.buildUpon()
+ .appendQueryParameter(android.provider.CalendarContract.CALLER_IS_SYNCADAPTER,"true")
+ .appendQueryParameter(Calendars.ACCOUNT_NAME, account)
+ .appendQueryParameter(Calendars.ACCOUNT_TYPE, accountType).build();
+ }
+</pre>
+<p>For a sample implementation of a sync adapter (not specifically related to Calendar), see
+<a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">SampleSyncAdapter</a>.
+</body>
+</html>
diff --git a/docs/html/guide/topics/providers/content-providers.jd b/docs/html/guide/topics/providers/content-providers.jd
index 513886a..95331ce 100644
--- a/docs/html/guide/topics/providers/content-providers.jd
+++ b/docs/html/guide/topics/providers/content-providers.jd
@@ -19,6 +19,11 @@
<li>{@link android.content.ContentResolver}</li>
<li>{@link android.database.Cursor}</li>
</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar Provider</a></li>
+</ol>
</div>
</div>
@@ -36,6 +41,10 @@
for some, you must acquire the proper permission to read the data).
</p>
+<p class="note"><strong>Note:</strong> Android 4.0 introduces the Calendar
+Provider. For more information, see <a
+href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
+Provider</a>.</p>
<p>
If you want to make your own data public, you have two options: You can
create your own content provider (a {@link android.content.ContentProvider}
diff --git a/docs/html/guide/topics/resources/drawable-resource.jd b/docs/html/guide/topics/resources/drawable-resource.jd
index fdf6c5a..80de9f9 100644
--- a/docs/html/guide/topics/resources/drawable-resource.jd
+++ b/docs/html/guide/topics/resources/drawable-resource.jd
@@ -646,6 +646,7 @@
android:state_checkable=["true" | "false"]
android:state_checked=["true" | "false"]
android:state_enabled=["true" | "false"]
+ android:state_activated=["true" | "false"]
android:state_window_focused=["true" | "false"] />
</selector>
</pre>
@@ -690,8 +691,8 @@
<dd><em>Boolean</em>. "true" if this item should be used when the object is pressed (such as when a button
is touched/clicked); "false" if this item should be used in the default, non-pressed state.</dd>
<dt><code>android:state_focused</code></dt>
- <dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button
-is highlighted using the trackball/d-pad); "false" if this item should be used in the default,
+ <dd><em>Boolean</em>. "true" if this item should be used when the object has input focus
+(such as when the user selects a text input); "false" if this item should be used in the default,
non-focused state.</dd>
<dt><code>android:state_hovered</code></dt>
<dd><em>Boolean</em>. "true" if this item should be used when the object is being hovered
@@ -699,8 +700,11 @@
drawable may be the same drawable used for the "focused" state.
<p>Introduced in API level 14.</p></dd>
<dt><code>android:state_selected</code></dt>
- <dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a
-tab is opened); "false" if this item should be used when the object is not selected.</dd>
+ <dd><em>Boolean</em>. "true" if this item should be used when the object is the current
+user selection when navigating with a directional control (such as when navigating through a list
+with a d-pad); "false" if this item should be used when the object is not selected.
+<p>The selected state is used when focus (<code>android:state_focused</code>) is not sufficient
+(such as when list view has focus and an item within it is selected with a d-pad).</p></dd>
<dt><code>android:state_checkable</code></dt>
<dd><em>Boolean</em>. "true" if this item should be used when the object is checkable; "false" if this
item should be used when the object is not checkable. (Only useful if the object can
@@ -709,8 +713,14 @@
<dd><em>Boolean</em>. "true" if this item should be used when the object is checked; "false" if it
should be used when the object is un-checked.</dd>
<dt><code>android:state_enabled</code></dt>
- <dd><em>Boolean</em>. "true" if this item should be used when the object is enabled (capable of
-receiving touch/click events); "false" if it should be used when the object is disabled.</dd>
+ <dd><em>Boolean</em>. "true" if this item should be used when the object is enabled
+(capable of receiving touch/click events); "false" if it should be used when the object is
+disabled.</dd>
+ <dt><code>android:state_activated</code></dt>
+ <dd><em>Boolean</em>. "true" if this item should be used when the object is activated as
+the persistent selection (such as to "highlight" the previously selected list item in a persistent
+navigation view); "false" if it should be used when the object is not activated.
+<p>Introduced in API level 11.</p></dd>
<dt><code>android:state_window_focused</code></dt>
<dd><em>Boolean</em>. "true" if this item should be used when the application window has focus (the
application is in the foreground), "false" if this item should be used when the application
diff --git a/docs/html/images/providers/datamodel.graffle b/docs/html/images/providers/datamodel.graffle
new file mode 100644
index 0000000..f8d730f
--- /dev/null
+++ b/docs/html/images/providers/datamodel.graffle
@@ -0,0 +1,2029 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ActiveLayerIndex</key>
+ <integer>0</integer>
+ <key>ApplicationVersion</key>
+ <array>
+ <string>com.omnigroup.OmniGrafflePro</string>
+ <string>138.9.0.117994</string>
+ </array>
+ <key>AutoAdjust</key>
+ <true/>
+ <key>BackgroundGraphic</key>
+ <dict>
+ <key>Bounds</key>
+ <string>{{0, 0}, {576, 733}}</string>
+ <key>Class</key>
+ <string>SolidGraphic</string>
+ <key>ID</key>
+ <integer>2</integer>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>CanvasOrigin</key>
+ <string>{0, 0}</string>
+ <key>ColumnAlign</key>
+ <integer>1</integer>
+ <key>ColumnSpacing</key>
+ <real>36</real>
+ <key>CreationDate</key>
+ <string>2011-10-12 11:34:15 -0700</string>
+ <key>Creator</key>
+ <string>Katie McCormick</string>
+ <key>DisplayScale</key>
+ <string>1 0/72 in = 1.0000 in</string>
+ <key>GraphDocumentVersion</key>
+ <integer>6</integer>
+ <key>GraphicsList</key>
+ <array>
+ <dict>
+ <key>Bounds</key>
+ <string>{{249.63, 336.648}, {140.426, 27.9745}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>29</integer>
+ <key>Line</key>
+ <dict>
+ <key>ID</key>
+ <integer>169</integer>
+ <key>Position</key>
+ <real>0.33598536252975464</real>
+ <key>RotationType</key>
+ <integer>0</integer>
+ </dict>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Width</key>
+ <real>0.0</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf0 \
+Reminders.EVENT_ID\
+}</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{248.834, 121}, {145.338, 27.9745}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>28</integer>
+ <key>Line</key>
+ <dict>
+ <key>ID</key>
+ <integer>15</integer>
+ <key>Position</key>
+ <real>0.49666976928710938</real>
+ <key>RotationType</key>
+ <integer>0</integer>
+ </dict>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Width</key>
+ <real>0.0</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf0 \
+Events.CALENDAR_ID\
+}</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>Head</key>
+ <dict>
+ <key>ID</key>
+ <integer>157</integer>
+ <key>Info</key>
+ <integer>5</integer>
+ </dict>
+ <key>ID</key>
+ <integer>170</integer>
+ <key>Points</key>
+ <array>
+ <string>{188.253, 404}</string>
+ <string>{321.503, 245.17}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Cap</key>
+ <integer>0</integer>
+ <key>HeadArrow</key>
+ <string>0</string>
+ <key>Join</key>
+ <integer>0</integer>
+ <key>TailArrow</key>
+ <string>CrowBall</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>165</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>Head</key>
+ <dict>
+ <key>ID</key>
+ <integer>157</integer>
+ </dict>
+ <key>ID</key>
+ <integer>169</integer>
+ <key>Points</key>
+ <array>
+ <string>{319.003, 404}</string>
+ <string>{321.503, 245.17}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Cap</key>
+ <integer>0</integer>
+ <key>HeadArrow</key>
+ <string>0</string>
+ <key>Join</key>
+ <integer>0</integer>
+ <key>TailArrow</key>
+ <string>CrowBall</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>166</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>Head</key>
+ <dict>
+ <key>ID</key>
+ <integer>157</integer>
+ <key>Info</key>
+ <integer>5</integer>
+ </dict>
+ <key>ID</key>
+ <integer>168</integer>
+ <key>Points</key>
+ <array>
+ <string>{450.042, 404}</string>
+ <string>{321.503, 245.17}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Cap</key>
+ <integer>0</integer>
+ <key>HeadArrow</key>
+ <string>0</string>
+ <key>Join</key>
+ <integer>0</integer>
+ <key>TailArrow</key>
+ <string>CrowBall</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>167</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>Head</key>
+ <dict>
+ <key>ID</key>
+ <integer>155</integer>
+ </dict>
+ <key>ID</key>
+ <integer>15</integer>
+ <key>Points</key>
+ <array>
+ <string>{321.503, 195}</string>
+ <string>{321.503, 74.1697}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Cap</key>
+ <integer>0</integer>
+ <key>HeadArrow</key>
+ <string>0</string>
+ <key>Join</key>
+ <integer>0</integer>
+ <key>TailArrow</key>
+ <string>CrowBall</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>157</integer>
+ <key>Info</key>
+ <integer>6</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{281.41, 24}, {80.1852, 50.1697}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>Helvetica-Bold</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>155</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{1, 1}</string>
+ <string>{1, -1}</string>
+ <string>{-1, -1}</string>
+ <string>{-1, 1}</string>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ <string>{-0.5, -0.233518}</string>
+ <string>{-0.491442, 0.260063}</string>
+ <string>{0.507118, -0.224086}</string>
+ <string>{0.507118, 0.267179}</string>
+ <string>{-0.27431, -0.474028}</string>
+ <string>{0.27978, -0.478478}</string>
+ <string>{0.293938, 0.543044}</string>
+ <string>{-0.286232, 0.553804}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.938075</string>
+ <key>g</key>
+ <string>0.938269</string>
+ <key>r</key>
+ <string>0.938154</string>
+ </dict>
+ <key>FillType</key>
+ <integer>2</integer>
+ <key>GradientAngle</key>
+ <real>90</real>
+ <key>GradientColor</key>
+ <dict>
+ <key>b</key>
+ <string>0.727869</string>
+ <key>g</key>
+ <string>0.728019</string>
+ <key>r</key>
+ <string>0.72793</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.35</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Fuzziness</key>
+ <real>2.3972222805023193</real>
+ <key>ShadowVector</key>
+ <string>{0, 1}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.472997</string>
+ <key>g</key>
+ <string>0.473094</string>
+ <key>r</key>
+ <string>0.473036</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Calendars}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{433, 404}, {80.1852, 50.1697}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>1</string>
+ <key>g</key>
+ <string>1</string>
+ <key>r</key>
+ <string>1</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>167</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{1, 1}</string>
+ <string>{1, -1}</string>
+ <string>{-1, -1}</string>
+ <string>{-1, 1}</string>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ <string>{-0.5, -0.233518}</string>
+ <string>{-0.491442, 0.260063}</string>
+ <string>{0.507118, -0.224086}</string>
+ <string>{0.507118, 0.267179}</string>
+ <string>{-0.27431, -0.474028}</string>
+ <string>{0.27978, -0.478478}</string>
+ <string>{0.293938, 0.543044}</string>
+ <string>{-0.286232, 0.553804}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.937525</string>
+ <key>g</key>
+ <string>0.489708</string>
+ <key>r</key>
+ <string>0.223421</string>
+ </dict>
+ <key>FillType</key>
+ <integer>2</integer>
+ <key>GradientAngle</key>
+ <real>90</real>
+ <key>GradientColor</key>
+ <dict>
+ <key>b</key>
+ <string>0.905866</string>
+ <key>g</key>
+ <string>0.149816</string>
+ <key>r</key>
+ <string>0.119797</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.35</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Fuzziness</key>
+ <real>2.3972222805023193</real>
+ <key>ShadowVector</key>
+ <string>{1, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.461178</string>
+ <key>g</key>
+ <string>0.0874307</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Width</key>
+ <real>2</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf1 Instances}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{278.91, 404}, {80.1852, 50.1697}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>1</string>
+ <key>g</key>
+ <string>1</string>
+ <key>r</key>
+ <string>1</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>166</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{1, 1}</string>
+ <string>{1, -1}</string>
+ <string>{-1, -1}</string>
+ <string>{-1, 1}</string>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ <string>{-0.5, -0.233518}</string>
+ <string>{-0.491442, 0.260063}</string>
+ <string>{0.507118, -0.224086}</string>
+ <string>{0.507118, 0.267179}</string>
+ <string>{-0.27431, -0.474028}</string>
+ <string>{0.27978, -0.478478}</string>
+ <string>{0.293938, 0.543044}</string>
+ <string>{-0.286232, 0.553804}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.937525</string>
+ <key>g</key>
+ <string>0.489708</string>
+ <key>r</key>
+ <string>0.223421</string>
+ </dict>
+ <key>FillType</key>
+ <integer>2</integer>
+ <key>GradientAngle</key>
+ <real>90</real>
+ <key>GradientColor</key>
+ <dict>
+ <key>b</key>
+ <string>0.905866</string>
+ <key>g</key>
+ <string>0.149816</string>
+ <key>r</key>
+ <string>0.119797</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.35</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Fuzziness</key>
+ <real>2.3972222805023193</real>
+ <key>ShadowVector</key>
+ <string>{1, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.461178</string>
+ <key>g</key>
+ <string>0.0874307</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Width</key>
+ <real>2</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf1 Reminders}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{281.41, 195}, {80.1852, 50.1697}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>157</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{1, 1}</string>
+ <string>{1, -1}</string>
+ <string>{-1, -1}</string>
+ <string>{-1, 1}</string>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ <string>{-0.5, -0.233518}</string>
+ <string>{-0.491442, 0.260063}</string>
+ <string>{0.507118, -0.224086}</string>
+ <string>{0.507118, 0.267179}</string>
+ <string>{-0.27431, -0.474028}</string>
+ <string>{0.27978, -0.478478}</string>
+ <string>{0.293938, 0.543044}</string>
+ <string>{-0.286232, 0.553804}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>1</string>
+ <key>g</key>
+ <string>0.874135</string>
+ <key>r</key>
+ <string>0.71718</string>
+ </dict>
+ <key>FillType</key>
+ <integer>2</integer>
+ <key>GradientAngle</key>
+ <real>90</real>
+ <key>GradientColor</key>
+ <dict>
+ <key>b</key>
+ <string>1</string>
+ <key>g</key>
+ <string>0.662438</string>
+ <key>r</key>
+ <string>0.464468</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.35</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Fuzziness</key>
+ <real>2.3972222805023193</real>
+ <key>ShadowVector</key>
+ <string>{0, 1}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.93512</string>
+ <key>g</key>
+ <string>0.472602</string>
+ <key>r</key>
+ <string>0.333854</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Events}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{124.821, 404}, {80.1852, 50.1697}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>1</string>
+ <key>g</key>
+ <string>1</string>
+ <key>r</key>
+ <string>1</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>165</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{1, 1}</string>
+ <string>{1, -1}</string>
+ <string>{-1, -1}</string>
+ <string>{-1, 1}</string>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ <string>{-0.5, -0.233518}</string>
+ <string>{-0.491442, 0.260063}</string>
+ <string>{0.507118, -0.224086}</string>
+ <string>{0.507118, 0.267179}</string>
+ <string>{-0.27431, -0.474028}</string>
+ <string>{0.27978, -0.478478}</string>
+ <string>{0.293938, 0.543044}</string>
+ <string>{-0.286232, 0.553804}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.937525</string>
+ <key>g</key>
+ <string>0.489708</string>
+ <key>r</key>
+ <string>0.223421</string>
+ </dict>
+ <key>FillType</key>
+ <integer>2</integer>
+ <key>GradientAngle</key>
+ <real>90</real>
+ <key>GradientColor</key>
+ <dict>
+ <key>b</key>
+ <string>0.905866</string>
+ <key>g</key>
+ <string>0.149816</string>
+ <key>r</key>
+ <string>0.119797</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.35</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Fuzziness</key>
+ <real>2.3972222805023193</real>
+ <key>ShadowVector</key>
+ <string>{1, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.461178</string>
+ <key>g</key>
+ <string>0.0874307</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Width</key>
+ <real>2</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf1 Attendees}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{383, 317.03}, {150.288, 18.4565}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>22</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Pad</key>
+ <integer>0</integer>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf0 Instances.EVENT_ID}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ <key>Wrap</key>
+ <string>NO</string>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{107, 317.03}, {154.243, 18.4565}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>20</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Pad</key>
+ <integer>0</integer>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf0 Attendees.EVENT_ID}</string>
+ <key>VerticalPad</key>
+ <integer>0</integer>
+ </dict>
+ <key>Wrap</key>
+ <string>NO</string>
+ </dict>
+ </array>
+ <key>GridInfo</key>
+ <dict>
+ <key>ShowsGrid</key>
+ <string>YES</string>
+ </dict>
+ <key>GuidesLocked</key>
+ <string>NO</string>
+ <key>GuidesVisible</key>
+ <string>YES</string>
+ <key>HPages</key>
+ <integer>1</integer>
+ <key>ImageCounter</key>
+ <integer>1</integer>
+ <key>KeepToScale</key>
+ <false/>
+ <key>Layers</key>
+ <array>
+ <dict>
+ <key>Lock</key>
+ <string>NO</string>
+ <key>Name</key>
+ <string>Layer 1</string>
+ <key>Print</key>
+ <string>YES</string>
+ <key>View</key>
+ <string>YES</string>
+ </dict>
+ </array>
+ <key>LayoutInfo</key>
+ <dict>
+ <key>Animate</key>
+ <string>NO</string>
+ <key>circoMinDist</key>
+ <real>18</real>
+ <key>circoSeparation</key>
+ <real>0.0</real>
+ <key>layoutEngine</key>
+ <string>dot</string>
+ <key>neatoSeparation</key>
+ <real>0.0</real>
+ <key>twopiSeparation</key>
+ <real>0.0</real>
+ </dict>
+ <key>LinksVisible</key>
+ <string>NO</string>
+ <key>MagnetsVisible</key>
+ <string>NO</string>
+ <key>MasterSheets</key>
+ <array/>
+ <key>ModificationDate</key>
+ <string>2011-10-20 15:09:11 -0700</string>
+ <key>Modifier</key>
+ <string>Katie McCormick</string>
+ <key>NotesVisible</key>
+ <string>NO</string>
+ <key>Orientation</key>
+ <integer>2</integer>
+ <key>OriginVisible</key>
+ <string>NO</string>
+ <key>PageBreaks</key>
+ <string>YES</string>
+ <key>PrintInfo</key>
+ <dict>
+ <key>NSBottomMargin</key>
+ <array>
+ <string>float</string>
+ <string>41</string>
+ </array>
+ <key>NSLeftMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSPaperSize</key>
+ <array>
+ <string>size</string>
+ <string>{612, 792}</string>
+ </array>
+ <key>NSRightMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSTopMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ </dict>
+ <key>PrintOnePage</key>
+ <false/>
+ <key>QuickLookPreview</key>
+ <data>
+ JVBERi0xLjMKJcTl8uXrp/Og0MTGCjUgMCBvYmoKPDwgL0xlbmd0aCA2IDAgUiAvRmls
+ dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGNmU1vHMkNhu/9K+poHdyu7+o6OloH
+ WCMIspawOQRBYIy1sAzJjiXFvz8P66tLo5HWMAxNs6s4JOsl+Rbnu/pNfVeafyFFlZxT
+ d1fqn+qrenN+b9ThXpny7/6gXus1KPk/LfxDvfnH1d3h6r8P//t4s9xdo2pLTZsy1q7e
+ uqhscqvLyarDrXrz661Rv3wr35pNWRoNK+KqjbPKb6YsXepS25fuWmVpkKXPad2XeqfX
+ qO02ljatLxkQg51tbQYQDKy/x1wC8ebD1c3Hh+sfV+ffbr7dXd9ePdxdH6rz1aHXxGzz
+ q7EmKK/jmrzZxPe/XBKT4vJr/r4O24px4rS6JDB/Nasm1pd/LP9Sr94+nBFrq171v1dn
+ cgAIvvYPn/qH8Wp8uF/b7ne/v/v72VI3XjbZf/q+X5vglzP1b3X5Xr27LKcyfPAYaLyf
+ XViOXYhr3LLHzccuKFzo6ofB992Xj9WCZffl8Izpzec/M30ppguQjU2rs3pTzmagequs
+ NmvQsT3f8OxWE21uAqt9e42vIeZlFwAzdWB9XWA3cOG0U6Kii4BXcmHXaVOui9q3LkNw
+ 2C0bshtkYY3RZQDaNhrrq/12a8q7ZBkWiK6xqln1M5J93+KseCcGNE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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ </data>
+ <key>ReadOnly</key>
+ <string>NO</string>
+ <key>RowAlign</key>
+ <integer>1</integer>
+ <key>RowSpacing</key>
+ <real>36</real>
+ <key>SheetTitle</key>
+ <string>Canvas 1</string>
+ <key>SmartAlignmentGuidesActive</key>
+ <string>YES</string>
+ <key>SmartDistanceGuidesActive</key>
+ <string>YES</string>
+ <key>UniqueID</key>
+ <integer>1</integer>
+ <key>UseEntirePage</key>
+ <false/>
+ <key>VPages</key>
+ <integer>1</integer>
+ <key>WindowInfo</key>
+ <dict>
+ <key>CurrentSheet</key>
+ <integer>0</integer>
+ <key>ExpandedCanvases</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>Canvas 1</string>
+ </dict>
+ </array>
+ <key>Frame</key>
+ <string>{{34, 76}, {710, 887}}</string>
+ <key>ListView</key>
+ <true/>
+ <key>OutlineWidth</key>
+ <integer>142</integer>
+ <key>RightSidebar</key>
+ <false/>
+ <key>ShowRuler</key>
+ <true/>
+ <key>Sidebar</key>
+ <true/>
+ <key>SidebarWidth</key>
+ <integer>120</integer>
+ <key>VisibleRegion</key>
+ <string>{{0, 0}, {575, 733}}</string>
+ <key>Zoom</key>
+ <real>1</real>
+ <key>ZoomValues</key>
+ <array>
+ <array>
+ <string>Canvas 1</string>
+ <real>1</real>
+ <real>1</real>
+ </array>
+ </array>
+ </dict>
+ <key>saveQuickLookFiles</key>
+ <string>YES</string>
+</dict>
+</plist>
diff --git a/docs/html/images/providers/datamodel.png b/docs/html/images/providers/datamodel.png
new file mode 100644
index 0000000..a14c328
--- /dev/null
+++ b/docs/html/images/providers/datamodel.png
Binary files differ
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
index 237e18c..41a5a51 100644
--- a/docs/html/resources/resources-data.js
+++ b/docs/html/resources/resources-data.js
@@ -578,7 +578,7 @@
}
},
{
- tags: ['sample', 'newfeature', 'performance', 'gamedev', 'gl'],
+ tags: ['sample', 'newfeature', 'performance', 'gamedev', 'gl', 'updated'],
path: 'samples/RenderScript/index.html',
title: {
en: 'RenderScript'
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
index f87e1f6..afbad57 100644
--- a/docs/html/sdk/ndk/index.jd
+++ b/docs/html/sdk/ndk/index.jd
@@ -1,18 +1,19 @@
ndk=true
-ndk.win_download=android-ndk-r6b-windows.zip
-ndk.win_bytes=67670219
-ndk.win_checksum=f496b48fffb6d341303de170a081b812
+ndk.win_download=android-ndk-r7-windows.zip
+ndk.win_bytes=81270552
+ndk.win_checksum=55483482cf2b75e8dd1a5d9a7caeb6e5
-ndk.mac_download=android-ndk-r6b-darwin-x86.tar.bz2
-ndk.mac_bytes=52798843
-ndk.mac_checksum=65f2589ac1b08aabe3183f9ed1a8ce8e
+ndk.mac_download=android-ndk-r7-darwin-x86.tar.bz2
+ndk.mac_bytes=71262092
+ndk.mac_checksum=817ca5675a1dd44078098e43070f19b6
-ndk.linux_download=android-ndk-r6b-linux-x86.tar.bz2
-ndk.linux_bytes=46532436
-ndk.linux_checksum=309f35e49b64313cfb20ac428df4cec2
+ndk.linux_download=android-ndk-r7-linux-x86.tar.bz2
+ndk.linux_bytes=64884365
+ndk.linux_checksum=bf15e6b47bf50824c4b96849bf003ca3
page.title=Android NDK
+
@jd:body
<h2 id="notes">Revisions</h2>
@@ -61,6 +62,310 @@
<div class="toggleable open">
<a href="#" onclick="return toggleDiv(this)"><img src=
"{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px">
+ Android NDK, Revision 7</a> <em>(November 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes new features to support the Android 4.0 platform as well
+ as many other additions and improvements:</p>
+
+ <dl>
+ <dt>New features</dt>
+
+ <dd>
+ <ul>
+ <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following
+ native features to the platform:
+
+ <ul>
+ <li>Added native multimedia API based on the Khronos Group OpenMAX AL™ 1.0.1
+ standard. The new <code><OMXAL/OpenMAXAL.h></code> and
+ <code><OMXAL/OpenMAXAL_Android.h></code> headers allow applications targeting
+ API level 14 to perform multimedia output directly from native code by using a new
+ Android-specific buffer queue interface. For more details, see
+ <code>docs/openmaxal/index.html</code> and <a href=
+ "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li>
+
+ <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1™
+ standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC,
+ Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and
+ <a href=
+ "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li>
+ </ul>
+ </li>
+
+ <li>Added CCache support. To speed up large rebuilds, define the
+ <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to
+ your <code>ccache</code> binary). When declared, the NDK build system automatically
+ uses CCache when compiling any source file. For example:
+ <pre>
+export NDK_CCACHE=ccache
+</pre>
+ <p class="note"><strong>Note:</strong> CCache is not included in the NDK release
+ so you must have it installed prior to using it. For more information about CCache, see
+ <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p>
+ </li>
+
+ <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that
+ you want to build your NDK modules for all the ABIs supported by your given NDK
+ release. This means that either one of the following two lines in your
+ <code>Application.mk</code> are equivalent with this release:
+ <pre>
+APP_ABI := all
+APP_ABI := armeabi armeabi-v7a x86
+</pre>
+
+ <p>This also works if you define <code>APP_ABI</code> when calling
+ <code>ndk-build</code> from the command-line, which is a quick way to check that your
+ project builds for all supported ABIs without changing the project's
+ <code>Application.mk file</code>. For example:</p>
+ <pre>
+ndk-build APP_ABI=all
+</pre>
+ </li>
+
+ <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that
+ allows you to declare which C++ features (RTTI or Exceptions) your module uses. This
+ ensures that the final linking works correctly if you have prebuilt modules that depend
+ on these features. See <code>docs/ANDROID-MK.html</code> and
+ <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li>
+
+ <li>Shortened paths to source and object files that are used in build commands. When
+ invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source,
+ object, and binary files that are passed to the build commands are significantly
+ shorter now, because they are passed relative to the current directory. This is useful
+ when building projects with a lot of source files, to avoid limits on the maximum
+ command line length supported by your host operating system. The behavior is unchanged
+ if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if
+ you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li>
+ </ul>
+ </dd>
+
+ <dt>Experimental features</dt>
+
+ <dd>
+ You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the
+ <code>ndk-build.cmd</code> script from the command line from your project path. The
+ script takes exactly the same arguments as the original <code>ndk-build</code> script.
+ The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other
+ tools required by the build. You should not need to install anything else to get a
+ working build system.
+
+ <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on
+ Windows, so you still need Cygwin to debug.</p>
+
+ <p>This feature is still experimental, so feel free to try it and report issues on the
+ <a href="http://b.android.com">public bug database</a> or <a href=
+ "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests
+ shipped with the NDK succesfully compile with this feature.</p>
+ </dd>
+
+ <dt>Important bug fixes</dt>
+
+ <dd>
+ <ul>
+ <li>Imported shared libraries are now installed by default to the target installation
+ location (<code>libs/<abi></code>) if <code>APP_MODULES</code> is not defined in
+ your <code>Application.mk</code>. For example, if a top-level module <code>foo</code>
+ imports a module <code>bar</code>, then both <code>libfoo.so</code> and
+ <code>libbar.so</code> are copied to the install location. Previously, only
+ <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your
+ <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the
+ behavior is unchanged.</li>
+
+ <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in
+ their MAIN intent filters.</li>
+
+ <li>Static library imports are now properly transitive. For example, if a top-level
+ module <code>foo</code> imports static library <code>bar</code> that imports static
+ library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both
+ <code>libbar.a</code> and <code>libzoo.a</code>.</li>
+ </ul>
+ </dd>
+
+ <dt>Other changes</dt>
+
+ <dd>
+ <ul>
+ <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be
+ 9, not 8 for native activities.</li>
+
+ <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a
+ supported stable API, starting from API level 9.</li>
+
+ <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain
+ sources from <a href="http://android.googlesource.com">android.googlesource.com</a>,
+ which is the new location for the AOSP servers.</li>
+
+ <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it
+ are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li>
+
+ <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds
+ to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at
+ <code>docs/CPLUSPLUS-SUPPORT.html</code></li>
+
+ <li>Added support for RTTI in the STLport C++ runtimes (no support for
+ exceptions).</li>
+
+ <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For
+ example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources,
+ declare the following:
+ <pre>
+LOCAL_CPP_EXTENSION := .cpp .cxx
+</pre>
+ </li>
+
+ <li>Removed many unwanted exported symbols from the link-time shared system libraries
+ provided by the NDK. This ensures that code generated with the standalone toolchain
+ doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a
+ symbol that changes each time the toolchain used to build the platform is changed)</li>
+
+ <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note
+ that this does <em>not</em> change the NDK ABIs for the corresponding libraries,
+ because each extension must be probed at runtime by the client application.
+
+ <p>The extensions that are available depend on your actual device and GPU drivers,
+ not the platform version the device runs on. The header changes simply add new
+ constants and types to make it easier to use the extensions when they have been
+ probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The
+ following list describes the newly supported extensions:</p>
+
+ <dl>
+ <dt>GLES 1.x</dt>
+
+ <dd>
+ <ul>
+ <li><code>GL_OES_vertex_array_object</code></li>
+
+ <li><code>GL_OES_EGL_image_external</code></li>
+
+ <li><code>GL_APPLE_texture_2D_limited_npot</code></li>
+
+ <li><code>GL_EXT_blend_minmax</code></li>
+
+ <li><code>GL_EXT_discard_framebuffer</code></li>
+
+ <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+ <li><code>GL_EXT_read_format_bgra</code></li>
+
+ <li><code>GL_EXT_texture_filter_anisotropic</code></li>
+
+ <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+ <li><code>GL_EXT_texture_lod_bias</code></li>
+
+ <li><code>GL_IMG_read_format</code></li>
+
+ <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+ <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li>
+
+ <li><code>GL_IMG_user_clip_plane</code></li>
+
+ <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+ <li><code>GL_NV_fence</code></li>
+
+ <li><code>GL_QCOM_driver_control</code></li>
+
+ <li><code>GL_QCOM_extended_get</code></li>
+
+ <li><code>GL_QCOM_extended_get2</code></li>
+
+ <li><code>GL_QCOM_perfmon_global_mode</code></li>
+
+ <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+ <li><code>GL_QCOM_tiled_rendering</code></li>
+ </ul>
+ </dd>
+
+ <dt>GLES 2.0</dt>
+
+ <dd>
+ <ul>
+ <li><code>GL_OES_element_index_uint</code></li>
+
+ <li><code>GL_OES_get_program_binary</code></li>
+
+ <li><code>GL_OES_mapbuffer</code></li>
+
+ <li><code>GL_OES_packed_depth_stencil</code></li>
+
+ <li><code>GL_OES_texture_3D</code></li>
+
+ <li><code>GL_OES_texture_float</code></li>
+
+ <li><code>GL_OES_texture_float_linear</code></li>
+
+ <li><code>GL_OES_texture_half_float_linear</code></li>
+
+ <li><code>GL_OES_texture_npot</code></li>
+
+ <li><code>GL_OES_vertex_array_object</code></li>
+
+ <li><code>GL_OES_EGL_image_external</code></li>
+
+ <li><code>GL_AMD_program_binary_Z400</code></li>
+
+ <li><code>GL_EXT_blend_minmax</code></li>
+
+ <li><code>GL_EXT_discard_framebuffer</code></li>
+
+ <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+ <li><code>GL_EXT_read_format_bgra</code></li>
+
+ <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+ <li><code>GL_EXT_texture_compression_dxt1</code></li>
+
+ <li><code>GL_IMG_program_binary</code></li>
+
+ <li><code>GL_IMG_read_format</code></li>
+
+ <li><code>GL_IMG_shader_binary</code></li>
+
+ <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+ <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+ <li><code>GL_NV_coverage_sample</code></li>
+
+ <li><code>GL_NV_depth_nonlinear</code></li>
+
+ <li><code>GL_QCOM_extended_get</code></li>
+
+ <li><code>GL_QCOM_extended_get2</code></li>
+
+ <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+ <li><code>GL_QCOM_tiled_rendering</code></li>
+ </ul>
+ </dd>
+
+ <dt>EGL</dt>
+
+ <dd>
+ <ul>
+ <li><code>EGL_ANDROID_recordable</code></li>
+
+ <li><code>EGL_NV_system_time</code></li>
+ </ul>
+ </dd>
+ </dl>
+ </li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)"><img src=
+ "{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px">
Android NDK, Revision 6b</a> <em>(August 2011)</em>
<div class="toggleme">
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 9a18f7da..afe6a6e 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -192,7 +192,8 @@
<span style="display:none" class="zh-TW"></span>
</h2>
<ul>
- <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r6b</a>
+ <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r7</a>
+ <span class="new">new!</span>
</li>
<li><a href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a></li>
</ul>
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 79acd55..380b3d8 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -604,10 +604,13 @@
}
Bitmap bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true);
if (config == Config.ARGB_8888 && !hasAlpha) {
- bm.eraseColor(0xff000000);
+ nativeErase(bm.mNativeBitmap, 0xff000000);
nativeSetHasAlpha(bm.mNativeBitmap, hasAlpha);
} else {
- bm.eraseColor(0);
+ // No need to initialize it to zeroes; it is backed by a VM byte array
+ // which is by definition preinitialized to all zeroes.
+ //
+ //nativeErase(bm.mNativeBitmap, 0);
}
return bm;
}
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index f3b62ec..0521e69 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -17,6 +17,7 @@
package android.graphics;
import java.lang.ref.WeakReference;
+
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -130,10 +131,23 @@
}
/**
- * Set the size of buffers returned by requestBuffers when a width and height
- * of zero is requested.
+ * Set the default size of the image buffers. The image producer may override the buffer size,
+ * in which case the producer-set buffer size will be used, not the default size set by this
+ * method. Both video and camera based image producers do override the size. This method may
+ * be used to set the image size when producing images with {@link android.graphics.Canvas} (via
+ * {@link android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface).
*
- * @hide Pending approval by API council.
+ * The new default buffer size will take effect the next time the image producer requests a
+ * buffer to fill. For {@link android.graphics.Canvas} this will be the next time {@link
+ * android.view.Surface#lockCanvas} is called. For OpenGL ES, the EGLSurface should be
+ * destroyed (via eglDestroySurface), made not-current (via eglMakeCurrent), and then recreated
+ * (via eglCreateWindowSurface) to ensure that the new default size has taken effect.
+ *
+ * The width and height parameters must be no greater than the minimum of
+ * GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see
+ * {@link javax.microedition.khronos.opengles.GL10#glGetIntegerv glGetIntegerv}).
+ * An error due to invalid dimensions might not be reported until
+ * updateTexImage() is called.
*/
public void setDefaultBufferSize(int width, int height) {
nativeSetDefaultBufferSize(width, height);
@@ -145,7 +159,10 @@
* implicitly bind its texture to the GL_TEXTURE_EXTERNAL_OES texture target.
*/
public void updateTexImage() {
- nativeUpdateTexImage();
+ int err = nativeUpdateTexImage();
+ if (err != 0) {
+ throw new RuntimeException("Error during updateTexImage (see logs)");
+ }
}
/**
@@ -251,7 +268,7 @@
private native void nativeGetTransformMatrix(float[] mtx);
private native long nativeGetTimestamp();
private native void nativeSetDefaultBufferSize(int width, int height);
- private native void nativeUpdateTexImage();
+ private native int nativeUpdateTexImage();
private native int nativeGetQueuedCount();
private native void nativeRelease();
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index 199952c..20eb93f 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.java
@@ -30,7 +30,7 @@
import android.view.SurfaceView;
/**
- * The Surface View for a graphics renderscript (RenderScriptGL) to draw on.
+ * The Surface View for a graphics renderscript (RenderScriptGL) to draw on.
*/
public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mSurfaceHolder;
@@ -77,7 +77,7 @@
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public void surfaceDestroyed(SurfaceHolder holder) {
+ public synchronized void surfaceDestroyed(SurfaceHolder holder) {
// Surface will be destroyed when we return
if (mRS != null) {
mRS.setSurface(null, 0, 0);
@@ -88,7 +88,7 @@
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ public synchronized void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
if (mRS != null) {
mRS.setSurface(holder, w, h);
}
@@ -125,7 +125,7 @@
return rs;
}
- public void destroyRenderScriptGL() {
+ public synchronized void destroyRenderScriptGL() {
mRS.destroy();
mRS = null;
}
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index e2d6179e..d7dd4d6 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -79,7 +79,11 @@
// pointed to by the buf argument and a status of OK is returned. If no
// slot is available then a status of -EBUSY is returned and buf is
// unmodified.
- virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h,
+ // The width and height parameters must be no greater than the minimum of
+ // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
+ // An error due to invalid dimensions might not be reported until
+ // updateTexImage() is called.
+ virtual status_t dequeueBuffer(int *buf, uint32_t width, uint32_t height,
uint32_t format, uint32_t usage);
// queueBuffer returns a filled buffer to the SurfaceTexture. In addition, a
@@ -176,7 +180,11 @@
// requestBuffers when a with and height of zero is requested.
// A call to setDefaultBufferSize() may trigger requestBuffers() to
// be called from the client.
- status_t setDefaultBufferSize(uint32_t w, uint32_t h);
+ // The width and height parameters must be no greater than the minimum of
+ // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
+ // An error due to invalid dimensions might not be reported until
+ // updateTexImage() is called.
+ status_t setDefaultBufferSize(uint32_t width, uint32_t height);
// getCurrentBuffer returns the buffer associated with the current image.
sp<GraphicBuffer> getCurrentBuffer() const;
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index 0e2cdf7..e905903 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -40,7 +40,6 @@
const KeyedVector<String8, String8>* headers) = 0;
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
virtual status_t setDataSource(const sp<IStreamSource>& source) = 0;
- virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture) = 0;
virtual status_t prepareAsync() = 0;
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 4328d3c..80f43a3 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -117,9 +117,6 @@
return INVALID_OPERATION;
}
- // pass the buffered Surface to the media player service
- virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
-
// pass the buffered ISurfaceTexture to the media player service
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture) = 0;
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h
index 9aa6700..534afce 100644
--- a/include/media/mediametadataretriever.h
+++ b/include/media/mediametadataretriever.h
@@ -54,6 +54,7 @@
METADATA_KEY_BITRATE = 20,
METADATA_KEY_TIMED_TEXT_LANGUAGES = 21,
METADATA_KEY_IS_DRM = 22,
+ METADATA_KEY_LOCATION = 23,
// Add more here...
};
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 08835fb..e6a0cc5 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -170,7 +170,6 @@
status_t setDataSource(int fd, int64_t offset, int64_t length);
status_t setDataSource(const sp<IStreamSource> &source);
- status_t setVideoSurface(const sp<Surface>& surface);
status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture);
status_t setListener(const sp<MediaPlayerListener>& listener);
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index 57f678c..4cdee17 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -85,6 +85,7 @@
kKeyDate = 'date', // cstring
kKeyWriter = 'writ', // cstring
kKeyCompilation = 'cpil', // cstring
+ kKeyLocation = 'loc ', // cstring
kKeyTimeScale = 'tmsl', // int32_t
// video profile and level
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp
index 5daafd5..93ebfb9 100644
--- a/libs/gui/tests/SurfaceTexture_test.cpp
+++ b/libs/gui/tests/SurfaceTexture_test.cpp
@@ -1520,4 +1520,36 @@
EXPECT_EQ(1, buffers[2]->getStrongCount());
}
+TEST_F(SurfaceTextureGLTest, InvalidWidthOrHeightFails) {
+ int texHeight = 16;
+ ANativeWindowBuffer* anb;
+
+ GLint maxTextureSize;
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
+
+ // make sure it works with small textures
+ mST->setDefaultBufferSize(16, texHeight);
+ EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+ EXPECT_EQ(16, anb->width);
+ EXPECT_EQ(texHeight, anb->height);
+ EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
+ EXPECT_EQ(NO_ERROR, mST->updateTexImage());
+
+ // make sure it works with GL_MAX_TEXTURE_SIZE
+ mST->setDefaultBufferSize(maxTextureSize, texHeight);
+ EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+ EXPECT_EQ(maxTextureSize, anb->width);
+ EXPECT_EQ(texHeight, anb->height);
+ EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
+ EXPECT_EQ(NO_ERROR, mST->updateTexImage());
+
+ // make sure it fails with GL_MAX_TEXTURE_SIZE+1
+ mST->setDefaultBufferSize(maxTextureSize+1, texHeight);
+ EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+ EXPECT_EQ(maxTextureSize+1, anb->width);
+ EXPECT_EQ(texHeight, anb->height);
+ EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
+ ASSERT_NE(NO_ERROR, mST->updateTexImage());
+}
+
} // namespace android
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 75b07de..f293cba 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -46,22 +46,16 @@
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-Caches::Caches(): Singleton<Caches>(), blend(false), lastSrcMode(GL_ZERO),
- lastDstMode(GL_ZERO), currentProgram(NULL) {
+Caches::Caches(): Singleton<Caches>(), mInitialized(false) {
GLint maxTextureUnits;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
LOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
}
- glGenBuffers(1, &meshBuffer);
- glBindBuffer(GL_ARRAY_BUFFER, meshBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(gMeshVertices), gMeshVertices, GL_STATIC_DRAW);
-
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
- mCurrentBuffer = meshBuffer;
- mRegionMesh = NULL;
+ init();
mDebugLevel = readDebugLevel();
LOGD("Enabling debug mode %d", mDebugLevel);
@@ -71,8 +65,40 @@
#endif
}
-Caches::~Caches() {
+void Caches::init() {
+ if (mInitialized) return;
+
+ glGenBuffers(1, &meshBuffer);
+ glBindBuffer(GL_ARRAY_BUFFER, meshBuffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(gMeshVertices), gMeshVertices, GL_STATIC_DRAW);
+
+ mCurrentBuffer = meshBuffer;
+ mRegionMesh = NULL;
+
+ blend = false;
+ lastSrcMode = GL_ZERO;
+ lastDstMode = GL_ZERO;
+ currentProgram = NULL;
+
+ mInitialized = true;
+}
+
+void Caches::terminate() {
+ if (!mInitialized) return;
+
+ glDeleteBuffers(1, &meshBuffer);
+ mCurrentBuffer = 0;
+
+ glDeleteBuffers(1, &mRegionMeshIndices);
delete[] mRegionMesh;
+ mRegionMesh = NULL;
+
+ fboCache.clear();
+
+ programCache.clear();
+ currentProgram = NULL;
+
+ mInitialized = false;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 9b0d7c6e..5e58a9e 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -86,7 +86,6 @@
class ANDROID_API Caches: public Singleton<Caches> {
Caches();
- ~Caches();
friend class Singleton<Caches>;
@@ -109,6 +108,11 @@
};
/**
+ * Initializes the cache.
+ */
+ void init();
+
+ /**
* Flush the cache.
*
* @param mode Indicates how much of the cache should be flushed
@@ -116,6 +120,12 @@
void flush(FlushMode mode);
/**
+ * Destroys all resources associated with this cache. This should
+ * be called after a flush(kFlushMode_Full).
+ */
+ void terminate();
+
+ /**
* Indicates whether the renderer is in debug mode.
* This debug mode provides limited information to app developers.
*/
@@ -194,6 +204,7 @@
private:
DebugLevel mDebugLevel;
+ bool mInitialized;
}; // class Caches
}; // namespace uirenderer
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 2f32bd8..a8daab0 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -521,6 +521,9 @@
ensureValidDirection(direction);
ensureValidStreamType(streamType);
+ // use stream type alias here so that streams with same alias have the same behavior,
+ // including with regard to silent mode control (e.g the use of STREAM_RING below and in
+ // checkForRingerModeChange() in place of STREAM_RING or STREAM_NOTIFICATION)
int streamTypeAlias = STREAM_VOLUME_ALIAS[streamType];
VolumeStreamState streamState = mStreamStates[streamTypeAlias];
final int oldIndex = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex;
@@ -529,9 +532,8 @@
// If either the client forces allowing ringer modes for this adjustment,
// or the stream type is one that is affected by ringer modes
if (((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0) ||
- (!mVoiceCapable && streamType != AudioSystem.STREAM_VOICE_CALL &&
- streamType != AudioSystem.STREAM_BLUETOOTH_SCO) ||
- (mVoiceCapable && streamTypeAlias == AudioSystem.STREAM_RING)) {
+ streamTypeAlias == AudioSystem.STREAM_RING ||
+ (!mVoiceCapable && streamTypeAlias == AudioSystem.STREAM_MUSIC)) {
// do not vibrate if already in vibrate mode
if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
flags &= ~AudioManager.FLAG_VIBRATE;
@@ -545,10 +547,19 @@
int index;
if (streamState.muteCount() != 0) {
if (adjustVolume) {
- streamState.adjustLastAudibleIndex(direction);
- // Post a persist volume msg
- sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, streamType,
- SENDMSG_REPLACE, 0, 1, streamState, PERSIST_DELAY);
+ // adjust volume on all stream types sharing the same alias otherwise a query
+ // on last audible index for an alias would not give the correct value
+ int numStreamTypes = AudioSystem.getNumStreamTypes();
+ for (int i = numStreamTypes - 1; i >= 0; i--) {
+ if (STREAM_VOLUME_ALIAS[i] == streamTypeAlias) {
+ VolumeStreamState s = mStreamStates[i];
+
+ s.adjustLastAudibleIndex(direction);
+ // Post a persist volume msg
+ sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, i,
+ SENDMSG_REPLACE, 0, 1, s, PERSIST_DELAY);
+ }
+ }
}
index = streamState.mLastAudibleIndex;
} else {
@@ -2682,11 +2693,22 @@
mCallingUid = uid;
}
- public void unlinkToDeath() {
+ private void unlinkToDeath() {
if (mSourceRef != null && mHandler != null) {
mSourceRef.unlinkToDeath(mHandler, 0);
}
}
+
+ @Override
+ protected void finalize() throws Throwable {
+ try {
+ unlinkToDeath();
+ } catch (java.util.NoSuchElementException e) {
+ Log.w(TAG, e + " thrown by unlinkToDeath() during finalize, ignoring");
+ } finally {
+ super.finalize();
+ }
+ }
}
private Stack<FocusStackEntry> mFocusStack = new Stack<FocusStackEntry>();
@@ -2721,8 +2743,7 @@
if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientToRemove))
{
//Log.i(TAG, " removeFocusStackEntry() removing top of stack");
- FocusStackEntry fse = mFocusStack.pop();
- fse.unlinkToDeath();
+ mFocusStack.pop();
if (signal) {
// notify the new top of the stack it gained focus
notifyTopOfAudioFocusStack();
@@ -2741,7 +2762,6 @@
Log.i(TAG, " AudioFocus abandonAudioFocus(): removing entry for "
+ fse.mClientId);
stackIterator.remove();
- fse.unlinkToDeath();
}
}
}
@@ -2847,6 +2867,9 @@
// if focus is already owned by this client and the reason for acquiring the focus
// hasn't changed, don't do anything
if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
+ // unlink death handler so it can be gc'ed.
+ // linkToDeath() creates a JNI global reference preventing collection.
+ cb.unlinkToDeath(afdh, 0);
return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
// the reason for the audio focus request has changed: remove the current top of
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index 10694c3..11ecd1f 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -458,5 +458,12 @@
* @hide
*/
public static final int METADATA_KEY_IS_DRM = 22;
+ /**
+ * This key retrieves the location information, if available.
+ * The location should be specified according to ISO-6709 standard, under
+ * a mp4/3gp box "@xyz". Location with longitude of -90 degrees and latitude
+ * of 180 degrees will be retrieved as "-90.0000+180.0000", for instance.
+ */
+ public static final int METADATA_KEY_LOCATION = 23;
// Add more here...
}
diff --git a/media/java/android/media/videoeditor/MediaImageItem.java b/media/java/android/media/videoeditor/MediaImageItem.java
index a862d00..590b4ae 100755
--- a/media/java/android/media/videoeditor/MediaImageItem.java
+++ b/media/java/android/media/videoeditor/MediaImageItem.java
@@ -154,7 +154,7 @@
final Bitmap imageBitmap;
- if (mHeight > maxResolution.second) {
+ if (mWidth > maxResolution.first || mHeight > maxResolution.second) {
/**
* We need to scale the image
*/
@@ -971,14 +971,13 @@
/**
* Create the bitmap from file
*/
- if (nativeWidth / bitmapWidth > 1) {
-
- final BitmapFactory.Options options = new BitmapFactory.Options();
- options.inSampleSize = nativeWidth / (int)bitmapWidth;
- srcBitmap = BitmapFactory.decodeFile(filename, options);
- } else {
- srcBitmap = BitmapFactory.decodeFile(filename);
- }
+ int sampleSize = (int) Math.ceil(Math.max(
+ (float) nativeWidth / bitmapWidth,
+ (float) nativeHeight / bitmapHeight));
+ sampleSize = nextPowerOf2(sampleSize);
+ final BitmapFactory.Options options = new BitmapFactory.Options();
+ options.inSampleSize = sampleSize;
+ srcBitmap = BitmapFactory.decodeFile(filename, options);
} else {
bitmapWidth = width;
bitmapHeight = height;
@@ -1009,4 +1008,14 @@
srcBitmap.recycle();
return bitmap;
}
+
+ public static int nextPowerOf2(int n) {
+ n -= 1;
+ n |= n >>> 16;
+ n |= n >>> 8;
+ n |= n >>> 4;
+ n |= n >>> 2;
+ n |= n >>> 1;
+ return n + 1;
+ }
}
diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp
index 3c3af8f..1a06cc6 100644
--- a/media/libeffects/visualizer/EffectVisualizer.cpp
+++ b/media/libeffects/visualizer/EffectVisualizer.cpp
@@ -47,17 +47,22 @@
VISUALIZER_STATE_ACTIVE,
};
+// maximum number of reads from same buffer before resetting capture buffer. This means
+// that the framework has stopped playing audio and we must start returning silence
+#define MAX_STALL_COUNT 10
+
struct VisualizerContext {
const struct effect_interface_s *mItfe;
effect_config_t mConfig;
- uint32_t mState;
uint32_t mCaptureIdx;
uint32_t mCaptureSize;
- uint32_t mCurrentBuf;
+ uint8_t mState;
+ uint8_t mCurrentBuf;
+ uint8_t mLastBuf;
+ uint8_t mStallCount;
uint8_t mCaptureBuf[2][VISUALIZER_CAPTURE_SIZE_MAX];
};
-
//
//--- Local functions
//
@@ -66,6 +71,8 @@
{
pContext->mCaptureIdx = 0;
pContext->mCurrentBuf = 0;
+ pContext->mLastBuf = 1;
+ pContext->mStallCount = 0;
memset(pContext->mCaptureBuf[0], 0x80, VISUALIZER_CAPTURE_SIZE_MAX);
memset(pContext->mCaptureBuf[1], 0x80, VISUALIZER_CAPTURE_SIZE_MAX);
}
@@ -417,9 +424,24 @@
memcpy(pReplyData,
pContext->mCaptureBuf[pContext->mCurrentBuf ^ 1],
pContext->mCaptureSize);
+ // if audio framework has stopped playing audio although the effect is still
+ // active we must clear the capture buffer to return silence
+ if (pContext->mLastBuf == pContext->mCurrentBuf) {
+ if (pContext->mStallCount < MAX_STALL_COUNT) {
+ if (++pContext->mStallCount == MAX_STALL_COUNT) {
+ memset(pContext->mCaptureBuf[pContext->mCurrentBuf ^ 1],
+ 0x80,
+ pContext->mCaptureSize);
+ }
+ }
+ } else {
+ pContext->mStallCount = 0;
+ }
+ pContext->mLastBuf = pContext->mCurrentBuf;
} else {
memset(pReplyData, 0x80, pContext->mCaptureSize);
}
+
break;
default:
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 50a41ca..9c1e6b7 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -35,7 +35,6 @@
SET_DATA_SOURCE_URL,
SET_DATA_SOURCE_FD,
SET_DATA_SOURCE_STREAM,
- SET_VIDEO_SURFACE,
PREPARE_ASYNC,
START,
STOP,
@@ -112,16 +111,6 @@
return reply.readInt32();
}
- // pass the buffered Surface to the media player service
- status_t setVideoSurface(const sp<Surface>& surface)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
- Surface::writeToParcel(surface, &data);
- remote()->transact(SET_VIDEO_SURFACE, data, &reply);
- return reply.readInt32();
- }
-
// pass the buffered ISurfaceTexture to the media player service
status_t setVideoSurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture)
{
@@ -345,12 +334,6 @@
reply->writeInt32(setDataSource(source));
return NO_ERROR;
}
- case SET_VIDEO_SURFACE: {
- CHECK_INTERFACE(IMediaPlayer, data, reply);
- sp<Surface> surface = Surface::readFromParcel(data);
- reply->writeInt32(setVideoSurface(surface));
- return NO_ERROR;
- } break;
case SET_VIDEO_SURFACETEXTURE: {
CHECK_INTERFACE(IMediaPlayer, data, reply);
sp<ISurfaceTexture> surfaceTexture =
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index f72300b..c2e1ddf 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -219,14 +219,6 @@
return mPlayer->getMetadata(update_only, apply_filter, metadata);
}
-status_t MediaPlayer::setVideoSurface(const sp<Surface>& surface)
-{
- LOGV("setVideoSurface");
- Mutex::Autolock _l(mLock);
- if (mPlayer == 0) return NO_INIT;
- return mPlayer->setVideoSurface(surface);
-}
-
status_t MediaPlayer::setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture)
{
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index b655358..e8d0f0c 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -788,14 +788,6 @@
return mStatus;
}
-status_t MediaPlayerService::Client::setVideoSurface(const sp<Surface>& surface)
-{
- LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get());
- sp<MediaPlayerBase> p = getPlayer();
- if (p == 0) return UNKNOWN_ERROR;
- return p->setVideoSurface(surface);
-}
-
void MediaPlayerService::Client::disconnectNativeWindow() {
if (mConnectedWindow != NULL) {
status_t err = native_window_api_disconnect(mConnectedWindow.get(),
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index 62214ba..04d9e28 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -248,7 +248,6 @@
// IMediaPlayer interface
virtual void disconnect();
- virtual status_t setVideoSurface(const sp<Surface>& surface);
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture);
virtual status_t prepareAsync();
diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h
index b35696f1..3469389 100644
--- a/media/libmediaplayerservice/MidiFile.h
+++ b/media/libmediaplayerservice/MidiFile.h
@@ -35,7 +35,6 @@
const char* path, const KeyedVector<String8, String8> *headers);
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
- virtual status_t setVideoSurface(const sp<Surface>& surface) { return UNKNOWN_ERROR; }
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture)
{ return UNKNOWN_ERROR; }
diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp
index cd4b1ef..598d573 100644
--- a/media/libmediaplayerservice/StagefrightPlayer.cpp
+++ b/media/libmediaplayerservice/StagefrightPlayer.cpp
@@ -69,12 +69,6 @@
return mPlayer->setDataSource(source);
}
-status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) {
- LOGV("setVideoSurface");
-
- return mPlayer->setSurface(surface);
-}
-
status_t StagefrightPlayer::setVideoSurfaceTexture(
const sp<ISurfaceTexture> &surfaceTexture) {
LOGV("setVideoSurfaceTexture");
diff --git a/media/libmediaplayerservice/StagefrightPlayer.h b/media/libmediaplayerservice/StagefrightPlayer.h
index cbc6d49..e89e18a 100644
--- a/media/libmediaplayerservice/StagefrightPlayer.h
+++ b/media/libmediaplayerservice/StagefrightPlayer.h
@@ -40,7 +40,6 @@
virtual status_t setDataSource(const sp<IStreamSource> &source);
- virtual status_t setVideoSurface(const sp<Surface> &surface);
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture> &surfaceTexture);
virtual status_t prepare();
diff --git a/media/libmediaplayerservice/TestPlayerStub.h b/media/libmediaplayerservice/TestPlayerStub.h
index 802a11b..91ffa7d 100644
--- a/media/libmediaplayerservice/TestPlayerStub.h
+++ b/media/libmediaplayerservice/TestPlayerStub.h
@@ -75,9 +75,6 @@
// All the methods below wrap the mPlayer instance.
- virtual status_t setVideoSurface(const android::sp<android::Surface>& s) {
- return mPlayer->setVideoSurface(s);
- }
virtual status_t setVideoSurfaceTexture(
const android::sp<android::ISurfaceTexture>& st) {
return mPlayer->setVideoSurfaceTexture(st);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 70208f8..2a5c0a6 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -99,12 +99,6 @@
msg->post();
}
-void NuPlayer::setVideoSurface(const sp<Surface> &surface) {
- sp<AMessage> msg = new AMessage(kWhatSetVideoNativeWindow, id());
- msg->setObject("native-window", new NativeWindowWrapper(surface));
- msg->post();
-}
-
void NuPlayer::setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {
sp<AMessage> msg = new AMessage(kWhatSetVideoNativeWindow, id());
sp<SurfaceTextureClient> surfaceTextureClient(surfaceTexture != NULL ?
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index f90759d..f23deea 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -42,7 +42,6 @@
void setDataSource(
const char *url, const KeyedVector<String8, String8> *headers);
- void setVideoSurface(const sp<Surface> &surface);
void setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
void setAudioSink(const sp<MediaPlayerBase::AudioSink> &sink);
void start();
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
index 452ba99..5aa99bf 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
@@ -89,12 +89,6 @@
return OK;
}
-status_t NuPlayerDriver::setVideoSurface(const sp<Surface> &surface) {
- mPlayer->setVideoSurface(surface);
-
- return OK;
-}
-
status_t NuPlayerDriver::setVideoSurfaceTexture(
const sp<ISurfaceTexture> &surfaceTexture) {
mPlayer->setVideoSurfaceTexture(surfaceTexture);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
index aaa3de0..4a0026c 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
@@ -37,7 +37,6 @@
virtual status_t setDataSource(const sp<IStreamSource> &source);
- virtual status_t setVideoSurface(const sp<Surface> &surface);
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture> &surfaceTexture);
virtual status_t prepare();
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index bf19040..640e9fa 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -381,7 +381,7 @@
LOGV("rendering video at media time %.2f secs", mediaTimeUs / 1E6);
}
- entry->mNotifyConsumed->setInt32("render", true);
+ entry->mNotifyConsumed->setInt32("render", !tooLate);
entry->mNotifyConsumed->post();
mVideoQueue.erase(mVideoQueue.begin());
entry = NULL;
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index f37e75b..7d9d7ed 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1139,18 +1139,9 @@
return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN);
}
-status_t AwesomePlayer::setSurface(const sp<Surface> &surface) {
- Mutex::Autolock autoLock(mLock);
-
- mSurface = surface;
- return setNativeWindow_l(surface);
-}
-
status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {
Mutex::Autolock autoLock(mLock);
- mSurface.clear();
-
status_t err;
if (surfaceTexture != NULL) {
err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture));
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 1ba79e5..e4de20a 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -257,6 +257,12 @@
mForceRead = false;
*timestampUs =
mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs;
+
+ // Really make sure that this video recording frame will not be dropped.
+ if (*timestampUs < mStartTimeUs) {
+ LOGI("set timestampUs to start time stamp %lld us", mStartTimeUs);
+ *timestampUs = mStartTimeUs;
+ }
return false;
}
}
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 1e24599..1ebf0a8 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1136,6 +1136,41 @@
break;
}
+ // @xyz
+ case FOURCC('\xA9', 'x', 'y', 'z'):
+ {
+ // Best case the total data length inside "@xyz" box
+ // would be 8, for instance "@xyz" + "\x00\x04\x15\xc7" + "0+0/",
+ // where "\x00\x04" is the text string length with value = 4,
+ // "\0x15\xc7" is the language code = en, and "0+0" is a
+ // location (string) value with longitude = 0 and latitude = 0.
+ if (chunk_data_size < 8) {
+ return ERROR_MALFORMED;
+ }
+
+ // Worst case the location string length would be 18,
+ // for instance +90.0000-180.0000, without the trailing "/" and
+ // the string length + language code.
+ char buffer[18];
+
+ // Substracting 5 from the data size is because the text string length +
+ // language code takes 4 bytes, and the trailing slash "/" takes 1 byte.
+ off64_t location_length = chunk_data_size - 5;
+ if (location_length >= (off64_t) sizeof(buffer)) {
+ return ERROR_MALFORMED;
+ }
+
+ if (mDataSource->readAt(
+ data_offset + 4, buffer, location_length) < location_length) {
+ return ERROR_IO;
+ }
+
+ buffer[location_length] = '\0';
+ mFileMetaData->setCString(kKeyLocation, buffer);
+ *offset += chunk_size;
+ break;
+ }
+
case FOURCC('e', 's', 'd', 's'):
{
if (chunk_data_size < 4) {
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index c74cb5a..4491c97 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -418,6 +418,7 @@
{ kKeyYear, METADATA_KEY_YEAR },
{ kKeyWriter, METADATA_KEY_WRITER },
{ kKeyCompilation, METADATA_KEY_COMPILATION },
+ { kKeyLocation, METADATA_KEY_LOCATION },
};
static const size_t kNumMapEntries = sizeof(kMap) / sizeof(kMap[0]);
diff --git a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
index ddced5f..aa07e57 100644
--- a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
+++ b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
@@ -421,8 +421,13 @@
int32_t bufferSize = inHeader->nFilledLen;
+ // The PV decoder is lying to us, sometimes it'll claim to only have
+ // consumed a subset of the buffer when it clearly consumed all of it.
+ // ignore whatever it says...
+ int32_t tmp = bufferSize;
+
if (PVDecodeVideoFrame(
- mHandle, &bitstream, ×tamp, &bufferSize,
+ mHandle, &bitstream, ×tamp, &tmp,
&useExtTimestamp,
outHeader->pBuffer) != PV_TRUE) {
LOGE("failed to decode video frame.");
diff --git a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
index 740c957..dede3ac 100644
--- a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
+++ b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
@@ -76,7 +76,8 @@
mPicId(0),
mHeadersDecoded(false),
mEOSStatus(INPUT_DATA_AVAILABLE),
- mOutputPortSettingsChange(NONE) {
+ mOutputPortSettingsChange(NONE),
+ mSignalledError(false) {
initPorts();
CHECK_EQ(initDecoder(), (status_t)OK);
}
@@ -287,7 +288,7 @@
}
void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
- if (mOutputPortSettingsChange != NONE) {
+ if (mSignalledError || mOutputPortSettingsChange != NONE) {
return;
}
@@ -298,7 +299,6 @@
List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);
H264SwDecRet ret = H264SWDEC_PIC_RDY;
- status_t err = OK;
bool portSettingsChanged = false;
while ((mEOSStatus != INPUT_DATA_AVAILABLE || !inQueue.empty())
&& outQueue.size() == kNumOutputBuffers) {
@@ -372,7 +372,12 @@
inPicture.dataLen = 0;
if (ret < 0) {
LOGE("Decoder failed: %d", ret);
- err = ERROR_MALFORMED;
+
+ notify(OMX_EventError, OMX_ErrorUndefined,
+ ERROR_MALFORMED, NULL);
+
+ mSignalledError = true;
+ return;
}
}
}
@@ -400,10 +405,6 @@
uint8_t *data = (uint8_t *) decodedPicture.pOutputPicture;
drainOneOutputBuffer(picId, data);
}
-
- if (err != OK) {
- notify(OMX_EventError, OMX_ErrorUndefined, err, NULL);
- }
}
}
diff --git a/media/libstagefright/codecs/on2/h264dec/SoftAVC.h b/media/libstagefright/codecs/on2/h264dec/SoftAVC.h
index 1cc85e8..879b014 100644
--- a/media/libstagefright/codecs/on2/h264dec/SoftAVC.h
+++ b/media/libstagefright/codecs/on2/h264dec/SoftAVC.h
@@ -88,6 +88,8 @@
};
OutputPortSettingChange mOutputPortSettingsChange;
+ bool mSignalledError;
+
void initPorts();
status_t initDecoder();
void updatePortDefinitions();
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 7d6bcad..c13d6cb 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -81,7 +81,6 @@
bool isPlaying() const;
- status_t setSurface(const sp<Surface> &surface);
status_t setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
void setAudioSink(const sp<MediaPlayerBase::AudioSink> &audioSink);
status_t setLooping(bool shouldLoop);
@@ -154,7 +153,6 @@
bool mUIDValid;
uid_t mUID;
- sp<Surface> mSurface;
sp<ANativeWindow> mNativeWindow;
sp<MediaPlayerBase::AudioSink> mAudioSink;
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index 47de4e09..cd374e2 100644
--- a/media/libstagefright/rtsp/ARTPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTPConnection.cpp
@@ -220,7 +220,7 @@
}
if (it == mStreams.end()) {
- TRESPASS();
+ return;
}
mStreams.erase(it);
@@ -274,41 +274,52 @@
}
int res = select(maxSocket + 1, &rs, NULL, NULL, &tv);
- CHECK_GE(res, 0);
if (res > 0) {
- for (List<StreamInfo>::iterator it = mStreams.begin();
- it != mStreams.end(); ++it) {
+ List<StreamInfo>::iterator it = mStreams.begin();
+ while (it != mStreams.end()) {
if ((*it).mIsInjected) {
+ ++it;
continue;
}
+ status_t err = OK;
if (FD_ISSET(it->mRTPSocket, &rs)) {
- receive(&*it, true);
+ err = receive(&*it, true);
}
- if (FD_ISSET(it->mRTCPSocket, &rs)) {
- receive(&*it, false);
+ if (err == OK && FD_ISSET(it->mRTCPSocket, &rs)) {
+ err = receive(&*it, false);
}
+
+ if (err == -ECONNRESET) {
+ // socket failure, this stream is dead, Jim.
+
+ LOGW("failed to receive RTP/RTCP datagram.");
+ it = mStreams.erase(it);
+ continue;
+ }
+
+ ++it;
}
}
- postPollEvent();
-
int64_t nowUs = ALooper::GetNowUs();
if (mLastReceiverReportTimeUs <= 0
|| mLastReceiverReportTimeUs + 5000000ll <= nowUs) {
sp<ABuffer> buffer = new ABuffer(kMaxUDPSize);
- for (List<StreamInfo>::iterator it = mStreams.begin();
- it != mStreams.end(); ++it) {
+ List<StreamInfo>::iterator it = mStreams.begin();
+ while (it != mStreams.end()) {
StreamInfo *s = &*it;
if (s->mIsInjected) {
+ ++it;
continue;
}
if (s->mNumRTCPPacketsReceived == 0) {
// We have never received any RTCP packets on this stream,
// we don't even know where to send a report.
+ ++it;
continue;
}
@@ -327,16 +338,34 @@
if (buffer->size() > 0) {
LOGV("Sending RR...");
- ssize_t n = sendto(
+ ssize_t n;
+ do {
+ n = sendto(
s->mRTCPSocket, buffer->data(), buffer->size(), 0,
(const struct sockaddr *)&s->mRemoteRTCPAddr,
sizeof(s->mRemoteRTCPAddr));
+ } while (n < 0 && errno == EINTR);
+
+ if (n <= 0) {
+ LOGW("failed to send RTCP receiver report (%s).",
+ n == 0 ? "connection gone" : strerror(errno));
+
+ it = mStreams.erase(it);
+ continue;
+ }
+
CHECK_EQ(n, (ssize_t)buffer->size());
mLastReceiverReportTimeUs = nowUs;
}
+
+ ++it;
}
}
+
+ if (!mStreams.empty()) {
+ postPollEvent();
+ }
}
status_t ARTPConnection::receive(StreamInfo *s, bool receiveRTP) {
@@ -350,16 +379,19 @@
(!receiveRTP && s->mNumRTCPPacketsReceived == 0)
? sizeof(s->mRemoteRTCPAddr) : 0;
- ssize_t nbytes = recvfrom(
+ ssize_t nbytes;
+ do {
+ nbytes = recvfrom(
receiveRTP ? s->mRTPSocket : s->mRTCPSocket,
buffer->data(),
buffer->capacity(),
0,
remoteAddrLen > 0 ? (struct sockaddr *)&s->mRemoteRTCPAddr : NULL,
remoteAddrLen > 0 ? &remoteAddrLen : NULL);
+ } while (nbytes < 0 && errno == EINTR);
- if (nbytes < 0) {
- return -1;
+ if (nbytes <= 0) {
+ return -ECONNRESET;
}
buffer->setRange(0, nbytes);
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp
index bd0e491..4f0363b 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTSPConnection.cpp
@@ -187,10 +187,13 @@
return true;
}
-static void MakeSocketBlocking(int s, bool blocking) {
+static status_t MakeSocketBlocking(int s, bool blocking) {
// Make socket non-blocking.
int flags = fcntl(s, F_GETFL, 0);
- CHECK_NE(flags, -1);
+
+ if (flags == -1) {
+ return UNKNOWN_ERROR;
+ }
if (blocking) {
flags &= ~O_NONBLOCK;
@@ -198,7 +201,9 @@
flags |= O_NONBLOCK;
}
- CHECK_NE(fcntl(s, F_SETFL, flags), -1);
+ flags = fcntl(s, F_SETFL, flags);
+
+ return flags == -1 ? UNKNOWN_ERROR : OK;
}
void ARTSPConnection::onConnect(const sp<AMessage> &msg) {
@@ -302,27 +307,32 @@
reply->post();
}
+void ARTSPConnection::performDisconnect() {
+ if (mUIDValid) {
+ HTTPBase::UnRegisterSocketUserTag(mSocket);
+ }
+ close(mSocket);
+ mSocket = -1;
+
+ flushPendingRequests();
+
+ mUser.clear();
+ mPass.clear();
+ mAuthType = NONE;
+ mNonce.clear();
+
+ mState = DISCONNECTED;
+}
+
void ARTSPConnection::onDisconnect(const sp<AMessage> &msg) {
if (mState == CONNECTED || mState == CONNECTING) {
- if (mUIDValid) {
- HTTPBase::UnRegisterSocketUserTag(mSocket);
- }
- close(mSocket);
- mSocket = -1;
-
- flushPendingRequests();
+ performDisconnect();
}
sp<AMessage> reply;
CHECK(msg->findMessage("reply", &reply));
reply->setInt32("result", OK);
- mState = DISCONNECTED;
-
- mUser.clear();
- mPass.clear();
- mAuthType = NONE;
- mNonce.clear();
reply->post();
}
@@ -427,21 +437,25 @@
send(mSocket, request.c_str() + numBytesSent,
request.size() - numBytesSent, 0);
- if (n == 0) {
- // Server closed the connection.
- LOGE("Server unexpectedly closed the connection.");
+ if (n < 0 && errno == EINTR) {
+ continue;
+ }
- reply->setInt32("result", ERROR_IO);
- reply->post();
- return;
- } else if (n < 0) {
- if (errno == EINTR) {
- continue;
+ if (n <= 0) {
+ performDisconnect();
+
+ if (n == 0) {
+ // Server closed the connection.
+ LOGE("Server unexpectedly closed the connection.");
+
+ reply->setInt32("result", ERROR_IO);
+ reply->post();
+ } else {
+ LOGE("Error sending rtsp request. (%s)", strerror(errno));
+ reply->setInt32("result", -errno);
+ reply->post();
}
- LOGE("Error sending rtsp request.");
- reply->setInt32("result", -errno);
- reply->post();
return;
}
@@ -512,17 +526,22 @@
size_t offset = 0;
while (offset < size) {
ssize_t n = recv(mSocket, (uint8_t *)data + offset, size - offset, 0);
- if (n == 0) {
- // Server closed the connection.
- LOGE("Server unexpectedly closed the connection.");
- return ERROR_IO;
- } else if (n < 0) {
- if (errno == EINTR) {
- continue;
- }
- LOGE("Error reading rtsp response.");
- return -errno;
+ if (n < 0 && errno == EINTR) {
+ continue;
+ }
+
+ if (n <= 0) {
+ performDisconnect();
+
+ if (n == 0) {
+ // Server closed the connection.
+ LOGE("Server unexpectedly closed the connection.");
+ return ERROR_IO;
+ } else {
+ LOGE("Error reading rtsp response. (%s)", strerror(errno));
+ return -errno;
+ }
}
offset += (size_t)n;
@@ -681,24 +700,8 @@
if (contentLength > 0) {
response->mContent = new ABuffer(contentLength);
- size_t numBytesRead = 0;
- while (numBytesRead < contentLength) {
- ssize_t n = recv(
- mSocket, response->mContent->data() + numBytesRead,
- contentLength - numBytesRead, 0);
-
- if (n == 0) {
- // Server closed the connection.
- TRESPASS();
- } else if (n < 0) {
- if (errno == EINTR) {
- continue;
- }
-
- TRESPASS();
- }
-
- numBytesRead += (size_t)n;
+ if (receive(response->mContent->data(), contentLength) != OK) {
+ return false;
}
}
@@ -765,17 +768,20 @@
send(mSocket, response.c_str() + numBytesSent,
response.size() - numBytesSent, 0);
- if (n == 0) {
- // Server closed the connection.
- LOGE("Server unexpectedly closed the connection.");
+ if (n < 0 && errno == EINTR) {
+ continue;
+ }
- return false;
- } else if (n < 0) {
- if (errno == EINTR) {
- continue;
+ if (n <= 0) {
+ if (n == 0) {
+ // Server closed the connection.
+ LOGE("Server unexpectedly closed the connection.");
+ } else {
+ LOGE("Error sending rtsp response (%s).", strerror(errno));
}
- LOGE("Error sending rtsp response.");
+ performDisconnect();
+
return false;
}
diff --git a/media/libstagefright/rtsp/ARTSPConnection.h b/media/libstagefright/rtsp/ARTSPConnection.h
index 5cb84fd..68f2d59 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.h
+++ b/media/libstagefright/rtsp/ARTSPConnection.h
@@ -91,6 +91,8 @@
AString mUserAgent;
+ void performDisconnect();
+
void onConnect(const sp<AMessage> &msg);
void onDisconnect(const sp<AMessage> &msg);
void onCompleteConnection(const sp<AMessage> &msg);
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index af7dd23..794c60b 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -44,12 +44,14 @@
// If no access units are received within 5 secs, assume that the rtp
// stream has ended and signal end of stream.
-static int64_t kAccessUnitTimeoutUs = 5000000ll;
+static int64_t kAccessUnitTimeoutUs = 10000000ll;
// If no access units arrive for the first 10 secs after starting the
// stream, assume none ever will and signal EOS or switch transports.
static int64_t kStartupTimeoutUs = 10000000ll;
+static int64_t kDefaultKeepAliveTimeoutUs = 60000000ll;
+
namespace android {
static void MakeUserAgentString(AString *s) {
@@ -130,7 +132,9 @@
mTryFakeRTCP(false),
mReceivedFirstRTCPPacket(false),
mReceivedFirstRTPPacket(false),
- mSeekable(false) {
+ mSeekable(false),
+ mKeepAliveTimeoutUs(kDefaultKeepAliveTimeoutUs),
+ mKeepAliveGeneration(0) {
mNetLooper->setName("rtsp net");
mNetLooper->start(false /* runOnCallingThread */,
false /* canCallJava */,
@@ -371,6 +375,8 @@
case 'disc':
{
+ ++mKeepAliveGeneration;
+
int32_t reconnect;
if (msg->findInt32("reconnect", &reconnect) && reconnect) {
sp<AMessage> reply = new AMessage('conn', id());
@@ -457,8 +463,17 @@
mBaseURL = tmp;
}
- CHECK_GT(mSessionDesc->countTracks(), 1u);
- setupTrack(1);
+ if (mSessionDesc->countTracks() < 2) {
+ // There's no actual tracks in this session.
+ // The first "track" is merely session meta
+ // data.
+
+ LOGW("Session doesn't contain any playable "
+ "tracks. Aborting.");
+ result = ERROR_UNSUPPORTED;
+ } else {
+ setupTrack(1);
+ }
}
}
}
@@ -502,6 +517,34 @@
CHECK_GE(i, 0);
mSessionID = response->mHeaders.valueAt(i);
+
+ mKeepAliveTimeoutUs = kDefaultKeepAliveTimeoutUs;
+ AString timeoutStr;
+ if (GetAttribute(
+ mSessionID.c_str(), "timeout", &timeoutStr)) {
+ char *end;
+ unsigned long timeoutSecs =
+ strtoul(timeoutStr.c_str(), &end, 10);
+
+ if (end == timeoutStr.c_str() || *end != '\0') {
+ LOGW("server specified malformed timeout '%s'",
+ timeoutStr.c_str());
+
+ mKeepAliveTimeoutUs = kDefaultKeepAliveTimeoutUs;
+ } else if (timeoutSecs < 15) {
+ LOGW("server specified too short a timeout "
+ "(%lu secs), using default.",
+ timeoutSecs);
+
+ mKeepAliveTimeoutUs = kDefaultKeepAliveTimeoutUs;
+ } else {
+ mKeepAliveTimeoutUs = timeoutSecs * 1000000ll;
+
+ LOGI("server specified timeout of %lu secs.",
+ timeoutSecs);
+ }
+ }
+
i = mSessionID.find(";");
if (i >= 0) {
// Remove options, i.e. ";timeout=90"
@@ -555,6 +598,9 @@
if (index < mSessionDesc->countTracks()) {
setupTrack(index);
} else if (mSetupTracksSuccessful) {
+ ++mKeepAliveGeneration;
+ postKeepAlive();
+
AString request = "PLAY ";
request.append(mSessionURL);
request.append(" RTSP/1.0\r\n");
@@ -606,6 +652,51 @@
break;
}
+ case 'aliv':
+ {
+ int32_t generation;
+ CHECK(msg->findInt32("generation", &generation));
+
+ if (generation != mKeepAliveGeneration) {
+ // obsolete event.
+ break;
+ }
+
+ AString request;
+ request.append("OPTIONS ");
+ request.append(mSessionURL);
+ request.append(" RTSP/1.0\r\n");
+ request.append("Session: ");
+ request.append(mSessionID);
+ request.append("\r\n");
+ request.append("\r\n");
+
+ sp<AMessage> reply = new AMessage('opts', id());
+ reply->setInt32("generation", mKeepAliveGeneration);
+ mConn->sendRequest(request.c_str(), reply);
+ break;
+ }
+
+ case 'opts':
+ {
+ int32_t result;
+ CHECK(msg->findInt32("result", &result));
+
+ LOGI("OPTIONS completed with result %d (%s)",
+ result, strerror(-result));
+
+ int32_t generation;
+ CHECK(msg->findInt32("generation", &generation));
+
+ if (generation != mKeepAliveGeneration) {
+ // obsolete event.
+ break;
+ }
+
+ postKeepAlive();
+ break;
+ }
+
case 'abor':
{
for (size_t i = 0; i < mTracks.size(); ++i) {
@@ -701,9 +792,13 @@
}
if (mNumAccessUnitsReceived == 0) {
+#if 1
LOGI("stream ended? aborting.");
(new AMessage('abor', id()))->post();
break;
+#else
+ LOGI("haven't seen an AU in a looong time.");
+#endif
}
mNumAccessUnitsReceived = 0;
@@ -952,6 +1047,12 @@
}
}
+ void postKeepAlive() {
+ sp<AMessage> msg = new AMessage('aliv', id());
+ msg->setInt32("generation", mKeepAliveGeneration);
+ msg->post((mKeepAliveTimeoutUs * 9) / 10);
+ }
+
void postAccessUnitTimeoutCheck() {
if (mCheckPending) {
return;
@@ -1120,6 +1221,8 @@
bool mReceivedFirstRTCPPacket;
bool mReceivedFirstRTPPacket;
bool mSeekable;
+ int64_t mKeepAliveTimeoutUs;
+ int32_t mKeepAliveGeneration;
Vector<TrackInfo> mTracks;
diff --git a/media/tests/players/invoke_mock_media_player.cpp b/media/tests/players/invoke_mock_media_player.cpp
index ed3051b..a6fdeea 100644
--- a/media/tests/players/invoke_mock_media_player.cpp
+++ b/media/tests/players/invoke_mock_media_player.cpp
@@ -68,7 +68,6 @@
}
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) {return OK;}
- virtual status_t setVideoSurface(const sp<Surface>& surface) {return OK;}
virtual status_t setVideoSurfaceTexture(
const sp<ISurfaceTexture>& surfaceTexture) {return OK;}
virtual status_t prepare() {return OK;}
diff --git a/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java b/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
index 99cbb86..62213de 100644
--- a/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
+++ b/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
@@ -16,8 +16,7 @@
package com.android.nfc_extras;
-import android.annotation.SdkConstant;
-import android.annotation.SdkConstant.SdkConstantType;
+import android.content.Context;
import android.nfc.INfcAdapterExtras;
import android.nfc.NfcAdapter;
import android.os.RemoteException;
@@ -60,10 +59,14 @@
// best effort recovery
private static NfcAdapter sAdapter;
private static INfcAdapterExtras sService;
- private static NfcAdapterExtras sSingleton;
- private static NfcExecutionEnvironment sEmbeddedEe;
- private static CardEmulationRoute sRouteOff;
- private static CardEmulationRoute sRouteOnWhenScreenOn;
+ private static final CardEmulationRoute ROUTE_OFF =
+ new CardEmulationRoute(CardEmulationRoute.ROUTE_OFF, null);
+
+ private final NfcExecutionEnvironment mEmbeddedEe;
+ private final CardEmulationRoute mRouteOnWhenScreenOn;
+
+ final Context mContext;
+ final String mPackageName;
/** get service handles */
private static void initService() {
@@ -84,31 +87,35 @@
* @return the {@link NfcAdapterExtras} object for the given {@link NfcAdapter}
*/
public static NfcAdapterExtras get(NfcAdapter adapter) {
- synchronized(NfcAdapterExtras.class) {
- if (sSingleton == null) {
+ Context context = adapter.getContext();
+ if (context == null) {
+ throw new UnsupportedOperationException(
+ "You must pass a context to your NfcAdapter to use the NFC extras APIs");
+ }
+
+ synchronized (NfcAdapterExtras.class) {
+ if (sService == null) {
try {
sAdapter = adapter;
- sSingleton = new NfcAdapterExtras();
- sEmbeddedEe = new NfcExecutionEnvironment(sSingleton);
- sRouteOff = new CardEmulationRoute(CardEmulationRoute.ROUTE_OFF, null);
- sRouteOnWhenScreenOn = new CardEmulationRoute(
- CardEmulationRoute.ROUTE_ON_WHEN_SCREEN_ON, sEmbeddedEe);
initService();
} finally {
if (sService == null) {
- sRouteOnWhenScreenOn = null;
- sRouteOff = null;
- sEmbeddedEe = null;
- sSingleton = null;
sAdapter = null;
}
}
}
- return sSingleton;
}
+
+ return new NfcAdapterExtras(context);
}
- private NfcAdapterExtras() {}
+ private NfcAdapterExtras(Context context) {
+ mContext = context.getApplicationContext();
+ mPackageName = context.getPackageName();
+ mEmbeddedEe = new NfcExecutionEnvironment(this);
+ mRouteOnWhenScreenOn = new CardEmulationRoute(CardEmulationRoute.ROUTE_ON_WHEN_SCREEN_ON,
+ mEmbeddedEe);
+ }
/**
* Immutable data class that describes a card emulation route.
@@ -166,18 +173,16 @@
*
* <p class="note">
* Requires the {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} permission.
- *
- * @return
*/
public CardEmulationRoute getCardEmulationRoute() {
try {
- int route = sService.getCardEmulationRoute();
+ int route = sService.getCardEmulationRoute(mPackageName);
return route == CardEmulationRoute.ROUTE_OFF ?
- sRouteOff :
- sRouteOnWhenScreenOn;
+ ROUTE_OFF :
+ mRouteOnWhenScreenOn;
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
- return sRouteOff;
+ return ROUTE_OFF;
}
}
@@ -189,11 +194,11 @@
* <p class="note">
* Requires the {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} permission.
*
- * @param route a {@link #CardEmulationRoute}
+ * @param route a {@link CardEmulationRoute}
*/
public void setCardEmulationRoute(CardEmulationRoute route) {
try {
- sService.setCardEmulationRoute(route.route);
+ sService.setCardEmulationRoute(mPackageName, route.route);
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
}
@@ -201,7 +206,7 @@
/**
* Get the {@link NfcExecutionEnvironment} that is embedded with the
- * {@link NFcAdapter}.
+ * {@link NfcAdapter}.
*
* <p class="note">
* Requires the {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} permission.
@@ -209,7 +214,7 @@
* @return a {@link NfcExecutionEnvironment}, or null if there is no embedded NFC-EE
*/
public NfcExecutionEnvironment getEmbeddedExecutionEnvironment() {
- return sEmbeddedEe;
+ return mEmbeddedEe;
}
/**
@@ -218,12 +223,12 @@
* Some implementations of NFC Adapter Extras may require applications
* to authenticate with a token, before using other methods.
*
- * @param a implementation specific token
- * @throws a {@link java.lang.SecurityException} if authentication failed
+ * @param token a implementation specific token
+ * @throws java.lang.SecurityException if authentication failed
*/
public void authenticate(byte[] token) {
try {
- sService.authenticate(token);
+ sService.authenticate(mPackageName, token);
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
}
diff --git a/nfc-extras/java/com/android/nfc_extras/NfcExecutionEnvironment.java b/nfc-extras/java/com/android/nfc_extras/NfcExecutionEnvironment.java
index 63c2de2..f47327a 100644
--- a/nfc-extras/java/com/android/nfc_extras/NfcExecutionEnvironment.java
+++ b/nfc-extras/java/com/android/nfc_extras/NfcExecutionEnvironment.java
@@ -16,20 +16,17 @@
package com.android.nfc_extras;
-import java.io.IOException;
-
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
-import android.content.Context;
-import android.nfc.INfcAdapterExtras;
-import android.nfc.NfcAdapter;
import android.os.Binder;
import android.os.Bundle;
-import android.os.IBinder;
import android.os.RemoteException;
+import java.io.IOException;
+
public class NfcExecutionEnvironment {
private final NfcAdapterExtras mExtras;
+ private final Binder mToken;
/**
* Broadcast Action: An ISO-DEP AID was selected.
@@ -115,6 +112,7 @@
NfcExecutionEnvironment(NfcAdapterExtras extras) {
mExtras = extras;
+ mToken = new Binder();
}
/**
@@ -133,7 +131,7 @@
*/
public void open() throws IOException {
try {
- Bundle b = mExtras.getService().open(new Binder());
+ Bundle b = mExtras.getService().open(mExtras.mPackageName, mToken);
throwBundle(b);
} catch (RemoteException e) {
mExtras.attemptDeadServiceRecovery(e);
@@ -151,7 +149,7 @@
*/
public void close() throws IOException {
try {
- throwBundle(mExtras.getService().close());
+ throwBundle(mExtras.getService().close(mExtras.mPackageName, mToken));
} catch (RemoteException e) {
mExtras.attemptDeadServiceRecovery(e);
throw new IOException("NFC Service was dead");
@@ -169,7 +167,7 @@
public byte[] transceive(byte[] in) throws IOException {
Bundle b;
try {
- b = mExtras.getService().transceive(in);
+ b = mExtras.getService().transceive(mExtras.mPackageName, in);
} catch (RemoteException e) {
mExtras.attemptDeadServiceRecovery(e);
throw new IOException("NFC Service was dead, need to re-open");
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h
index a08932a..8e8e26c 100644
--- a/opengl/include/EGL/eglext.h
+++ b/opengl/include/EGL/eglext.h
@@ -256,6 +256,21 @@
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void);
#endif
+
+/* EGL_ANDROID_blob_cache
+ */
+#ifndef EGL_ANDROID_blob_cache
+#define EGL_ANDROID_blob_cache 1
+typedef khronos_ssize_t EGLsizei;
+typedef void (*EGLSetBlobFunc) (const void* key, EGLsizei keySize, const void* value, EGLsizei valueSize);
+typedef EGLsizei (*EGLGetBlobFunc) (const void* key, EGLsizei keySize, void* value, EGLsizei valueSize);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncs(EGLDisplay dpy, EGLSetBlobFunc set, EGLGetBlobFunc get);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSPROC) (EGLDisplay dpy,
+ EGLSetBlobFunc set, EGLGetBlobFunc get);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/opengl/java/android/opengl/EGLLogWrapper.java b/opengl/java/android/opengl/EGLLogWrapper.java
index 6c0fdb3..36e88a2 100644
--- a/opengl/java/android/opengl/EGLLogWrapper.java
+++ b/opengl/java/android/opengl/EGLLogWrapper.java
@@ -314,6 +314,16 @@
checkError();
return result;
}
+
+ /** @hide **/
+ public boolean eglReleaseThread() {
+ begin("eglReleaseThread");
+ end();
+ boolean result = mEgl10.eglReleaseThread();
+ returns(result);
+ checkError();
+ return result;
+ }
public boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface) {
begin("eglInitialize");
diff --git a/opengl/java/com/google/android/gles_jni/EGLImpl.java b/opengl/java/com/google/android/gles_jni/EGLImpl.java
index 51d6ca8..6992019 100644
--- a/opengl/java/com/google/android/gles_jni/EGLImpl.java
+++ b/opengl/java/com/google/android/gles_jni/EGLImpl.java
@@ -31,6 +31,8 @@
public native boolean eglInitialize(EGLDisplay display, int[] major_minor);
public native boolean eglQueryContext(EGLDisplay display, EGLContext context, int attribute, int[] value);
public native boolean eglQuerySurface(EGLDisplay display, EGLSurface surface, int attribute, int[] value);
+ /** @hide **/
+ public native boolean eglReleaseThread();
public native boolean eglChooseConfig(EGLDisplay display, int[] attrib_list, EGLConfig[] configs, int config_size, int[] num_config);
public native boolean eglGetConfigAttrib(EGLDisplay display, EGLConfig config, int attribute, int[] value);
public native boolean eglGetConfigs(EGLDisplay display, EGLConfig[] configs, int config_size, int[] num_config);
@@ -44,6 +46,9 @@
public native boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface, Object native_pixmap);
public native boolean eglWaitGL();
public native boolean eglWaitNative(int engine, Object bindTarget);
+
+ /** @hide **/
+ public static native int getInitCount(EGLDisplay display);
public EGLContext eglCreateContext(EGLDisplay display, EGLConfig config, EGLContext share_context, int[] attrib_list) {
int eglContextId = _eglCreateContext(display, config, share_context, attrib_list);
@@ -85,7 +90,7 @@
eglSurfaceId = _eglCreateWindowSurface(display, config, sur, attrib_list);
} else if (native_window instanceof SurfaceTexture) {
eglSurfaceId = _eglCreateWindowSurfaceTexture(display, config,
- (SurfaceTexture) native_window, attrib_list);
+ native_window, attrib_list);
} else {
throw new java.lang.UnsupportedOperationException(
"eglCreateWindowSurface() can only be called with an instance of " +
diff --git a/opengl/java/javax/microedition/khronos/egl/EGL10.java b/opengl/java/javax/microedition/khronos/egl/EGL10.java
index 2ae793a..cf58888 100644
--- a/opengl/java/javax/microedition/khronos/egl/EGL10.java
+++ b/opengl/java/javax/microedition/khronos/egl/EGL10.java
@@ -114,6 +114,8 @@
boolean eglQueryContext(EGLDisplay display, EGLContext context, int attribute, int[] value);
String eglQueryString(EGLDisplay display, int name);
boolean eglQuerySurface(EGLDisplay display, EGLSurface surface, int attribute, int[] value);
+ /** @hide **/
+ boolean eglReleaseThread();
boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface);
boolean eglTerminate(EGLDisplay display);
boolean eglWaitGL();
diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp
index 1e64302..522421b 100644
--- a/opengl/libs/EGL/egl_cache.cpp
+++ b/opengl/libs/EGL/egl_cache.cpp
@@ -19,6 +19,24 @@
#include "egl_impl.h"
#include "egldefs.h"
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+// Cache size limits.
+static const size_t maxKeySize = 1024;
+static const size_t maxValueSize = 4096;
+static const size_t maxTotalSize = 64 * 1024;
+
+// Cache file header
+static const char* cacheFileMagic = "EGL$";
+static const size_t cacheFileHeaderSize = 8;
+
+// The time in seconds to wait before saving newly inserted cache entries.
+static const unsigned int deferredSaveDelay = 4;
+
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
@@ -26,37 +44,37 @@
#define BC_EXT_STR "EGL_ANDROID_blob_cache"
//
-// EGL_ANDROID_blob_cache types and functions
-//
-typedef khronos_ssize_t EGLsizei;
-
-typedef void (*EGLSetBlobFunc) (const void* key, EGLsizei keySize,
- const void* value, EGLsizei valueSize);
-
-typedef EGLsizei (*EGLGetBlobFunc) (const void* key, EGLsizei keySize,
- void* value, EGLsizei valueSize);
-
-typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSPROC) (EGLDisplay dpy,
- EGLSetBlobFunc set, EGLGetBlobFunc get);
-
-//
-// egl_cache_t definition
+// Callback functions passed to EGL.
//
static void setBlob(const void* key, EGLsizei keySize, const void* value,
EGLsizei valueSize) {
+ egl_cache_t::get()->setBlob(key, keySize, value, valueSize);
}
static EGLsizei getBlob(const void* key, EGLsizei keySize, void* value,
EGLsizei valueSize) {
- return 0;
+ return egl_cache_t::get()->getBlob(key, keySize, value, valueSize);
}
+//
+// egl_cache_t definition
+//
+egl_cache_t::egl_cache_t() :
+ mInitialized(false),
+ mBlobCache(NULL) {
+}
+
+egl_cache_t::~egl_cache_t() {
+}
+
+egl_cache_t egl_cache_t::sCache;
+
egl_cache_t* egl_cache_t::get() {
- static egl_cache_t theCache;
- return &theCache;
+ return &sCache;
}
void egl_cache_t::initialize(egl_display_t *display) {
+ Mutex::Autolock lock(mMutex);
for (int i = 0; i < IMPL_NUM_IMPLEMENTATIONS; i++) {
egl_connection_t* const cnx = &gEGLImpl[i];
if (cnx->dso && cnx->major >= 0 && cnx->minor >= 0) {
@@ -79,7 +97,8 @@
continue;
}
- eglSetBlobCacheFuncs(display->disp[i].dpy, setBlob, getBlob);
+ eglSetBlobCacheFuncs(display->disp[i].dpy, android::setBlob,
+ android::getBlob);
EGLint err = cnx->egl.eglGetError();
if (err != EGL_SUCCESS) {
LOGE("eglSetBlobCacheFuncs resulted in an error: %#x",
@@ -88,6 +107,234 @@
}
}
}
+ mInitialized = true;
+}
+
+void egl_cache_t::terminate() {
+ Mutex::Autolock lock(mMutex);
+ if (mBlobCache != NULL) {
+ saveBlobCacheLocked();
+ mBlobCache = NULL;
+ }
+ mInitialized = false;
+}
+
+void egl_cache_t::setBlob(const void* key, EGLsizei keySize, const void* value,
+ EGLsizei valueSize) {
+ Mutex::Autolock lock(mMutex);
+
+ if (keySize < 0 || valueSize < 0) {
+ LOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
+ return;
+ }
+
+ if (mInitialized) {
+ sp<BlobCache> bc = getBlobCacheLocked();
+ bc->set(key, keySize, value, valueSize);
+
+ if (!mSavePending) {
+ class DeferredSaveThread : public Thread {
+ public:
+ DeferredSaveThread() : Thread(false) {}
+
+ virtual bool threadLoop() {
+ sleep(deferredSaveDelay);
+ egl_cache_t* c = egl_cache_t::get();
+ Mutex::Autolock lock(c->mMutex);
+ if (c->mInitialized) {
+ c->saveBlobCacheLocked();
+ }
+ c->mSavePending = false;
+ return false;
+ }
+ };
+
+ // The thread will hold a strong ref to itself until it has finished
+ // running, so there's no need to keep a ref around.
+ sp<Thread> deferredSaveThread(new DeferredSaveThread());
+ mSavePending = true;
+ deferredSaveThread->run();
+ }
+ }
+}
+
+EGLsizei egl_cache_t::getBlob(const void* key, EGLsizei keySize, void* value,
+ EGLsizei valueSize) {
+ Mutex::Autolock lock(mMutex);
+
+ if (keySize < 0 || valueSize < 0) {
+ LOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
+ return 0;
+ }
+
+ if (mInitialized) {
+ sp<BlobCache> bc = getBlobCacheLocked();
+ return bc->get(key, keySize, value, valueSize);
+ }
+ return 0;
+}
+
+void egl_cache_t::setCacheFilename(const char* filename) {
+ Mutex::Autolock lock(mMutex);
+ mFilename = filename;
+}
+
+sp<BlobCache> egl_cache_t::getBlobCacheLocked() {
+ if (mBlobCache == NULL) {
+ mBlobCache = new BlobCache(maxKeySize, maxValueSize, maxTotalSize);
+ loadBlobCacheLocked();
+ }
+ return mBlobCache;
+}
+
+static uint32_t crc32c(const uint8_t* buf, size_t len) {
+ const uint32_t polyBits = 0x82F63B78;
+ uint32_t r = 0;
+ for (size_t i = 0; i < len; i++) {
+ r ^= buf[i];
+ for (int j = 0; j < 8; j++) {
+ if (r & 1) {
+ r = (r >> 1) ^ polyBits;
+ } else {
+ r >>= 1;
+ }
+ }
+ }
+ return r;
+}
+
+void egl_cache_t::saveBlobCacheLocked() {
+ if (mFilename.length() > 0) {
+ size_t cacheSize = mBlobCache->getFlattenedSize();
+ size_t headerSize = cacheFileHeaderSize;
+ const char* fname = mFilename.string();
+
+ // Try to create the file with no permissions so we can write it
+ // without anyone trying to read it.
+ int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0);
+ if (fd == -1) {
+ if (errno == EEXIST) {
+ // The file exists, delete it and try again.
+ if (unlink(fname) == -1) {
+ // No point in retrying if the unlink failed.
+ LOGE("error unlinking cache file %s: %s (%d)", fname,
+ strerror(errno), errno);
+ return;
+ }
+ // Retry now that we've unlinked the file.
+ fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0);
+ }
+ if (fd == -1) {
+ LOGE("error creating cache file %s: %s (%d)", fname,
+ strerror(errno), errno);
+ return;
+ }
+ }
+
+ size_t fileSize = headerSize + cacheSize;
+ if (ftruncate(fd, fileSize) == -1) {
+ LOGE("error setting cache file size: %s (%d)", strerror(errno),
+ errno);
+ close(fd);
+ unlink(fname);
+ return;
+ }
+
+ uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
+ PROT_WRITE, MAP_SHARED, fd, 0));
+ if (buf == MAP_FAILED) {
+ LOGE("error mmaping cache file: %s (%d)", strerror(errno),
+ errno);
+ close(fd);
+ unlink(fname);
+ return;
+ }
+
+ status_t err = mBlobCache->flatten(buf + headerSize, cacheSize, NULL,
+ 0);
+ if (err != OK) {
+ LOGE("error writing cache contents: %s (%d)", strerror(-err),
+ -err);
+ munmap(buf, fileSize);
+ close(fd);
+ unlink(fname);
+ return;
+ }
+
+ // Write the file magic and CRC
+ memcpy(buf, cacheFileMagic, 4);
+ uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
+ *crc = crc32c(buf + headerSize, cacheSize);
+
+ munmap(buf, fileSize);
+ fchmod(fd, S_IRUSR);
+ close(fd);
+ }
+}
+
+void egl_cache_t::loadBlobCacheLocked() {
+ if (mFilename.length() > 0) {
+ size_t headerSize = cacheFileHeaderSize;
+
+ int fd = open(mFilename.string(), O_RDONLY, 0);
+ if (fd == -1) {
+ if (errno != ENOENT) {
+ LOGE("error opening cache file %s: %s (%d)", mFilename.string(),
+ strerror(errno), errno);
+ }
+ return;
+ }
+
+ struct stat statBuf;
+ if (fstat(fd, &statBuf) == -1) {
+ LOGE("error stat'ing cache file: %s (%d)", strerror(errno), errno);
+ close(fd);
+ return;
+ }
+
+ // Sanity check the size before trying to mmap it.
+ size_t fileSize = statBuf.st_size;
+ if (fileSize > maxTotalSize * 2) {
+ LOGE("cache file is too large: %#llx", statBuf.st_size);
+ close(fd);
+ return;
+ }
+
+ uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+ if (buf == MAP_FAILED) {
+ LOGE("error mmaping cache file: %s (%d)", strerror(errno),
+ errno);
+ close(fd);
+ return;
+ }
+
+ // Check the file magic and CRC
+ size_t cacheSize = fileSize - headerSize;
+ if (memcmp(buf, cacheFileMagic, 4) != 0) {
+ LOGE("cache file has bad mojo");
+ close(fd);
+ return;
+ }
+ uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
+ if (crc32c(buf + headerSize, cacheSize) != *crc) {
+ LOGE("cache file failed CRC check");
+ close(fd);
+ return;
+ }
+
+ status_t err = mBlobCache->unflatten(buf + headerSize, cacheSize, NULL, 0);
+ if (err != OK) {
+ LOGE("error reading cache contents: %s (%d)", strerror(-err),
+ -err);
+ munmap(buf, fileSize);
+ close(fd);
+ return;
+ }
+
+ munmap(buf, fileSize);
+ close(fd);
+ }
}
// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/egl_cache.h b/opengl/libs/EGL/egl_cache.h
index 1fcfacc..4389623 100644
--- a/opengl/libs/EGL/egl_cache.h
+++ b/opengl/libs/EGL/egl_cache.h
@@ -14,20 +14,117 @@
** limitations under the License.
*/
+#ifndef ANDROID_EGL_CACHE_H
+#define ANDROID_EGL_CACHE_H
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include <utils/BlobCache.h>
+#include <utils/String8.h>
+#include <utils/StrongPointer.h>
+
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
class egl_display_t;
-class egl_cache_t {
+class EGLAPI egl_cache_t {
public:
+ // get returns a pointer to the singleton egl_cache_t object. This
+ // singleton object will never be destroyed.
static egl_cache_t* get();
+ // initialize puts the egl_cache_t into an initialized state, such that it
+ // is able to insert and retrieve entries from the cache. This should be
+ // called when EGL is initialized. When not in the initialized state the
+ // getBlob and setBlob methods will return without performing any cache
+ // operations.
void initialize(egl_display_t* display);
+
+ // terminate puts the egl_cache_t back into the uninitialized state. When
+ // in this state the getBlob and setBlob methods will return without
+ // performing any cache operations.
+ void terminate();
+
+ // setBlob attempts to insert a new key/value blob pair into the cache.
+ // This will be called by the hardware vendor's EGL implementation via the
+ // EGL_ANDROID_blob_cache extension.
+ void setBlob(const void* key, EGLsizei keySize, const void* value,
+ EGLsizei valueSize);
+
+ // getBlob attempts to retrieve the value blob associated with a given key
+ // blob from cache. This will be called by the hardware vendor's EGL
+ // implementation via the EGL_ANDROID_blob_cache extension.
+ EGLsizei getBlob(const void* key, EGLsizei keySize, void* value,
+ EGLsizei valueSize);
+
+ // setCacheFilename sets the name of the file that should be used to store
+ // cache contents from one program invocation to another.
+ void setCacheFilename(const char* filename);
+
+private:
+ // Creation and (the lack of) destruction is handled internally.
+ egl_cache_t();
+ ~egl_cache_t();
+
+ // Copying is disallowed.
+ egl_cache_t(const egl_cache_t&); // not implemented
+ void operator=(const egl_cache_t&); // not implemented
+
+ // getBlobCacheLocked returns the BlobCache object being used to store the
+ // key/value blob pairs. If the BlobCache object has not yet been created,
+ // this will do so, loading the serialized cache contents from disk if
+ // possible.
+ sp<BlobCache> getBlobCacheLocked();
+
+ // saveBlobCache attempts to save the current contents of mBlobCache to
+ // disk.
+ void saveBlobCacheLocked();
+
+ // loadBlobCache attempts to load the saved cache contents from disk into
+ // mBlobCache.
+ void loadBlobCacheLocked();
+
+ // mInitialized indicates whether the egl_cache_t is in the initialized
+ // state. It is initialized to false at construction time, and gets set to
+ // true when initialize is called. It is set back to false when terminate
+ // is called. When in this state, the cache behaves as normal. When not,
+ // the getBlob and setBlob methods will return without performing any cache
+ // operations.
+ bool mInitialized;
+
+ // mBlobCache is the cache in which the key/value blob pairs are stored. It
+ // is initially NULL, and will be initialized by getBlobCacheLocked the
+ // first time it's needed.
+ sp<BlobCache> mBlobCache;
+
+ // mFilename is the name of the file for storing cache contents in between
+ // program invocations. It is initialized to an empty string at
+ // construction time, and can be set with the setCacheFilename method. An
+ // empty string indicates that the cache should not be saved to or restored
+ // from disk.
+ String8 mFilename;
+
+ // mSavePending indicates whether or not a deferred save operation is
+ // pending. Each time a key/value pair is inserted into the cache via
+ // setBlob, a deferred save is initiated if one is not already pending.
+ // This will wait some amount of time and then trigger a save of the cache
+ // contents to disk.
+ bool mSavePending;
+
+ // mMutex is the mutex used to prevent concurrent access to the member
+ // variables. It must be locked whenever the member variables are accessed.
+ mutable Mutex mMutex;
+
+ // sCache is the singleton egl_cache_t object.
+ static egl_cache_t sCache;
};
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
+
+#endif // ANDROID_EGL_CACHE_H
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 0f92864..558ca77 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -44,6 +44,7 @@
egl_display_t::~egl_display_t() {
magic = 0;
+ egl_cache_t::get()->terminate();
}
egl_display_t* egl_display_t::get(EGLDisplay dpy) {
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
index 113595f..e0a367d 100644
--- a/opengl/libs/EGL/egl_display.h
+++ b/opengl/libs/EGL/egl_display.h
@@ -59,7 +59,7 @@
// ----------------------------------------------------------------------------
-class egl_display_t {
+class EGLAPI egl_display_t { // marked as EGLAPI for testing purposes
static egl_display_t sDisplay[NUM_DISPLAYS];
EGLDisplay getDisplay(EGLNativeDisplayType display);
@@ -91,6 +91,8 @@
inline bool isValid() const { return magic == '_dpy'; }
inline bool isAlive() const { return isValid(); }
+ inline uint32_t getRefsCount() const { return refs; }
+
struct strings_t {
char const * vendor;
char const * version;
@@ -141,4 +143,3 @@
// ----------------------------------------------------------------------------
#endif // ANDROID_EGL_DISPLAY_H
-
diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk
index 92d7eb1..14104d17 100644
--- a/opengl/tests/EGLTest/Android.mk
+++ b/opengl/tests/EGLTest/Android.mk
@@ -7,6 +7,7 @@
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
+ egl_cache_test.cpp \
EGL_test.cpp \
LOCAL_SHARED_LIBRARIES := \
@@ -21,9 +22,12 @@
LOCAL_C_INCLUDES := \
bionic \
+ bionic/libc/private \
bionic/libstdc++/include \
external/gtest/include \
external/stlport/stlport \
+ frameworks/base/opengl/libs \
+ frameworks/base/opengl/libs/EGL \
include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/EGLTest/egl_cache_test.cpp b/opengl/tests/EGLTest/egl_cache_test.cpp
new file mode 100644
index 0000000..c7d9e3e
--- /dev/null
+++ b/opengl/tests/EGLTest/egl_cache_test.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#define LOG_TAG "EGL_test"
+//#define LOG_NDEBUG 0
+
+#include <gtest/gtest.h>
+
+#include <utils/Log.h>
+
+#include "egl_cache.h"
+#include "egl_display.h"
+
+namespace android {
+
+class EGLCacheTest : public ::testing::Test {
+protected:
+ virtual void SetUp() {
+ mCache = egl_cache_t::get();
+ }
+
+ virtual void TearDown() {
+ mCache->setCacheFilename("");
+ mCache->terminate();
+ }
+
+ egl_cache_t* mCache;
+};
+
+TEST_F(EGLCacheTest, UninitializedCacheAlwaysMisses) {
+ char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+ mCache->setBlob("abcd", 4, "efgh", 4);
+ ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4));
+ ASSERT_EQ(0xee, buf[0]);
+ ASSERT_EQ(0xee, buf[1]);
+ ASSERT_EQ(0xee, buf[2]);
+ ASSERT_EQ(0xee, buf[3]);
+}
+
+TEST_F(EGLCacheTest, InitializedCacheAlwaysHits) {
+ char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+ mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
+ mCache->setBlob("abcd", 4, "efgh", 4);
+ ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4));
+ ASSERT_EQ('e', buf[0]);
+ ASSERT_EQ('f', buf[1]);
+ ASSERT_EQ('g', buf[2]);
+ ASSERT_EQ('h', buf[3]);
+}
+
+TEST_F(EGLCacheTest, TerminatedCacheAlwaysMisses) {
+ char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+ mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
+ mCache->setBlob("abcd", 4, "efgh", 4);
+ mCache->terminate();
+ ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4));
+ ASSERT_EQ(0xee, buf[0]);
+ ASSERT_EQ(0xee, buf[1]);
+ ASSERT_EQ(0xee, buf[2]);
+ ASSERT_EQ(0xee, buf[3]);
+}
+
+class EGLCacheSerializationTest : public EGLCacheTest {
+
+protected:
+
+ virtual void SetUp() {
+ EGLCacheTest::SetUp();
+
+ char* tn = tempnam("/sdcard", "EGL_test-cache-");
+ mFilename = tn;
+ free(tn);
+ }
+
+ virtual void TearDown() {
+ unlink(mFilename.string());
+ EGLCacheTest::TearDown();
+ }
+
+ String8 mFilename;
+};
+
+TEST_F(EGLCacheSerializationTest, ReinitializedCacheContainsValues) {
+ char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+ mCache->setCacheFilename(mFilename);
+ mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
+ mCache->setBlob("abcd", 4, "efgh", 4);
+ mCache->terminate();
+ mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
+ ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4));
+ ASSERT_EQ('e', buf[0]);
+ ASSERT_EQ('f', buf[1]);
+ ASSERT_EQ('g', buf[2]);
+ ASSERT_EQ('h', buf[3]);
+}
+
+}
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 3920257..7a98615 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -21,7 +21,7 @@
<integer name="def_screen_off_timeout">60000</integer>
<bool name="def_airplane_mode_on">false</bool>
<!-- Comma-separated list of bluetooth, wifi, and cell. -->
- <string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc</string>
+ <string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc,wimax</string>
<string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string>
<bool name="def_auto_time">true</bool>
<bool name="def_auto_time_zone">true</bool>
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png b/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png
index d697c2f..cd9a54a 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/scrubber_control_disabled_holo.png b/packages/SystemUI/res/drawable-hdpi/scrubber_control_disabled_holo.png
deleted file mode 100644
index 55f6aa1..0000000
--- a/packages/SystemUI/res/drawable-hdpi/scrubber_control_disabled_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/scrubber_control_holo.png b/packages/SystemUI/res/drawable-hdpi/scrubber_control_holo.png
deleted file mode 100644
index 19dae07..0000000
--- a/packages/SystemUI/res/drawable-hdpi/scrubber_control_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/scrubber_track_holo_dark.9.png b/packages/SystemUI/res/drawable-hdpi/scrubber_track_holo_dark.9.png
deleted file mode 100644
index 8811df5..0000000
--- a/packages/SystemUI/res/drawable-hdpi/scrubber_track_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png
new file mode 100644
index 0000000..f24d801
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png
new file mode 100644
index 0000000..66eb5db
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png
new file mode 100644
index 0000000..edff74a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png
new file mode 100644
index 0000000..1cdd4eb
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png
new file mode 100644
index 0000000..95fdaf9
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png
new file mode 100644
index 0000000..8678e39
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png
new file mode 100644
index 0000000..1d2d290
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
new file mode 100644
index 0000000..c2e4b78
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
new file mode 100644
index 0000000..51b839f
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png
new file mode 100644
index 0000000..b20c5c7
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png b/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png
index 839c134..5661eaf 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/scrubber_control_disabled_holo.png b/packages/SystemUI/res/drawable-mdpi/scrubber_control_disabled_holo.png
deleted file mode 100644
index 2b8768b..0000000
--- a/packages/SystemUI/res/drawable-mdpi/scrubber_control_disabled_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png b/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png
deleted file mode 100644
index 0672564..0000000
--- a/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/scrubber_track_holo_dark.9.png b/packages/SystemUI/res/drawable-mdpi/scrubber_track_holo_dark.9.png
deleted file mode 100644
index 511d5c3..0000000
--- a/packages/SystemUI/res/drawable-mdpi/scrubber_track_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_normal.9.png
index 60bd807..88137e8 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_normal.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_pressed.9.png
index 7fb5b20..6507a51 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_pressed.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_normal.9.png
index 8354fef..798f589 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_normal.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_pressed.9.png
index f32980d..73247e5 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_pressed.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_normal.9.png
index dbfce78..2b46c89 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_normal.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_pressed.9.png
index 37313e9..dd476b7 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_pressed.9.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notification_open.png b/packages/SystemUI/res/drawable-xhdpi/ic_notification_open.png
index 4f8c987..98455cf 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notification_open.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notification_open.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/scrubber_control_disabled_holo.png b/packages/SystemUI/res/drawable-xhdpi/scrubber_control_disabled_holo.png
deleted file mode 100644
index 551c6dc..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/scrubber_control_disabled_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/scrubber_control_holo.png b/packages/SystemUI/res/drawable-xhdpi/scrubber_control_holo.png
deleted file mode 100644
index 11f9c51..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/scrubber_control_holo.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/scrubber_track_holo_dark.9.png b/packages/SystemUI/res/drawable-xhdpi/scrubber_track_holo_dark.9.png
deleted file mode 100644
index b28dddf..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/scrubber_track_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
index fecef3d..46f4c39 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
@@ -39,39 +39,39 @@
<ImageView
android:id="@+id/bluetooth"
- android:layout_height="32dp"
- android:layout_width="32dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:scaleType="centerInside"
- android:baseline="22dp"
+ android:baseline="18dp"
android:visibility="gone"
android:contentDescription="@null"
/>
<FrameLayout
android:id="@+id/netwerk"
- android:layout_height="32dp"
- android:layout_width="32dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_marginRight="4dp"
>
<ImageView
android:id="@+id/network_signal"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:contentDescription="@null"
/>
<ImageView
android:id="@+id/network_type"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:contentDescription="@null"
/>
<ImageView
android:id="@+id/network_direction"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:contentDescription="@null"
/>
@@ -91,12 +91,14 @@
<ImageView
android:id="@+id/battery"
- android:layout_height="32dp"
- android:layout_width="32dp"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:scaleType="centerInside"
android:layout_toRightOf="@id/network_text"
android:layout_alignBaseline="@id/network_signal"
- android:baseline="22dp"
+ android:baseline="18dp"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
android:contentDescription="@null"
/>
diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml
index eb644b3..9be9041 100644
--- a/packages/SystemUI/res/layout/signal_cluster_view.xml
+++ b/packages/SystemUI/res/layout/signal_cluster_view.xml
@@ -51,6 +51,28 @@
android:visibility="gone"
android:id="@+id/spacer"
/>
+ <!--<FrameLayout
+ android:id="@+id/wimax_combo"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginRight="-6dp"
+ >
+ <ImageView
+ android:id="@+id/wimax_signal"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:scaleType="center"
+ />
+ <ImageView
+ android:id="@+id/wimax_inout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center|bottom"
+ />
+ </FrameLayout>
+ -->
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
diff --git a/packages/SystemUI/res/values/donottranslate.xml b/packages/SystemUI/res/values/donottranslate.xml
index 93ec481..089a54d 100644
--- a/packages/SystemUI/res/values/donottranslate.xml
+++ b/packages/SystemUI/res/values/donottranslate.xml
@@ -18,8 +18,9 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- For formatting day of week and date in DateView. %1$s is DOW, %2$s is date.
- In Roman locales we now show only the date, but DOW is available for other locales if
- necessary. -->
- <string name="status_bar_date_formatter">%2$s</string>
+ We show both (DOW on one line, then the date) but this can be overridden for locales as
+ necessary.
+ -->
+ <string name="status_bar_date_formatter">%1$s\n%2$s</string>
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 1a6cae2..fc81f8e 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -256,7 +256,18 @@
<!-- Content description of the WIFI signal when it is three bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_wifi_three_bars">Wi-Fi three bars.</string>
<!-- Content description of the WIFI signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
- <string name="accessibility_wifi_signal_full">Wi-Fi signal full.</string>
+ <string name="accessibility_wifi_signal_full">WiFi signal full.</string>
+
+ <!-- Content description of the WiMAX signal when no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_no_wimax">No WiMAX.</string>
+ <!-- Content description of the WiMAX signal when it is one bar for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_wimax_one_bar">WiMAX one bar.</string>
+ <!-- Content description of the WiMAX signal when it is two bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_wimax_two_bars">WiMAX two bars.</string>
+ <!-- Content description of the WiMAX signal when it is three bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_wimax_three_bars">WiMAX three bars.</string>
+ <!-- Content description of the WiMAX signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_wimax_signal_full">WiMAX signal full.</string>
<!-- Content description of the data connection type GPRS for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_data_connection_gprs">GPRS</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
index 2e1803e..2be35b7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
@@ -118,15 +118,20 @@
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- PixelFormat.OPAQUE);
+ // We use a pixel format of RGB565 for the status bar to save memory bandwidth and
+ // to ensure that the layer can be handled by HWComposer. On some devices the
+ // HWComposer is unable to handle SW-rendered RGBX_8888 layers.
+ PixelFormat.RGB_565);
// the status bar should be in an overlay if possible
final Display defaultDisplay
= ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
- if (ActivityManager.isHighEndGfx(defaultDisplay)) {
- lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
- }
+
+ // We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies
+ // very little screen real-estate and is updated fairly frequently. By using CPU rendering
+ // for the status bar, we prevent the GPU from having to wake up just to do these small
+ // updates, which should help keep power consumption down.
lp.gravity = getStatusBarGravity();
lp.setTitle("StatusBar");
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index c6a59d3..51fb262 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -350,7 +350,11 @@
(SignalClusterView)sb.findViewById(R.id.signal_cluster);
mNetworkController.addSignalCluster(signalCluster);
signalCluster.setNetworkController(mNetworkController);
-
+// final ImageView wimaxRSSI =
+// (ImageView)sb.findViewById(R.id.wimax_signal);
+// if (wimaxRSSI != null) {
+// mNetworkController.addWimaxIconView(wimaxRSSI);
+// }
// Recents Panel
mRecentTasksLoader = new RecentTasksLoader(context);
updateRecentsPanel();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java
index 13fb03e..f45426b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java
@@ -34,4 +34,11 @@
R.string.accessibility_wifi_three_bars,
R.string.accessibility_wifi_signal_full
};
+ static final int[] WIMAX_CONNECTION_STRENGTH = {
+ R.string.accessibility_no_wimax,
+ R.string.accessibility_wimax_one_bar,
+ R.string.accessibility_wimax_two_bars,
+ R.string.accessibility_wimax_three_bars,
+ R.string.accessibility_wimax_signal_full
+ };
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index a305816..55a5b0a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -31,6 +31,7 @@
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
+import android.net.wimax.WimaxManagerConstants;
import android.os.Binder;
import android.os.Handler;
import android.os.Message;
@@ -90,6 +91,7 @@
String mContentDescriptionPhoneSignal;
String mContentDescriptionWifi;
+ String mContentDescriptionWimax;
String mContentDescriptionCombinedSignal;
String mContentDescriptionDataType;
@@ -108,6 +110,15 @@
private int mBluetoothTetherIconId =
com.android.internal.R.drawable.stat_sys_tether_bluetooth;
+ //wimax
+ private boolean mWimaxSupported = false;
+ private boolean mIsWimaxEnabled = false;
+ private boolean mWimaxConnected = false;
+ private boolean mWimaxIdle = false;
+ private int mWimaxIconId = 0;
+ private int mWimaxSignal = 0;
+ private int mWimaxState = 0;
+ private int mWimaxExtraState = 0;
// data connectivity (regardless of state, can we access the internet?)
// state of inet connection - 0 not connected, 100 connected
private int mInetCondition = 0;
@@ -121,6 +132,7 @@
ArrayList<ImageView> mDataDirectionIconViews = new ArrayList<ImageView>();
ArrayList<ImageView> mDataDirectionOverlayIconViews = new ArrayList<ImageView>();
ArrayList<ImageView> mWifiIconViews = new ArrayList<ImageView>();
+ ArrayList<ImageView> mWimaxIconViews = new ArrayList<ImageView>();
ArrayList<ImageView> mCombinedSignalIconViews = new ArrayList<ImageView>();
ArrayList<ImageView> mDataTypeIconViews = new ArrayList<ImageView>();
ArrayList<TextView> mLabelViews = new ArrayList<TextView>();
@@ -129,6 +141,7 @@
int mLastDataDirectionIconId = -1;
int mLastDataDirectionOverlayIconId = -1;
int mLastWifiIconId = -1;
+ int mLastWimaxIconId = -1;
int mLastCombinedSignalIconId = -1;
int mLastDataTypeIconId = -1;
String mLastLabel = "";
@@ -164,6 +177,7 @@
// set up the default wifi icon, used when no radios have ever appeared
updateWifiIcons();
+ updateWimaxIcons();
// telephony
mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
@@ -200,6 +214,13 @@
filter.addAction(ConnectivityManager.INET_CONDITION_ACTION);
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+ mWimaxSupported = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_wimaxEnabled);
+ if(mWimaxSupported) {
+ filter.addAction(WimaxManagerConstants.WIMAX_NETWORK_STATE_CHANGED_ACTION);
+ filter.addAction(WimaxManagerConstants.SIGNAL_LEVEL_CHANGED_ACTION);
+ filter.addAction(WimaxManagerConstants.NET_4G_STATE_CHANGED_ACTION);
+ }
context.registerReceiver(this, filter);
// AIRPLANE_MODE_CHANGED is sent at boot; we've probably already missed it
@@ -224,6 +245,9 @@
public void addWifiIconView(ImageView v) {
mWifiIconViews.add(v);
}
+ public void addWimaxIconView(ImageView v) {
+ mWimaxIconViews.add(v);
+ }
public void addCombinedSignalIconView(ImageView v) {
mCombinedSignalIconViews.add(v);
@@ -239,19 +263,36 @@
public void addSignalCluster(SignalCluster cluster) {
mSignalClusters.add(cluster);
+ refreshSignalCluster(cluster);
+ }
+
+ public void refreshSignalCluster(SignalCluster cluster) {
cluster.setWifiIndicators(
mWifiConnected, // only show wifi in the cluster if connected
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);
- cluster.setMobileDataIndicators(
- mHasMobileDataFeature,
- mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
- mMobileActivityIconId,
- mDataTypeIconId,
- mContentDescriptionPhoneSignal,
- mContentDescriptionDataType);
+ if (mIsWimaxEnabled && mWimaxConnected) {
+ // wimax is special
+ cluster.setMobileDataIndicators(
+ true,
+ mWimaxIconId,
+ mMobileActivityIconId,
+ mDataTypeIconId,
+ mContentDescriptionWimax,
+ mContentDescriptionDataType);
+ } else {
+ // normal mobile data
+ cluster.setMobileDataIndicators(
+ mHasMobileDataFeature,
+ mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
+ mMobileActivityIconId,
+ mDataTypeIconId,
+ mContentDescriptionPhoneSignal,
+ mContentDescriptionDataType);
+ }
+ cluster.setIsAirplaneMode(mAirplaneMode);
}
public void setStackedMode(boolean stacked) {
@@ -285,6 +326,11 @@
} else if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
updateAirplaneMode();
refreshViews();
+ } else if (action.equals(WimaxManagerConstants.NET_4G_STATE_CHANGED_ACTION) ||
+ action.equals(WimaxManagerConstants.SIGNAL_LEVEL_CHANGED_ACTION) ||
+ action.equals(WimaxManagerConstants.WIMAX_NETWORK_STATE_CHANGED_ACTION)) {
+ updateWimaxState(intent);
+ refreshViews();
}
}
@@ -438,91 +484,100 @@
}
private final void updateDataNetType() {
- switch (mDataNetType) {
- case TelephonyManager.NETWORK_TYPE_UNKNOWN:
- if (!mShowAtLeastThreeGees) {
- mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
- mDataTypeIconId = 0;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_gprs);
- break;
- } else {
- // fall through
- }
- case TelephonyManager.NETWORK_TYPE_EDGE:
- if (!mShowAtLeastThreeGees) {
- mDataIconList = TelephonyIcons.DATA_E[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_e;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_edge);
- break;
- } else {
- // fall through
- }
- case TelephonyManager.NETWORK_TYPE_UMTS:
- mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_3g);
- break;
- case TelephonyManager.NETWORK_TYPE_HSDPA:
- case TelephonyManager.NETWORK_TYPE_HSUPA:
- case TelephonyManager.NETWORK_TYPE_HSPA:
- case TelephonyManager.NETWORK_TYPE_HSPAP:
- if (mHspaDataDistinguishable) {
- mDataIconList = TelephonyIcons.DATA_H[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_h;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_3_5g);
- } else {
+ if (mIsWimaxEnabled && mWimaxConnected) {
+ // wimax is a special 4g network not handled by telephony
+ mDataIconList = TelephonyIcons.DATA_4G[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_4g;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_4g);
+ } else {
+ switch (mDataNetType) {
+ case TelephonyManager.NETWORK_TYPE_UNKNOWN:
+ if (!mShowAtLeastThreeGees) {
+ mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
+ mDataTypeIconId = 0;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_gprs);
+ break;
+ } else {
+ // fall through
+ }
+ case TelephonyManager.NETWORK_TYPE_EDGE:
+ if (!mShowAtLeastThreeGees) {
+ mDataIconList = TelephonyIcons.DATA_E[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_e;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_edge);
+ break;
+ } else {
+ // fall through
+ }
+ case TelephonyManager.NETWORK_TYPE_UMTS:
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
mContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
- }
- break;
- case TelephonyManager.NETWORK_TYPE_CDMA:
- // display 1xRTT for IS95A/B
- mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_1x;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_cdma);
- break;
- case TelephonyManager.NETWORK_TYPE_1xRTT:
- mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_1x;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_cdma);
- break;
- case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through
- case TelephonyManager.NETWORK_TYPE_EVDO_A:
- case TelephonyManager.NETWORK_TYPE_EVDO_B:
- case TelephonyManager.NETWORK_TYPE_EHRPD:
- mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_3g);
- break;
- case TelephonyManager.NETWORK_TYPE_LTE:
- mDataIconList = TelephonyIcons.DATA_4G[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_4g;
- mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_4g);
- break;
- default:
- if (!mShowAtLeastThreeGees) {
- mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
- mDataTypeIconId = R.drawable.stat_sys_data_connected_g;
+ break;
+ case TelephonyManager.NETWORK_TYPE_HSDPA:
+ case TelephonyManager.NETWORK_TYPE_HSUPA:
+ case TelephonyManager.NETWORK_TYPE_HSPA:
+ case TelephonyManager.NETWORK_TYPE_HSPAP:
+ if (mHspaDataDistinguishable) {
+ mDataIconList = TelephonyIcons.DATA_H[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_h;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_3_5g);
+ } else {
+ mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_3g);
+ }
+ break;
+ case TelephonyManager.NETWORK_TYPE_CDMA:
+ // display 1xRTT for IS95A/B
+ mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_1x;
mContentDescriptionDataType = mContext.getString(
- R.string.accessibility_data_connection_gprs);
- } else {
+ R.string.accessibility_data_connection_cdma);
+ break;
+ case TelephonyManager.NETWORK_TYPE_1xRTT:
+ mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_1x;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_cdma);
+ break;
+ case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through
+ case TelephonyManager.NETWORK_TYPE_EVDO_A:
+ case TelephonyManager.NETWORK_TYPE_EVDO_B:
+ case TelephonyManager.NETWORK_TYPE_EHRPD:
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
mContentDescriptionDataType = mContext.getString(
R.string.accessibility_data_connection_3g);
- }
- break;
+ break;
+ case TelephonyManager.NETWORK_TYPE_LTE:
+ mDataIconList = TelephonyIcons.DATA_4G[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_4g;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_4g);
+ break;
+ default:
+ if (!mShowAtLeastThreeGees) {
+ mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_g;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_gprs);
+ } else {
+ mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
+ mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
+ mContentDescriptionDataType = mContext.getString(
+ R.string.accessibility_data_connection_3g);
+ }
+ break;
+ }
}
+
if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
}
@@ -735,6 +790,49 @@
}
+ // ===== Wimax ===================================================================
+ private final void updateWimaxState(Intent intent) {
+ final String action = intent.getAction();
+ boolean wasConnected = mWimaxConnected;
+ if (action.equals(WimaxManagerConstants.NET_4G_STATE_CHANGED_ACTION)) {
+ int wimaxStatus = intent.getIntExtra(WimaxManagerConstants.EXTRA_4G_STATE,
+ WimaxManagerConstants.NET_4G_STATE_UNKNOWN);
+ mIsWimaxEnabled = (wimaxStatus ==
+ WimaxManagerConstants.NET_4G_STATE_ENABLED);
+ } else if (action.equals(WimaxManagerConstants.SIGNAL_LEVEL_CHANGED_ACTION)) {
+ mWimaxSignal = intent.getIntExtra(WimaxManagerConstants.EXTRA_NEW_SIGNAL_LEVEL, 0);
+ } else if (action.equals(WimaxManagerConstants.WIMAX_NETWORK_STATE_CHANGED_ACTION)) {
+ mWimaxState = intent.getIntExtra(WimaxManagerConstants.EXTRA_WIMAX_STATE,
+ WimaxManagerConstants.NET_4G_STATE_UNKNOWN);
+ mWimaxExtraState = intent.getIntExtra(
+ WimaxManagerConstants.EXTRA_WIMAX_STATE_DETAIL,
+ WimaxManagerConstants.NET_4G_STATE_UNKNOWN);
+ mWimaxConnected = (mWimaxState ==
+ WimaxManagerConstants.WIMAX_STATE_CONNECTED);
+ mWimaxIdle = (mWimaxExtraState == WimaxManagerConstants.WIMAX_IDLE);
+ }
+ updateDataNetType();
+ updateWimaxIcons();
+ }
+
+ private void updateWimaxIcons() {
+ if (mIsWimaxEnabled) {
+ if (mWimaxConnected) {
+ if (mWimaxIdle)
+ mWimaxIconId = WimaxIcons.WIMAX_IDLE;
+ else
+ mWimaxIconId = WimaxIcons.WIMAX_SIGNAL_STRENGTH[mInetCondition][mWimaxSignal];
+ mContentDescriptionWimax = mContext.getString(
+ AccessibilityContentDescriptions.WIMAX_CONNECTION_STRENGTH[mWimaxSignal]);
+ } else {
+ mWimaxIconId = WimaxIcons.WIMAX_DISCONNECTED;
+ mContentDescriptionWimax = mContext.getString(R.string.accessibility_no_wimax);
+ }
+ } else {
+ mWimaxIconId = 0;
+ }
+ }
+
// ===== Full or limited Internet connectivity ==================================
private void updateConnectivity(Intent intent) {
@@ -754,13 +852,14 @@
mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
if (info != null && info.getType() == ConnectivityManager.TYPE_BLUETOOTH) {
- mBluetoothTethered = info.isConnected() ? true: false;
+ mBluetoothTethered = info.isConnected();
} else {
mBluetoothTethered = false;
}
// We want to update all the icons, all at once, for any condition change
updateDataNetType();
+ updateWimaxIcons();
updateDataIcon();
updateTelephonySignalStrength();
updateWifiIcons();
@@ -847,7 +946,7 @@
combinedSignalIconId = mDataSignalIconId;
}
- else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered) {
+ else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected) {
// pretty much totally disconnected
label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
@@ -887,23 +986,12 @@
if (mLastPhoneSignalIconId != mPhoneSignalIconId
|| mLastDataDirectionOverlayIconId != combinedActivityIconId
|| mLastWifiIconId != mWifiIconId
+ || mLastWimaxIconId != mWimaxIconId
|| mLastDataTypeIconId != mDataTypeIconId)
{
// NB: the mLast*s will be updated later
for (SignalCluster cluster : mSignalClusters) {
- cluster.setWifiIndicators(
- mWifiConnected, // only show wifi in the cluster if connected
- mWifiIconId,
- mWifiActivityIconId,
- mContentDescriptionWifi);
- cluster.setMobileDataIndicators(
- mHasMobileDataFeature,
- mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId,
- mMobileActivityIconId,
- mDataTypeIconId,
- mContentDescriptionPhoneSignal,
- mContentDescriptionDataType);
- cluster.setIsAirplaneMode(mAirplaneMode);
+ refreshSignalCluster(cluster);
}
}
@@ -945,6 +1033,21 @@
}
}
+ // the wimax icon on phones
+ if (mLastWimaxIconId != mWimaxIconId) {
+ mLastWimaxIconId = mWimaxIconId;
+ N = mWimaxIconViews.size();
+ for (int i=0; i<N; i++) {
+ final ImageView v = mWimaxIconViews.get(i);
+ if (mWimaxIconId == 0) {
+ v.setVisibility(View.INVISIBLE);
+ } else {
+ v.setVisibility(View.VISIBLE);
+ v.setImageResource(mWimaxIconId);
+ v.setContentDescription(mContentDescriptionWimax);
+ }
+ }
+ }
// the combined data signal icon
if (mLastCombinedSignalIconId != combinedSignalIconId) {
mLastCombinedSignalIconId = combinedSignalIconId;
@@ -1063,11 +1166,22 @@
pw.println(mWifiLevel);
pw.print(" mWifiSsid=");
pw.println(mWifiSsid);
- pw.print(String.format(" mWifiIconId=0x%08x/%s",
+ pw.println(String.format(" mWifiIconId=0x%08x/%s",
mWifiIconId, getResourceName(mWifiIconId)));
pw.print(" mWifiActivity=");
pw.println(mWifiActivity);
+ if (mWimaxSupported) {
+ pw.println(" - wimax ------");
+ pw.print(" mIsWimaxEnabled="); pw.println(mIsWimaxEnabled);
+ pw.print(" mWimaxConnected="); pw.println(mWimaxConnected);
+ pw.print(" mWimaxIdle="); pw.println(mWimaxIdle);
+ pw.println(String.format(" mWimaxIconId=0x%08x/%s",
+ mWimaxIconId, getResourceName(mWimaxIconId)));
+ pw.println(String.format(" mWimaxSignal=%d", mWimaxSignal));
+ pw.println(String.format(" mWimaxState=%d", mWimaxState));
+ pw.println(String.format(" mWimaxExtraState=%d", mWimaxExtraState));
+ }
pw.println(" - Bluetooth ----");
pw.print(" mBtReverseTethered=");
@@ -1101,7 +1215,7 @@
pw.print(" mLastDataTypeIconId=0x");
pw.print(Integer.toHexString(mLastDataTypeIconId));
pw.print("/");
- pw.println(getResourceName(mLastCombinedSignalIconId));
+ pw.println(getResourceName(mLastDataTypeIconId));
pw.print(" mLastLabel=");
pw.print(mLastLabel);
pw.println("");
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java
index 0eb2be6..fe2ec69 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java
@@ -80,10 +80,13 @@
Drawable slider;
final Resources res = getContext().getResources();
if (checked) {
- thumb = res.getDrawable(R.drawable.scrubber_control_disabled_holo);
- slider = res.getDrawable(R.drawable.status_bar_settings_slider_disabled);
+ thumb = res.getDrawable(
+ com.android.internal.R.drawable.scrubber_control_disabled_holo);
+ slider = res.getDrawable(
+ R.drawable.status_bar_settings_slider_disabled);
} else {
- thumb = res.getDrawable(R.drawable.scrubber_control_holo);
+ thumb = res.getDrawable(
+ com.android.internal.R.drawable.scrubber_control_selector_holo);
slider = res.getDrawable(
com.android.internal.R.drawable.scrubber_progress_horizontal_holo_dark);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WimaxIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WimaxIcons.java
new file mode 100644
index 0000000..d3d4338
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WimaxIcons.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011 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 com.android.systemui.statusbar.policy;
+
+import com.android.systemui.statusbar.policy.TelephonyIcons;
+import com.android.systemui.R;
+
+class WimaxIcons {
+ static final int[][] WIMAX_SIGNAL_STRENGTH = TelephonyIcons.DATA_SIGNAL_STRENGTH;
+
+ static final int WIMAX_DISCONNECTED = WIMAX_SIGNAL_STRENGTH[0][0];
+
+ static final int WIMAX_IDLE = WIMAX_DISCONNECTED; // XXX: unclear if we need a different icon
+}
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
index dafbdcf..a7da96e 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
@@ -91,7 +91,7 @@
private LockPatternUtils mLockPatternUtils;
private KeyguardUpdateMonitor mUpdateMonitor;
private Button mEmergencyCallButton;
- private boolean mUnlockDisabledDueToSimState;
+ private boolean mEmergencyButtonEnabledBecauseSimLocked;
// Shadowed text values
private CharSequence mCarrierText;
@@ -101,9 +101,10 @@
private CharSequence mOwnerInfoText;
private boolean mShowingStatus;
private KeyguardScreenCallback mCallback;
- private final boolean mShowEmergencyButtonByDefault;
+ private final boolean mEmergencyCallButtonEnabledInScreen;
private CharSequence mPlmn;
private CharSequence mSpn;
+ protected int mPhoneState;
private class TransientTextManager {
private TextView mTextView;
@@ -154,9 +155,17 @@
}
};
+ /**
+ *
+ * @param view the containing view of all widgets
+ * @param updateMonitor the update monitor to use
+ * @param lockPatternUtils lock pattern util object
+ * @param callback used to invoke emergency dialer
+ * @param emergencyButtonEnabledInScreen whether emergency button is enabled by default
+ */
public KeyguardStatusViewManager(View view, KeyguardUpdateMonitor updateMonitor,
LockPatternUtils lockPatternUtils, KeyguardScreenCallback callback,
- boolean showEmergencyButtonByDefault) {
+ boolean emergencyButtonEnabledInScreen) {
if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
mContainer = view;
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
@@ -171,7 +180,7 @@
mOwnerInfoView = (TextView) findViewById(R.id.propertyOf);
mTransportView = (TransportControlView) findViewById(R.id.transport);
mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
- mShowEmergencyButtonByDefault = showEmergencyButtonByDefault;
+ mEmergencyCallButtonEnabledInScreen = emergencyButtonEnabledInScreen;
// Hide transport control view until we know we need to show it.
if (mTransportView != null) {
@@ -452,12 +461,12 @@
*
* @param simState
*/
- private void updateCarrierTextWithSimStatus(State simState) {
+ private void updateCarrierStateWithSimStatus(State simState) {
if (DEBUG) Log.d(TAG, "updateCarrierTextWithSimStatus(), simState = " + simState);
CharSequence carrierText = null;
int carrierHelpTextId = 0;
- mUnlockDisabledDueToSimState = false;
+ mEmergencyButtonEnabledBecauseSimLocked = false;
mStatus = getStatusForIccState(simState);
mSimState = simState;
switch (mStatus) {
@@ -479,32 +488,35 @@
case SimPermDisabled:
carrierText = getContext().getText(R.string.lockscreen_missing_sim_message_short);
carrierHelpTextId = R.string.lockscreen_permanent_disabled_sim_instructions;
- mUnlockDisabledDueToSimState = true;
+ mEmergencyButtonEnabledBecauseSimLocked = true;
break;
case SimMissingLocked:
carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_missing_sim_message_short));
carrierHelpTextId = R.string.lockscreen_missing_sim_instructions;
- mUnlockDisabledDueToSimState = true;
+ mEmergencyButtonEnabledBecauseSimLocked = true;
break;
case SimLocked:
carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_sim_locked_message));
+ mEmergencyButtonEnabledBecauseSimLocked = true;
break;
case SimPukLocked:
carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_sim_puk_locked_message));
if (!mLockPatternUtils.isPukUnlockScreenEnable()) {
- mUnlockDisabledDueToSimState = true;
+ // This means we're showing the PUK unlock screen
+ mEmergencyButtonEnabledBecauseSimLocked = true;
}
break;
}
setCarrierText(carrierText);
setCarrierHelpText(carrierHelpTextId);
+ updateEmergencyCallButtonState(mPhoneState);
}
private View findViewById(int id) {
@@ -569,9 +581,12 @@
private void updateEmergencyCallButtonState(int phoneState) {
if (mEmergencyCallButton != null) {
- boolean showIfCapable = mShowEmergencyButtonByDefault || mUnlockDisabledDueToSimState;
+ boolean enabledBecauseSimLocked =
+ mLockPatternUtils.isEmergencyCallEnabledWhileSimLocked()
+ && mEmergencyButtonEnabledBecauseSimLocked;
+ boolean shown = mEmergencyCallButtonEnabledInScreen || enabledBecauseSimLocked;
mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton,
- phoneState, showIfCapable);
+ phoneState, shown);
}
}
@@ -594,7 +609,7 @@
public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) {
mPlmn = plmn;
mSpn = spn;
- updateCarrierTextWithSimStatus(mSimState);
+ updateCarrierStateWithSimStatus(mSimState);
}
public void onRingerModeChanged(int state) {
@@ -602,6 +617,7 @@
}
public void onPhoneStateChanged(int phoneState) {
+ mPhoneState = phoneState;
updateEmergencyCallButtonState(phoneState);
}
@@ -618,7 +634,7 @@
private SimStateCallback mSimStateCallback = new SimStateCallback() {
public void onSimStateChanged(State simState) {
- updateCarrierTextWithSimStatus(simState);
+ updateCarrierStateWithSimStatus(simState);
}
};
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index c802bc1..b514689 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -830,12 +830,13 @@
* action should be posted to a handler.
*
* @param keyCode The keycode of the key that woke the device
+ * @param isDocked True if the device is in the dock
* @return Whether we poked the wake lock (and turned the screen on)
*/
- public boolean onWakeKeyWhenKeyguardShowingTq(int keyCode) {
+ public boolean onWakeKeyWhenKeyguardShowingTq(int keyCode, boolean isDocked) {
if (DEBUG) Log.d(TAG, "onWakeKeyWhenKeyguardShowing(" + keyCode + ")");
- if (isWakeKeyWhenKeyguardShowing(keyCode)) {
+ if (isWakeKeyWhenKeyguardShowing(keyCode, isDocked)) {
// give the keyguard view manager a chance to adjust the state of the
// keyguard based on the key that woke the device before poking
// the wake lock
@@ -846,11 +847,22 @@
}
}
- private boolean isWakeKeyWhenKeyguardShowing(int keyCode) {
+ /**
+ * When the keyguard is showing we ignore some keys that might otherwise typically
+ * be considered wake keys. We filter them out here.
+ *
+ * {@link KeyEvent#KEYCODE_POWER} is notably absent from this list because it
+ * is always considered a wake key.
+ */
+ private boolean isWakeKeyWhenKeyguardShowing(int keyCode, boolean isDocked) {
switch (keyCode) {
+ // ignore volume keys unless docked
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_VOLUME_MUTE:
+ return isDocked;
+
+ // ignore media and camera keys
case KeyEvent.KEYCODE_MUTE:
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_MEDIA_PLAY:
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 81e1901..0f21bdb 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -360,8 +360,7 @@
mHasOverlay = true;
// Continue showing FaceLock area until dialer comes up or call is resumed
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled() && mFaceLockServiceRunning) {
+ if (usingFaceLock() && mFaceLockServiceRunning) {
showFaceLockAreaWithTimeout(FACELOCK_VIEW_AREA_EMERGENCY_DIALER_TIMEOUT);
}
@@ -582,8 +581,7 @@
bindToFaceLock();
// Show FaceLock area, but only for a little bit so lockpattern will become visible if
// FaceLock fails to start or crashes
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
showFaceLockAreaWithTimeout(FACELOCK_VIEW_AREA_SERVICE_TIMEOUT);
}
} else {
@@ -653,11 +651,10 @@
((KeyguardScreen) mUnlockScreen).onResume();
}
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled() && !mHasOverlay) {
+ if (usingFaceLock() && !mHasOverlay) {
// Note that show() gets called before the screen turns off to set it up for next time
// it is turned on. We don't want to set a timeout on the FaceLock area here because it
- // may be gone by the time the screen is turned on again. We set the timout when the
+ // may be gone by the time the screen is turned on again. We set the timeout when the
// screen turns on instead.
showFaceLockArea();
} else {
@@ -854,7 +851,9 @@
if (mode == Mode.UnlockScreen) {
final UnlockMode unlockMode = getUnlockMode();
if (force || mUnlockScreen == null || unlockMode != mUnlockScreenMode) {
+ boolean restartFaceLock = stopFaceLockIfRunning();
recreateUnlockScreen(unlockMode);
+ if (restartFaceLock) activateFaceLockIfAble();
}
}
@@ -1147,28 +1146,33 @@
// Everything below pertains to FaceLock - might want to separate this out
- // Take care of FaceLock area when layout is created
+ // Indicates whether FaceLock is in use
+ private boolean usingFaceLock() {
+ return (mLockPatternUtils.usingBiometricWeak() &&
+ mLockPatternUtils.isBiometricWeakInstalled());
+ }
+
+ // Takes care of FaceLock area when layout is created
private void initializeFaceLockAreaView(View view) {
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
mFaceLockAreaView = view.findViewById(R.id.faceLockAreaView);
if (mFaceLockAreaView == null) {
Log.e(TAG, "Layout does not have faceLockAreaView and FaceLock is enabled");
- } else {
- if (mBoundToFaceLockService) {
- // If we are creating a layout when we are already bound to FaceLock, then we
- // are undergoing an orientation change. Stop FaceLock and restart it in the
- // new location.
- if (DEBUG) Log.d(TAG, "Restarting FL - creating view while already bound");
- stopAndUnbindFromFaceLock();
- activateFaceLockIfAble();
- }
}
} else {
mFaceLockAreaView = null; // Set to null if not using FaceLock
}
}
+ // Stops FaceLock if it is running and reports back whether it was running or not
+ private boolean stopFaceLockIfRunning() {
+ if (usingFaceLock() && mBoundToFaceLockService) {
+ stopAndUnbindFromFaceLock();
+ return true;
+ }
+ return false;
+ }
+
// Handles covering or exposing FaceLock area on the client side when FaceLock starts or stops
// This needs to be done in a handler because the call could be coming from a callback from the
// FaceLock service that is in a thread that can't modify the UI
@@ -1221,8 +1225,7 @@
// Binds to FaceLock service. This call does not tell it to start, but it causes the service
// to call the onServiceConnected callback, which then starts FaceLock.
public void bindToFaceLock() {
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
if (!mBoundToFaceLockService) {
if (DEBUG) Log.d(TAG, "before bind to FaceLock service");
mContext.bindService(new Intent(IFaceLockInterface.class.getName()),
@@ -1238,8 +1241,7 @@
// Tells FaceLock to stop and then unbinds from the FaceLock service
public void stopAndUnbindFromFaceLock() {
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
stopFaceLock();
if (mBoundToFaceLockService) {
@@ -1300,8 +1302,7 @@
// Tells the FaceLock service to start displaying its UI and perform recognition
public void startFaceLock(IBinder windowToken, int x, int y, int h, int w)
{
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
synchronized (mFaceLockServiceRunningLock) {
if (!mFaceLockServiceRunning) {
if (DEBUG) Log.d(TAG, "Starting FaceLock");
@@ -1322,8 +1323,7 @@
// Tells the FaceLock service to stop displaying its UI and stop recognition
public void stopFaceLock()
{
- if (mLockPatternUtils.usingBiometricWeak() &&
- mLockPatternUtils.isBiometricWeakInstalled()) {
+ if (usingFaceLock()) {
// Note that attempting to stop FaceLock when it's not running is not an issue.
// FaceLock can return, which stops it and then we try to stop it when the
// screen is turned off. That's why we check.
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 3469483..24a2420 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -34,6 +34,7 @@
import android.widget.*;
import android.util.Log;
import android.media.AudioManager;
+import android.provider.MediaStore;
import android.provider.Settings;
import java.io.File;
@@ -225,9 +226,10 @@
mCallback.goToUnlockScreen();
} else if (target == 2 || target == 3) { // 2 = alt/portrait, 3 = alt/landscape
if (!mCameraDisabled) {
- // Broadcast an intent to start the Camera
- Intent intent = new Intent(Intent.ACTION_CAMERA_BUTTON, null);
- mContext.sendOrderedBroadcast(intent, null);
+ // Start the Camera
+ Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(intent);
mCallback.goToUnlockScreen();
} else {
toggleRingMode();
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 7d97246..921f331 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -360,6 +360,9 @@
int mResettingSystemUiFlags = 0;
// Bits that we are currently always keeping cleared.
int mForceClearedSystemUiFlags = 0;
+ // What we last reported to system UI about whether the compatibility
+ // menu needs to be displayed.
+ boolean mLastFocusNeedsMenu = false;
FakeWindow mHideNavFakeWindow = null;
@@ -370,8 +373,6 @@
static final Rect mTmpNavigationFrame = new Rect();
WindowState mTopFullscreenOpaqueWindowState;
- WindowState mTopAppWindowState;
- WindowState mLastTopAppWindowState;
boolean mTopIsFullscreen;
boolean mForceStatusBar;
boolean mHideLockScreen;
@@ -493,7 +494,9 @@
return true;
}
if ((mCarDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_CAR) ||
- (mDeskDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_DESK)) {
+ (mDeskDockEnablesAccelerometer && (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
+ || mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK
+ || mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK))) {
// enable accelerometer if we are docked in a dock that enables accelerometer
// orientation management,
return true;
@@ -1182,7 +1185,13 @@
}
public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation) {
- return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation);
+ // This is the same as getNonDecorDisplayHeight, unless the status bar
+ // can hide. If the status bar can hide, we don't count that as part
+ // of the decor; however for purposes of configurations, we do want to
+ // exclude it since applications can't generally use that part of the
+ // screen.
+ return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation)
+ - (mStatusBarCanHide ? mStatusBarHeight : 0);
}
public boolean doesForceHide(WindowState win, WindowManager.LayoutParams attrs) {
@@ -2242,7 +2251,6 @@
/** {@inheritDoc} */
public void beginAnimationLw(int displayWidth, int displayHeight) {
mTopFullscreenOpaqueWindowState = null;
- mTopAppWindowState = null;
mForceStatusBar = false;
mHideLockScreen = false;
@@ -2280,12 +2288,6 @@
}
}
}
- if (mTopAppWindowState == null && win.isVisibleOrBehindKeyguardLw()) {
- if (attrs.type >= FIRST_APPLICATION_WINDOW
- && attrs.type <= LAST_APPLICATION_WINDOW) {
- mTopAppWindowState = win;
- }
- }
}
/** {@inheritDoc} */
@@ -2341,35 +2343,6 @@
mTopIsFullscreen = topIsFullscreen;
- if (mTopAppWindowState != null && mTopAppWindowState != mLastTopAppWindowState) {
- mLastTopAppWindowState = mTopAppWindowState;
-
- final boolean topNeedsMenu = (mTopAppWindowState.getAttrs().flags
- & WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0;
-
- mHandler.post(new Runnable() {
- public void run() {
- if (mStatusBarService == null) {
- // This is the one that can not go away, but it doesn't come up
- // before the window manager does, so don't fail if it doesn't
- // exist. This works as long as no fullscreen windows come up
- // before the status bar service does.
- mStatusBarService = IStatusBarService.Stub.asInterface(
- ServiceManager.getService("statusbar"));
- }
- final IStatusBarService sbs = mStatusBarService;
- if (mStatusBarService != null) {
- try {
- sbs.topAppWindowChanged(topNeedsMenu);
- } catch (RemoteException e) {
- // This should be impossible because we're in the same process.
- mStatusBarService = null;
- }
- }
- }
- });
- }
-
// Hide the key guard if a visible window explicitly specifies that it wants to be displayed
// when the screen is locked
if (mKeyguard != null) {
@@ -2478,7 +2451,7 @@
// keyguard, then we need to have it turn on the
// screen once it is shown.
mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(
- KeyEvent.KEYCODE_POWER);
+ KeyEvent.KEYCODE_POWER, mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
}
} else {
// Light up the keyboard if we are sliding up.
@@ -2698,7 +2671,8 @@
if (down && isWakeKey) {
if (keyguardActive) {
// If the keyguard is showing, let it decide what to do with the wake key.
- mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
+ mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode,
+ mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
} else {
// Otherwise, wake the device ourselves.
result |= ACTION_POKE_USER_ACTIVITY;
@@ -3137,7 +3111,9 @@
// enable 180 degree rotation while docked.
preferredRotation = mCarDockEnablesAccelerometer
? sensorRotation : mCarDockRotation;
- } else if (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
+ } else if ((mDockMode == Intent.EXTRA_DOCK_STATE_DESK
+ || mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK
+ || mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK)
&& (mDeskDockEnablesAccelerometer || mDeskDockRotation >= 0)) {
// Ignore sensor when in desk dock unless explicitly enabled.
// This case can override the behavior of NOSENSOR, and can also
@@ -3700,10 +3676,13 @@
& ~mResettingSystemUiFlags
& ~mForceClearedSystemUiFlags;
int diff = visibility ^ mLastSystemUiFlags;
- if (diff == 0) {
+ final boolean needsMenu = (mFocusedWindow.getAttrs().flags
+ & WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0;
+ if (diff == 0 && mLastFocusNeedsMenu == needsMenu) {
return 0;
}
mLastSystemUiFlags = visibility;
+ mLastFocusNeedsMenu = needsMenu;
mHandler.post(new Runnable() {
public void run() {
if (mStatusBarService == null) {
@@ -3713,6 +3692,7 @@
if (mStatusBarService != null) {
try {
mStatusBarService.setSystemUiVisibility(visibility);
+ mStatusBarService.topAppWindowChanged(needsMenu);
} catch (RemoteException e) {
// not much to be done
mStatusBarService = null;
@@ -3745,6 +3725,10 @@
pw.print(" mForceClearedSystemUiFlags=0x");
pw.println(Integer.toHexString(mForceClearedSystemUiFlags));
}
+ if (mLastFocusNeedsMenu) {
+ pw.print(prefix); pw.print("mLastFocusNeedsMenu=");
+ pw.println(mLastFocusNeedsMenu);
+ }
pw.print(prefix); pw.print("mUiMode="); pw.print(mUiMode);
pw.print(" mDockMode="); pw.print(mDockMode);
pw.print(" mCarDockRotation="); pw.print(mCarDockRotation);
diff --git a/policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java b/policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java
index 6acd1c5..47a7157 100644
--- a/policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java
@@ -106,7 +106,7 @@
mHeaderText.setSelected(true);
mKeyguardStatusViewManager = new KeyguardStatusViewManager(this, updateMonitor,
- lockpatternutils, callback, true);
+ lockpatternutils, callback, false);
mPinText.setFocusableInTouchMode(true);
mPinText.setOnFocusChangeListener(this);
diff --git a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
index 184748a..99e1ce1 100644
--- a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
@@ -100,7 +100,7 @@
mOkButton.setOnClickListener(this);
mKeyguardStatusViewManager = new KeyguardStatusViewManager(this, updateMonitor,
- lockpatternutils, callback, true);
+ lockpatternutils, callback, false);
setFocusableInTouchMode(true);
}
diff --git a/preloaded-classes b/preloaded-classes
index 31d49ce..c29ba15 100644
--- a/preloaded-classes
+++ b/preloaded-classes
@@ -18,7 +18,12 @@
android.accounts.IAccountManagerResponse$Stub
android.animation.Animator
android.animation.Animator$AnimatorListener
+android.animation.AnimatorInflater
android.animation.AnimatorListenerAdapter
+android.animation.AnimatorSet
+android.animation.AnimatorSet$AnimatorSetListener
+android.animation.AnimatorSet$Builder
+android.animation.AnimatorSet$Node
android.animation.FloatEvaluator
android.animation.FloatKeyframeSet
android.animation.IntEvaluator
@@ -57,6 +62,7 @@
android.app.ActivityThread$GcIdler
android.app.ActivityThread$H
android.app.ActivityThread$Idler
+android.app.ActivityThread$Profiler
android.app.ActivityThread$ProviderClientRecord
android.app.ActivityThread$ProviderRefCount
android.app.ActivityThread$ReceiverData
@@ -71,6 +77,8 @@
android.app.ApplicationPackageManager
android.app.ApplicationPackageManager$ResourceName
android.app.ApplicationThreadNative
+android.app.BackStackRecord
+android.app.BackStackRecord$Op
android.app.ContextImpl
android.app.ContextImpl$1
android.app.ContextImpl$10
@@ -111,9 +119,15 @@
android.app.Dialog
android.app.Dialog$1
android.app.Dialog$ListenersHandler
+android.app.DialogFragment
+android.app.Fragment
android.app.FragmentManager
+android.app.FragmentManager$BackStackEntry
android.app.FragmentManagerImpl
android.app.FragmentManagerImpl$1
+android.app.FragmentManagerImpl$2
+android.app.FragmentManagerImpl$3
+android.app.FragmentTransaction
android.app.IActivityManager
android.app.IActivityManager$ContentProviderHolder
android.app.IActivityManager$ContentProviderHolder$1
@@ -134,6 +148,10 @@
android.app.IntentReceiverLeaked
android.app.IntentService
android.app.IntentService$ServiceHandler
+android.app.ListActivity
+android.app.ListActivity$1
+android.app.ListActivity$2
+android.app.ListFragment
android.app.LoadedApk
android.app.LoadedApk$ReceiverDispatcher
android.app.LoadedApk$ReceiverDispatcher$Args
@@ -328,6 +346,7 @@
android.graphics.AvoidXfermode
android.graphics.Bitmap
android.graphics.Bitmap$1
+android.graphics.Bitmap$2
android.graphics.Bitmap$BitmapFinalizer
android.graphics.Bitmap$Config
android.graphics.BitmapFactory
@@ -719,6 +738,7 @@
android.text.style.MetricAffectingSpan
android.text.style.ParagraphStyle
android.text.style.ReplacementSpan
+android.text.style.SpellCheckSpan
android.text.style.StyleSpan
android.text.style.SuggestionSpan
android.text.style.UpdateAppearance
@@ -870,6 +890,7 @@
android.view.View$OnTouchListener
android.view.View$PerformClick
android.view.View$ScrollabilityCache
+android.view.View$TransformationInfo
android.view.View$UnsetPressedState
android.view.ViewConfiguration
android.view.ViewGroup
@@ -934,6 +955,7 @@
android.view.inputmethod.ExtractedText
android.view.inputmethod.ExtractedText$1
android.view.inputmethod.InputConnection
+android.view.inputmethod.InputConnectionWrapper
android.view.inputmethod.InputMethodManager
android.view.inputmethod.InputMethodManager$1
android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
@@ -946,12 +968,16 @@
android.widget.AbsListView
android.widget.AbsListView$1
android.widget.AbsListView$2
+android.widget.AbsListView$3
android.widget.AbsListView$AdapterDataSetObserver
android.widget.AbsListView$CheckForTap
+android.widget.AbsListView$FlingRunnable
+android.widget.AbsListView$FlingRunnable$1
android.widget.AbsListView$LayoutParams
android.widget.AbsListView$OnScrollListener
android.widget.AbsListView$PerformClick
android.widget.AbsListView$RecycleBin
+android.widget.AbsListView$RecyclerListener
android.widget.AbsListView$SavedState
android.widget.AbsListView$SavedState$1
android.widget.AbsListView$SelectionBoundsAdjuster
@@ -975,13 +1001,19 @@
android.widget.Checkable
android.widget.CheckedTextView
android.widget.CompoundButton
+android.widget.CompoundButton$OnCheckedChangeListener
android.widget.CursorAdapter
android.widget.CursorFilter$CursorFilterClient
+android.widget.EdgeEffect
android.widget.EdgeGlow
android.widget.EditText
android.widget.ExpandableListView
+android.widget.FastScroller
+android.widget.FastScroller$1
+android.widget.FastScroller$ScrollFade
android.widget.Filter
android.widget.Filter$FilterListener
+android.widget.Filter$FilterResults
android.widget.Filter$ResultsHandler
android.widget.Filterable
android.widget.FrameLayout
@@ -1030,17 +1062,30 @@
android.widget.Spinner
android.widget.SpinnerAdapter
android.widget.StackView
+android.widget.Switch
android.widget.TabHost
+android.widget.TabHost$ContentStrategy
+android.widget.TabHost$FactoryContentStrategy
+android.widget.TabHost$IndicatorStrategy
+android.widget.TabHost$LabelAndIconIndicatorStrategy
+android.widget.TabHost$OnTabChangeListener
+android.widget.TabHost$TabContentFactory
+android.widget.TabHost$TabSpec
+android.widget.TabHost$ViewIndicatorStrategy
android.widget.TabWidget
+android.widget.TabWidget$OnTabSelectionChanged
+android.widget.TabWidget$TabClickListener
android.widget.TableLayout
android.widget.TableRow
android.widget.TextView
+android.widget.TextView$2
android.widget.TextView$3
android.widget.TextView$Blink
android.widget.TextView$BufferType
android.widget.TextView$ChangeWatcher
android.widget.TextView$CharWrapper
android.widget.TextView$Drawables
+android.widget.TextView$EasyEditSpanController
android.widget.TextView$InputContentType
android.widget.TextView$InputMethodState
android.widget.TextView$OnEditorActionListener
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 69560e5..780c0d2 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2066,7 +2066,21 @@
// The first time a track is added we wait
// for all its buffers to be filled before processing it
mAudioMixer->setActiveTrack(track->name());
- if (cblk->framesReady() && track->isReady() &&
+ // make sure that we have enough frames to mix one full buffer.
+ // enforce this condition only once to enable draining the buffer in case the client
+ // app does not call stop() and relies on underrun to stop:
+ // hence the test on (track->mRetryCount >= kMaxTrackRetries) meaning the track was mixed
+ // during last round
+ uint32_t minFrames = 1;
+ if (!track->isStopped() && !track->isPausing() &&
+ (track->mRetryCount >= kMaxTrackRetries)) {
+ if (t->sampleRate() == (int)mSampleRate) {
+ minFrames = mFrameCount;
+ } else {
+ minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1;
+ }
+ }
+ if ((cblk->framesReady() >= minFrames) && track->isReady() &&
!track->isPaused() && !track->isTerminated())
{
//LOGV("track %d u=%08x, s=%08x [OK] on thread %p", track->name(), cblk->user, cblk->server, this);
@@ -7014,11 +7028,17 @@
AudioFlinger::EffectChain::EffectChain(const wp<ThreadBase>& wThread,
int sessionId)
- : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mTrackCnt(0),
+ : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mTrackCnt(0), mTailBufferCount(0),
mOwnInBuffer(false), mVolumeCtrlIdx(-1), mLeftVolume(UINT_MAX), mRightVolume(UINT_MAX),
mNewLeftVolume(UINT_MAX), mNewRightVolume(UINT_MAX)
{
mStrategy = AudioSystem::getStrategyForStream(AUDIO_STREAM_MUSIC);
+ sp<ThreadBase> thread = mThread.promote();
+ if (thread == 0) {
+ return;
+ }
+ mMaxTailBuffers = ((kProcessTailDurationMs * thread->sampleRate()) / 1000) /
+ thread->frameCount();
}
AudioFlinger::EffectChain::~EffectChain()
@@ -7086,22 +7106,31 @@
}
bool isGlobalSession = (mSessionId == AUDIO_SESSION_OUTPUT_MIX) ||
(mSessionId == AUDIO_SESSION_OUTPUT_STAGE);
- bool tracksOnSession = false;
+ // always process effects unless no more tracks are on the session and the effect tail
+ // has been rendered
+ bool doProcess = true;
if (!isGlobalSession) {
- tracksOnSession = (trackCnt() != 0);
- }
+ bool tracksOnSession = (trackCnt() != 0);
- // if no track is active, input buffer must be cleared here as the mixer process
- // will not do it
- if (tracksOnSession &&
- activeTrackCnt() == 0) {
- size_t numSamples = thread->frameCount() * thread->channelCount();
- memset(mInBuffer, 0, numSamples * sizeof(int16_t));
+ if (!tracksOnSession && mTailBufferCount == 0) {
+ doProcess = false;
+ }
+
+ if (activeTrackCnt() == 0) {
+ // if no track is active and the effect tail has not been rendered,
+ // the input buffer must be cleared here as the mixer process will not do it
+ if (tracksOnSession || mTailBufferCount > 0) {
+ size_t numSamples = thread->frameCount() * thread->channelCount();
+ memset(mInBuffer, 0, numSamples * sizeof(int16_t));
+ if (mTailBufferCount > 0) {
+ mTailBufferCount--;
+ }
+ }
+ }
}
size_t size = mEffects.size();
- // do not process effect if no track is present in same audio session
- if (isGlobalSession || tracksOnSession) {
+ if (doProcess) {
for (size_t i = 0; i < size; i++) {
mEffects[i]->process();
}
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 4b794ef..897bc78 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -1247,6 +1247,10 @@
// corresponding to a suspend all request.
static const int kKeyForSuspendAll = 0;
+ // minimum duration during which we force calling effect process when last track on
+ // a session is stopped or removed to allow effect tail to be rendered
+ static const int kProcessTailDurationMs = 1000;
+
void process_l();
void lock() {
@@ -1287,7 +1291,8 @@
void decTrackCnt() { android_atomic_dec(&mTrackCnt); }
int32_t trackCnt() { return mTrackCnt;}
- void incActiveTrackCnt() { android_atomic_inc(&mActiveTrackCnt); }
+ void incActiveTrackCnt() { android_atomic_inc(&mActiveTrackCnt);
+ mTailBufferCount = mMaxTailBuffers; }
void decActiveTrackCnt() { android_atomic_dec(&mActiveTrackCnt); }
int32_t activeTrackCnt() { return mActiveTrackCnt;}
@@ -1338,6 +1343,8 @@
int16_t *mOutBuffer; // chain output buffer
volatile int32_t mActiveTrackCnt; // number of active tracks connected
volatile int32_t mTrackCnt; // number of tracks connected
+ int32_t mTailBufferCount; // current effect tail buffer count
+ int32_t mMaxTailBuffers; // maximum effect tail buffers
bool mOwnInBuffer; // true if the chain owns its input buffer
int mVolumeCtrlIdx; // index of insert effect having control over volume
uint32_t mLeftVolume; // previous volume on left channel
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 8c42f31..6e4aca7 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -26,8 +26,10 @@
import android.bluetooth.BluetoothTetheringDataTracker;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.ContextWrapper;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.res.Resources;
import android.database.ContentObserver;
import android.net.ConnectivityManager;
import android.net.DummyDataStateTracker;
@@ -51,6 +53,7 @@
import android.net.ProxyProperties;
import android.net.RouteInfo;
import android.net.wifi.WifiStateTracker;
+import android.net.wimax.WimaxManagerConstants;
import android.os.Binder;
import android.os.FileUtils;
import android.os.Handler;
@@ -78,10 +81,14 @@
import com.android.server.connectivity.Vpn;
import com.google.android.collect.Lists;
import com.google.android.collect.Sets;
-
+import dalvik.system.DexClassLoader;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.InvocationTargetException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -491,6 +498,12 @@
mNetTrackers[netType] = BluetoothTetheringDataTracker.getInstance();
mNetTrackers[netType].startMonitoring(context, mHandler);
break;
+ case ConnectivityManager.TYPE_WIMAX:
+ mNetTrackers[netType] = makeWimaxStateTracker();
+ if (mNetTrackers[netType]!= null) {
+ mNetTrackers[netType].startMonitoring(context, mHandler);
+ }
+ break;
case ConnectivityManager.TYPE_ETHERNET:
mNetTrackers[netType] = EthernetDataTracker.getInstance();
mNetTrackers[netType].startMonitoring(context, mHandler);
@@ -501,7 +514,9 @@
continue;
}
mCurrentLinkProperties[netType] = null;
- if (mNetConfigs[netType].isDefault()) mNetTrackers[netType].reconnect();
+ if (mNetTrackers[netType] != null && mNetConfigs[netType].isDefault()) {
+ mNetTrackers[netType].reconnect();
+ }
}
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
@@ -531,7 +546,81 @@
loadGlobalProxy();
}
+private NetworkStateTracker makeWimaxStateTracker() {
+ //Initialize Wimax
+ DexClassLoader wimaxClassLoader;
+ Class wimaxStateTrackerClass = null;
+ Class wimaxServiceClass = null;
+ Class wimaxManagerClass;
+ String wimaxJarLocation;
+ String wimaxLibLocation;
+ String wimaxManagerClassName;
+ String wimaxServiceClassName;
+ String wimaxStateTrackerClassName;
+ NetworkStateTracker wimaxStateTracker = null;
+
+ boolean isWimaxEnabled = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_wimaxEnabled);
+
+ if (isWimaxEnabled) {
+ try {
+ wimaxJarLocation = mContext.getResources().getString(
+ com.android.internal.R.string.config_wimaxServiceJarLocation);
+ wimaxLibLocation = mContext.getResources().getString(
+ com.android.internal.R.string.config_wimaxNativeLibLocation);
+ wimaxManagerClassName = mContext.getResources().getString(
+ com.android.internal.R.string.config_wimaxManagerClassname);
+ wimaxServiceClassName = mContext.getResources().getString(
+ com.android.internal.R.string.config_wimaxServiceClassname);
+ wimaxStateTrackerClassName = mContext.getResources().getString(
+ com.android.internal.R.string.config_wimaxStateTrackerClassname);
+
+ log("wimaxJarLocation: " + wimaxJarLocation);
+ wimaxClassLoader = new DexClassLoader(wimaxJarLocation,
+ new ContextWrapper(mContext).getCacheDir().getAbsolutePath(),
+ wimaxLibLocation, ClassLoader.getSystemClassLoader());
+
+ try {
+ wimaxManagerClass = wimaxClassLoader.loadClass(wimaxManagerClassName);
+ wimaxStateTrackerClass = wimaxClassLoader.loadClass(wimaxStateTrackerClassName);
+ wimaxServiceClass = wimaxClassLoader.loadClass(wimaxServiceClassName);
+ } catch (ClassNotFoundException ex) {
+ loge("Exception finding Wimax classes: " + ex.toString());
+ return null;
+ }
+ } catch(Resources.NotFoundException ex) {
+ loge("Wimax Resources does not exist!!! ");
+ return null;
+ }
+
+ try {
+ log("Starting Wimax Service... ");
+
+ Constructor wmxStTrkrConst = wimaxStateTrackerClass.getConstructor
+ (new Class[] {Context.class, Handler.class});
+ wimaxStateTracker = (NetworkStateTracker)wmxStTrkrConst.newInstance(mContext,
+ mHandler);
+
+ Constructor wmxSrvConst = wimaxServiceClass.getDeclaredConstructor
+ (new Class[] {Context.class, wimaxStateTrackerClass});
+ wmxSrvConst.setAccessible(true);
+ IBinder svcInvoker = (IBinder)wmxSrvConst.newInstance(mContext, wimaxStateTracker);
+ wmxSrvConst.setAccessible(false);
+
+ ServiceManager.addService(WimaxManagerConstants.WIMAX_SERVICE, svcInvoker);
+
+ } catch(Exception ex) {
+ loge("Exception creating Wimax classes: " + ex.toString());
+ return null;
+ }
+ } else {
+ loge("Wimax is not enabled or not added to the network attributes!!! ");
+ return null;
+ }
+
+ return wimaxStateTracker;
+ }
/**
* Sets the preferred network.
* @param preference the new preference
@@ -1508,6 +1597,7 @@
if (checkType == prevNetType) continue;
if (mNetConfigs[checkType] == null) continue;
if (!mNetConfigs[checkType].isDefault()) continue;
+ if (mNetTrackers[checkType] == null) continue;
// Enabling the isAvailable() optimization caused mobile to not get
// selected if it was in the middle of error handling. Specifically
diff --git a/services/java/com/android/server/DockObserver.java b/services/java/com/android/server/DockObserver.java
index dea9007..64789d3 100644
--- a/services/java/com/android/server/DockObserver.java
+++ b/services/java/com/android/server/DockObserver.java
@@ -82,7 +82,9 @@
// Don't force screen on when undocking from the desk dock.
// The change in power state will do this anyway.
// FIXME - we should be configurable.
- if (mPreviousDockState != Intent.EXTRA_DOCK_STATE_DESK ||
+ if ((mPreviousDockState != Intent.EXTRA_DOCK_STATE_DESK
+ && mPreviousDockState != Intent.EXTRA_DOCK_STATE_LE_DESK
+ && mPreviousDockState != Intent.EXTRA_DOCK_STATE_HE_DESK) ||
mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),
false, true);
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 6887de3..da960ae 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -1136,12 +1136,14 @@
final StringBuilder command = new StringBuilder();
command.append("bandwidth removeiquota ").append(iface);
+ mActiveQuotaIfaces.remove(iface);
+ mActiveAlertIfaces.remove(iface);
+
try {
// TODO: support quota shared across interfaces
mConnector.doCommand(command.toString());
- mActiveQuotaIfaces.remove(iface);
- mActiveAlertIfaces.remove(iface);
} catch (NativeDaemonConnectorException e) {
+ // TODO: include current iptables state
throw new IllegalStateException("Error communicating to native daemon", e);
}
}
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 1b0addf..6b23b33 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -100,10 +100,13 @@
private static final int LONG_KEYLIGHT_DELAY = 6000; // t+6 sec
private static final int LONG_DIM_TIME = 7000; // t+N-5 sec
- // How long to wait to debounce light sensor changes.
+ // How long to wait to debounce light sensor changes in milliseconds
private static final int LIGHT_SENSOR_DELAY = 2000;
- // For debouncing the proximity sensor.
+ // light sensor events rate in microseconds
+ private static final int LIGHT_SENSOR_RATE = 1000000;
+
+ // For debouncing the proximity sensor in milliseconds
private static final int PROXIMITY_SENSOR_DELAY = 1000;
// trigger proximity if distance is less than 5 cm
@@ -3049,7 +3052,7 @@
try {
if (enable) {
mSensorManager.registerListener(mLightListener, mLightSensor,
- SensorManager.SENSOR_DELAY_NORMAL);
+ LIGHT_SENSOR_RATE);
} else {
mSensorManager.unregisterListener(mLightListener);
mHandler.removeCallbacks(mAutoBrightnessTask);
diff --git a/services/java/com/android/server/TextServicesManagerService.java b/services/java/com/android/server/TextServicesManagerService.java
index b042da6..af9152d 100644
--- a/services/java/com/android/server/TextServicesManagerService.java
+++ b/services/java/com/android/server/TextServicesManagerService.java
@@ -40,6 +40,8 @@
import android.service.textservice.SpellCheckerService;
import android.text.TextUtils;
import android.util.Slog;
+import android.view.inputmethod.InputMethodManager;
+import android.view.inputmethod.InputMethodSubtype;
import android.view.textservice.SpellCheckerInfo;
import android.view.textservice.SpellCheckerSubtype;
@@ -222,20 +224,40 @@
if (hashCode == 0 && !allowImplicitlySelectedSubtype) {
return null;
}
- final String systemLocale =
- mContext.getResources().getConfiguration().locale.toString();
+ String candidateLocale = null;
+ if (hashCode == 0) {
+ // Spell checker language settings == "auto"
+ final InputMethodManager imm =
+ (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
+ if (imm != null) {
+ final InputMethodSubtype currentInputMethodSubtype =
+ imm.getCurrentInputMethodSubtype();
+ if (currentInputMethodSubtype != null) {
+ final String localeString = currentInputMethodSubtype.getLocale();
+ if (!TextUtils.isEmpty(localeString)) {
+ // 1. Use keyboard locale if available in the spell checker
+ candidateLocale = localeString;
+ }
+ }
+ }
+ if (candidateLocale == null) {
+ // 2. Use System locale if available in the spell checker
+ candidateLocale = mContext.getResources().getConfiguration().locale.toString();
+ }
+ }
SpellCheckerSubtype candidate = null;
for (int i = 0; i < sci.getSubtypeCount(); ++i) {
final SpellCheckerSubtype scs = sci.getSubtypeAt(i);
if (hashCode == 0) {
- if (systemLocale.equals(locale)) {
+ if (candidateLocale.equals(locale)) {
return scs;
} else if (candidate == null) {
final String scsLocale = scs.getLocale();
- if (systemLocale.length() >= 2
+ if (candidateLocale.length() >= 2
&& scsLocale.length() >= 2
- && systemLocale.substring(0, 2).equals(
+ && candidateLocale.substring(0, 2).equals(
scsLocale.substring(0, 2))) {
+ // Fall back to the applicable language
candidate = scs;
}
}
@@ -244,9 +266,13 @@
Slog.w(TAG, "Return subtype " + scs.hashCode() + ", input= " + locale
+ ", " + scs.getLocale());
}
+ // 3. Use the user specified spell check language
return scs;
}
}
+ // 4. Fall back to the applicable language and return it if not null
+ // 5. Simply just return it even if it's null which means we could find no suitable
+ // spell check languages
return candidate;
}
}
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 01eade1..3c65255 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -619,12 +619,7 @@
*/
public WifiConfiguration getWifiApConfiguration() {
enforceAccessPermission();
- if (mWifiStateMachineChannel != null) {
- return mWifiStateMachine.syncGetWifiApConfiguration(mWifiStateMachineChannel);
- } else {
- Slog.e(TAG, "mWifiStateMachineChannel is not initialized");
- return null;
- }
+ return mWifiStateMachine.syncGetWifiApConfiguration();
}
/**
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 4fe8119..cd63090 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1220,6 +1220,8 @@
}
Thread thread = new Thread() {
@Override public void run() {
+ StringBuilder dropBuilder = new StringBuilder(1024);
+ StringBuilder logBuilder = new StringBuilder(1024);
try {
java.lang.Process proc = Runtime.getRuntime().exec(new String[] {
"procrank", });
@@ -1233,16 +1235,29 @@
break;
}
if (line.length() > 0) {
- Slog.i(TAG, line);
+ logBuilder.append(line);
+ logBuilder.append('\n');
}
+ dropBuilder.append(line);
+ dropBuilder.append('\n');
}
converter.close();
} catch (IOException e) {
}
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
- dumpApplicationMemoryUsage(null, pw, " ", new String[] { }, true);
- Slog.i(TAG, sw.toString());
+ StringWriter catSw = new StringWriter();
+ PrintWriter catPw = new PrintWriter(catSw);
+ dumpApplicationMemoryUsage(null, pw, " ", new String[] { }, true, catPw);
+ String memUsage = sw.toString();
+ dropBuilder.append('\n');
+ dropBuilder.append(memUsage);
+ dropBuilder.append(catSw.toString());
+ logBuilder.append(memUsage);
+ addErrorToDropBox("watchdog", null, "system_server", null,
+ null, "Low on memory -- no more background processes",
+ dropBuilder.toString(), null, null);
+ Slog.i(TAG, logBuilder.toString());
synchronized (ActivityManagerService.this) {
long now = SystemClock.uptimeMillis();
if (mLastMemUsageReportTime < now) {
@@ -1394,7 +1409,7 @@
return;
}
- mActivityManagerService.dumpApplicationMemoryUsage(fd, pw, " ", args, false);
+ mActivityManagerService.dumpApplicationMemoryUsage(fd, pw, " ", args, false, null);
}
}
@@ -1654,7 +1669,7 @@
final void setFocusedActivityLocked(ActivityRecord r) {
if (mFocusedActivity != r) {
mFocusedActivity = r;
- mWindowManager.setFocusedApp(r, true);
+ mWindowManager.setFocusedApp(r.appToken, true);
}
}
@@ -2331,7 +2346,8 @@
// XXX we are not dealing with propagating grantedUriPermissions...
// those are not yet exposed to user code, so there is no need.
int res = mMainStack.startActivityLocked(r.app.thread, intent,
- r.resolvedType, null, 0, aInfo, resultTo, resultWho,
+ r.resolvedType, null, 0, aInfo,
+ resultTo != null ? resultTo.appToken : null, resultWho,
requestCode, -1, r.launchedFromUid, false, false, null);
Binder.restoreCallingIdentity(origId);
@@ -2414,10 +2430,10 @@
return;
}
final long origId = Binder.clearCallingIdentity();
- mWindowManager.setAppOrientation(r, requestedOrientation);
+ mWindowManager.setAppOrientation(r.appToken, requestedOrientation);
Configuration config = mWindowManager.updateOrientationFromAppTokens(
mConfiguration,
- r.mayFreezeScreenLocked(r.app) ? r : null);
+ r.mayFreezeScreenLocked(r.app) ? r.appToken : null);
if (config != null) {
r.frozenBeforeDestroy = true;
if (!updateConfigurationLocked(config, r, false)) {
@@ -2434,7 +2450,7 @@
if (r == null) {
return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
- return mWindowManager.getAppOrientation(r);
+ return mWindowManager.getAppOrientation(r.appToken);
}
}
@@ -2500,7 +2516,7 @@
for (int i=0; i<activities.size(); i++) {
ActivityRecord r = activities.get(i);
if (!r.finishing) {
- int index = mMainStack.indexOfTokenLocked(r);
+ int index = mMainStack.indexOfTokenLocked(r.appToken);
if (index >= 0) {
mMainStack.finishActivityLocked(r, index, Activity.RESULT_CANCELED,
null, "finish-heavy");
@@ -2602,7 +2618,7 @@
int i;
for (i=mMainStack.mHistory.size()-1; i>=0; i--) {
ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if (r == token) {
+ if (r.appToken == token) {
return true;
}
if (r.fullscreen && !r.finishing) {
@@ -2690,9 +2706,9 @@
r.makeFinishing();
mMainStack.mHistory.remove(i);
r.takeFromHistory();
- mWindowManager.removeAppToken(r);
+ mWindowManager.removeAppToken(r.appToken);
if (VALIDATE_TOKENS) {
- mWindowManager.validateAppTokens(mMainStack.mHistory);
+ mMainStack.validateAppTokensLocked();
}
r.removeUriPermissionsLocked();
@@ -3192,7 +3208,49 @@
return;
}
killPackageProcessesLocked(packageName, pkgUid,
- ProcessList.SERVICE_ADJ, false, true, true, false);
+ ProcessList.SERVICE_ADJ, false, true, true, false, "kill background");
+ }
+ } finally {
+ Binder.restoreCallingIdentity(callingId);
+ }
+ }
+
+ public void killAllBackgroundProcesses() {
+ if (checkCallingPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES)
+ != PackageManager.PERMISSION_GRANTED) {
+ String msg = "Permission Denial: killAllBackgroundProcesses() from pid="
+ + Binder.getCallingPid()
+ + ", uid=" + Binder.getCallingUid()
+ + " requires " + android.Manifest.permission.KILL_BACKGROUND_PROCESSES;
+ Slog.w(TAG, msg);
+ throw new SecurityException(msg);
+ }
+
+ long callingId = Binder.clearCallingIdentity();
+ try {
+ synchronized(this) {
+ ArrayList<ProcessRecord> procs = new ArrayList<ProcessRecord>();
+ for (SparseArray<ProcessRecord> apps : mProcessNames.getMap().values()) {
+ final int NA = apps.size();
+ for (int ia=0; ia<NA; ia++) {
+ ProcessRecord app = apps.valueAt(ia);
+ if (app.persistent) {
+ // we don't kill persistent processes
+ continue;
+ }
+ if (app.removed) {
+ procs.add(app);
+ } else if (app.setAdj >= ProcessList.HIDDEN_APP_MIN_ADJ) {
+ app.removed = true;
+ procs.add(app);
+ }
+ }
+ }
+
+ int N = procs.size();
+ for (int i=0; i<N; i++) {
+ removeProcessLocked(procs.get(i), false, true, "kill all background");
+ }
}
} finally {
Binder.restoreCallingIdentity(callingId);
@@ -3364,7 +3422,7 @@
private final boolean killPackageProcessesLocked(String packageName, int uid,
int minOomAdj, boolean callerWillRestart, boolean allowRestart, boolean doit,
- boolean evenPersistent) {
+ boolean evenPersistent, String reason) {
ArrayList<ProcessRecord> procs = new ArrayList<ProcessRecord>();
// Remove all processes this package may have touched: all with the
@@ -3399,7 +3457,7 @@
int N = procs.size();
for (int i=0; i<N; i++) {
- removeProcessLocked(procs.get(i), callerWillRestart, allowRestart);
+ removeProcessLocked(procs.get(i), callerWillRestart, allowRestart, reason);
}
return N > 0;
}
@@ -3430,7 +3488,7 @@
}
boolean didSomething = killPackageProcessesLocked(name, uid, -100,
- callerWillRestart, false, doit, evenPersistent);
+ callerWillRestart, false, doit, evenPersistent, "force stop");
TaskRecord lastTask = null;
for (i=0; i<mMainStack.mHistory.size(); i++) {
@@ -3518,11 +3576,11 @@
}
private final boolean removeProcessLocked(ProcessRecord app,
- boolean callerWillRestart, boolean allowRestart) {
+ boolean callerWillRestart, boolean allowRestart, String reason) {
final String name = app.processName;
final int uid = app.info.uid;
if (DEBUG_PROCESSES) Slog.d(
- TAG, "Force removing process " + app + " (" + name
+ TAG, "Force removing proc " + app.toShortString() + " (" + name
+ "/" + uid + ")");
mProcessNames.remove(name, uid);
@@ -3537,9 +3595,10 @@
mPidsSelfLocked.remove(pid);
mHandler.removeMessages(PROC_START_TIMEOUT_MSG, app);
}
+ Slog.i(TAG, "Killing proc " + app.toShortString() + ": " + reason);
handleAppDiedLocked(app, true, allowRestart);
mLruProcesses.remove(app);
- Process.killProcess(pid);
+ Process.killProcessQuiet(pid);
if (app.persistent) {
if (!callerWillRestart) {
@@ -5115,10 +5174,10 @@
if (topThumbnail != null) {
if (localLOGV) Slog.v(TAG, "Requesting top thumbnail");
try {
- topThumbnail.requestThumbnail(topRecord);
+ topThumbnail.requestThumbnail(topRecord.appToken);
} catch (Exception e) {
Slog.w(TAG, "Exception thrown when requesting thumbnail", e);
- sendPendingThumbnail(null, topRecord, null, null, true);
+ sendPendingThumbnail(null, topRecord.appToken, null, null, true);
}
}
@@ -5489,7 +5548,7 @@
TaskRecord lastTask = null;
for (int i=0; i<N; i++) {
ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if (r == token) {
+ if (r.appToken == token) {
if (!onlyRoot || lastTask != r.task) {
return r.task.taskId;
}
@@ -5510,7 +5569,7 @@
for (int i=0; i<N; i++) {
ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
if (r.realActivity.equals(className)
- && r != token && lastTask != r.task) {
+ && r.appToken != token && lastTask != r.task) {
if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
null, "others")) {
i--;
@@ -6846,7 +6905,7 @@
for (int i=procsToKill.size()-1; i>=0; i--) {
ProcessRecord proc = procsToKill.get(i);
Slog.i(TAG, "Removing system update proc: " + proc);
- removeProcessLocked(proc, true, false);
+ removeProcessLocked(proc, true, false, "system update done");
}
}
@@ -7042,7 +7101,7 @@
// Don't let services in this process be restarted and potentially
// annoy the user repeatedly. Unless it is persistent, since those
// processes run critical code.
- removeProcessLocked(app, false, false);
+ removeProcessLocked(app, false, false, "crash");
mMainStack.resumeTopActivityLocked(null);
return false;
}
@@ -7054,7 +7113,7 @@
// process, then terminate it to avoid getting in a loop.
Slog.w(TAG, " Force finishing activity "
+ r.intent.getComponent().flattenToShortString());
- int index = mMainStack.indexOfTokenLocked(r);
+ int index = mMainStack.indexOfActivityLocked(r);
r.stack.finishActivityLocked(r, index,
Activity.RESULT_CANCELED, null, "crashed");
// Also terminate any activities below it that aren't yet
@@ -8573,8 +8632,8 @@
try {
TransferPipe tp = new TransferPipe();
try {
- r.app.thread.dumpActivity(tp.getWriteFd().getFileDescriptor(), r,
- innerPrefix, args);
+ r.app.thread.dumpActivity(tp.getWriteFd().getFileDescriptor(),
+ r.appToken, innerPrefix, args);
tp.go(fd);
} finally {
tp.kill();
@@ -8990,8 +9049,8 @@
try {
TransferPipe tp = new TransferPipe();
try {
- r.app.thread.dumpActivity(tp.getWriteFd().getFileDescriptor(), r,
- innerPrefix, args);
+ r.app.thread.dumpActivity(tp.getWriteFd().getFileDescriptor(),
+ r.appToken, innerPrefix, args);
// Short timeout, since blocking here can
// deadlock with the application.
tp.go(fd, 2000);
@@ -9298,8 +9357,10 @@
}
final void dumpApplicationMemoryUsage(FileDescriptor fd,
- PrintWriter pw, String prefix, String[] args, boolean brief) {
+ PrintWriter pw, String prefix, String[] args, boolean brief,
+ PrintWriter categoryPw) {
boolean dumpAll = false;
+ boolean oomOnly = false;
int opti = 0;
while (opti < args.length) {
@@ -9310,9 +9371,12 @@
opti++;
if ("-a".equals(opt)) {
dumpAll = true;
+ } else if ("--oom".equals(opt)) {
+ oomOnly = true;
} else if ("-h".equals(opt)) {
- pw.println("meminfo dump options: [-a] [process]");
+ pw.println("meminfo dump options: [-a] [--oom] [process]");
pw.println(" -a: include all available information for each process.");
+ pw.println(" --oom: only show processes organized by oom adj.");
pw.println("If [process] is specified it can be the name or ");
pw.println("pid of a specific process to dump.");
return;
@@ -9438,7 +9502,7 @@
}
}
- if (!brief) {
+ if (!brief && !oomOnly) {
pw.println();
pw.println("Total PSS by process:");
dumpMemItems(pw, " ", procMems, true);
@@ -9446,10 +9510,11 @@
}
pw.println("Total PSS by OOM adjustment:");
dumpMemItems(pw, " ", oomMems, false);
- if (!brief) {
- pw.println();
- pw.println("Total PSS by category:");
- dumpMemItems(pw, " ", catMems, true);
+ if (!oomOnly) {
+ PrintWriter out = categoryPw != null ? categoryPw : pw;
+ out.println();
+ out.println("Total PSS by category:");
+ dumpMemItems(out, " ", catMems, true);
}
pw.println();
pw.print("Total PSS: "); pw.print(totalPss); pw.println(" Kb");
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index 00e6cb2..951a946 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -29,6 +29,7 @@
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
+import android.os.IBinder;
import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
@@ -48,9 +49,10 @@
/**
* An entry in the history stack, representing an activity.
*/
-final class ActivityRecord extends IApplicationToken.Stub {
+final class ActivityRecord {
final ActivityManagerService service; // owner
final ActivityStack stack; // owner
+ final IApplicationToken.Stub appToken; // window manager token
final ActivityInfo info; // all about me
final int launchedFromUid; // always the uid who started the activity.
final Intent intent; // the original intent that generated us
@@ -200,6 +202,70 @@
}
}
+ static class Token extends IApplicationToken.Stub {
+ final WeakReference<ActivityRecord> weakActivity;
+
+ Token(ActivityRecord activity) {
+ weakActivity = new WeakReference<ActivityRecord>(activity);
+ }
+
+ @Override public void windowsDrawn() throws RemoteException {
+ ActivityRecord activity = weakActivity.get();
+ if (activity != null) {
+ activity.windowsDrawn();
+ }
+ }
+
+ @Override public void windowsVisible() throws RemoteException {
+ ActivityRecord activity = weakActivity.get();
+ if (activity != null) {
+ activity.windowsVisible();
+ }
+ }
+
+ @Override public void windowsGone() throws RemoteException {
+ ActivityRecord activity = weakActivity.get();
+ if (activity != null) {
+ activity.windowsGone();
+ }
+ }
+
+ @Override public boolean keyDispatchingTimedOut() throws RemoteException {
+ ActivityRecord activity = weakActivity.get();
+ if (activity != null) {
+ return activity.keyDispatchingTimedOut();
+ }
+ return false;
+ }
+
+ @Override public long getKeyDispatchingTimeout() throws RemoteException {
+ ActivityRecord activity = weakActivity.get();
+ if (activity != null) {
+ return activity.getKeyDispatchingTimeout();
+ }
+ return 0;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder(128);
+ sb.append("Token{");
+ sb.append(Integer.toHexString(System.identityHashCode(this)));
+ sb.append(' ');
+ sb.append(weakActivity.get());
+ sb.append('}');
+ return sb.toString();
+ }
+ }
+
+ static ActivityRecord forToken(IBinder token) {
+ try {
+ return token != null ? ((Token)token).weakActivity.get() : null;
+ } catch (ClassCastException e) {
+ Slog.w(ActivityManagerService.TAG, "Bad activity token: " + token, e);
+ return null;
+ }
+ }
+
ActivityRecord(ActivityManagerService _service, ActivityStack _stack, ProcessRecord _caller,
int _launchedFromUid, Intent _intent, String _resolvedType,
ActivityInfo aInfo, Configuration _configuration,
@@ -207,6 +273,7 @@
boolean _componentSpecified) {
service = _service;
stack = _stack;
+ appToken = new Token(this);
info = aInfo;
launchedFromUid = _launchedFromUid;
intent = _intent;
@@ -445,7 +512,7 @@
ar.add(intent);
service.grantUriPermissionFromIntentLocked(callingUid, packageName,
intent, getUriPermissionsLocked());
- app.thread.scheduleNewIntent(ar, this);
+ app.thread.scheduleNewIntent(ar, appToken);
sent = true;
} catch (RemoteException e) {
Slog.w(ActivityManagerService.TAG,
@@ -470,14 +537,14 @@
void pauseKeyDispatchingLocked() {
if (!keysPaused) {
keysPaused = true;
- service.mWindowManager.pauseKeyDispatching(this);
+ service.mWindowManager.pauseKeyDispatching(appToken);
}
}
void resumeKeyDispatchingLocked() {
if (keysPaused) {
keysPaused = false;
- service.mWindowManager.resumeKeyDispatching(this);
+ service.mWindowManager.resumeKeyDispatching(appToken);
}
}
@@ -512,14 +579,14 @@
public void startFreezingScreenLocked(ProcessRecord app, int configChanges) {
if (mayFreezeScreenLocked(app)) {
- service.mWindowManager.startAppFreezingScreen(this, configChanges);
+ service.mWindowManager.startAppFreezingScreen(appToken, configChanges);
}
}
public void stopFreezingScreenLocked(boolean force) {
if (force || frozenBeforeDestroy) {
frozenBeforeDestroy = false;
- service.mWindowManager.stopAppFreezingScreen(this, force);
+ service.mWindowManager.stopAppFreezingScreen(appToken, force);
}
}
@@ -687,7 +754,7 @@
}
if (app != null && app.thread != null) {
try {
- app.thread.scheduleSleeping(this, _sleeping);
+ app.thread.scheduleSleeping(appToken, _sleeping);
if (sleeping && !stack.mGoingToSleepActivities.contains(this)) {
stack.mGoingToSleepActivities.add(this);
}
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 8435eaa..c892cb1 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -145,7 +145,12 @@
* running) activities. It contains HistoryRecord objects.
*/
final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
-
+
+ /**
+ * Used for validating app tokens with window manager.
+ */
+ final ArrayList<IBinder> mValidateAppTokens = new ArrayList<IBinder>();
+
/**
* List of running activities, sorted by recent usage.
* The first entry in the list is the least recently used.
@@ -294,11 +299,11 @@
}
} break;
case PAUSE_TIMEOUT_MSG: {
- IBinder token = (IBinder)msg.obj;
+ ActivityRecord r = (ActivityRecord)msg.obj;
// We don't at this point know if the activity is fullscreen,
// so we need to be conservative and assume it isn't.
- Slog.w(TAG, "Activity pause timeout for " + token);
- activityPaused(token, true);
+ Slog.w(TAG, "Activity pause timeout for " + r);
+ activityPaused(r != null ? r.appToken : null, true);
} break;
case IDLE_TIMEOUT_MSG: {
if (mService.mDidDexOpt) {
@@ -310,20 +315,20 @@
}
// We don't at this point know if the activity is fullscreen,
// so we need to be conservative and assume it isn't.
- IBinder token = (IBinder)msg.obj;
- Slog.w(TAG, "Activity idle timeout for " + token);
- activityIdleInternal(token, true, null);
+ ActivityRecord r = (ActivityRecord)msg.obj;
+ Slog.w(TAG, "Activity idle timeout for " + r);
+ activityIdleInternal(r != null ? r.appToken : null, true, null);
} break;
case DESTROY_TIMEOUT_MSG: {
- IBinder token = (IBinder)msg.obj;
+ ActivityRecord r = (ActivityRecord)msg.obj;
// We don't at this point know if the activity is fullscreen,
// so we need to be conservative and assume it isn't.
- Slog.w(TAG, "Activity destroy timeout for " + token);
- activityDestroyed(token);
+ Slog.w(TAG, "Activity destroy timeout for " + r);
+ activityDestroyed(r != null ? r.appToken : null);
} break;
case IDLE_NOW_MSG: {
- IBinder token = (IBinder)msg.obj;
- activityIdleInternal(token, false, null);
+ ActivityRecord r = (ActivityRecord)msg.obj;
+ activityIdleInternal(r != null ? r.appToken : null, false, null);
} break;
case LAUNCH_TIMEOUT_MSG: {
if (mService.mDidDexOpt) {
@@ -397,7 +402,7 @@
while (i >= 0) {
ActivityRecord r = mHistory.get(i);
// Note: the taskId check depends on real taskId fields being non-zero
- if (!r.finishing && (token != r) && (taskId != r.task.taskId)) {
+ if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId)) {
return r;
}
i--;
@@ -406,23 +411,17 @@
}
final int indexOfTokenLocked(IBinder token) {
- try {
- ActivityRecord r = (ActivityRecord)token;
- return mHistory.indexOf(r);
- } catch (ClassCastException e) {
- Slog.w(TAG, "Bad activity token: " + token, e);
- return -1;
- }
+ return mHistory.indexOf(ActivityRecord.forToken(token));
+ }
+
+ final int indexOfActivityLocked(ActivityRecord r) {
+ return mHistory.indexOf(r);
}
final ActivityRecord isInStackLocked(IBinder token) {
- try {
- ActivityRecord r = (ActivityRecord)token;
- if (mHistory.contains(r)) {
- return r;
- }
- } catch (ClassCastException e) {
- Slog.w(TAG, "Bad activity token: " + token, e);
+ ActivityRecord r = ActivityRecord.forToken(token);
+ if (mHistory.contains(r)) {
+ return r;
}
return null;
}
@@ -517,7 +516,7 @@
throws RemoteException {
r.startFreezingScreenLocked(app, 0);
- mService.mWindowManager.setAppVisibility(r, true);
+ mService.mWindowManager.setAppVisibility(r.appToken, true);
// Have the window manager re-evaluate the orientation of
// the screen based on the new activity order. Note that
@@ -528,7 +527,7 @@
if (checkConfig) {
Configuration config = mService.mWindowManager.updateOrientationFromAppTokens(
mService.mConfiguration,
- r.mayFreezeScreenLocked(app) ? r : null);
+ r.mayFreezeScreenLocked(app) ? r.appToken : null);
mService.updateConfigurationLocked(config, r, false);
}
@@ -590,7 +589,7 @@
profileFd = null;
}
}
- app.thread.scheduleLaunchActivity(new Intent(r.intent), r,
+ app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
System.identityHashCode(r), r.info, mService.mConfiguration,
r.compat, r.icicle, results, newIntents, !andResume,
mService.isNextTransitionForward(), profileFile, profileFd,
@@ -624,7 +623,7 @@
+ r.intent.getComponent().flattenToShortString()
+ ", giving up", e);
mService.appDiedLocked(app, app.pid, app.thread);
- requestFinishActivityLocked(r, Activity.RESULT_CANCELED, null,
+ requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
"2nd-crash");
return false;
}
@@ -821,7 +820,7 @@
}
if (w > 0) {
- return mService.mWindowManager.screenshotApplications(who, w, h);
+ return mService.mWindowManager.screenshotApplications(who.appToken, w, h);
}
return null;
}
@@ -856,8 +855,8 @@
EventLog.writeEvent(EventLogTags.AM_PAUSE_ACTIVITY,
System.identityHashCode(prev),
prev.shortComponentName);
- prev.app.thread.schedulePauseActivity(prev, prev.finishing, userLeaving,
- prev.configChangeFlags);
+ prev.app.thread.schedulePauseActivity(prev.appToken, prev.finishing,
+ userLeaving, prev.configChangeFlags);
if (mMainStack) {
mService.updateUsageStats(prev, false);
}
@@ -1129,7 +1128,7 @@
if (!r.visible) {
if (DEBUG_VISBILITY) Slog.v(
TAG, "Starting and making visible: " + r);
- mService.mWindowManager.setAppVisibility(r, true);
+ mService.mWindowManager.setAppVisibility(r.appToken, true);
}
if (r != starting) {
startSpecificActivityLocked(r, false, false);
@@ -1153,10 +1152,10 @@
if (DEBUG_VISBILITY) Slog.v(
TAG, "Making visible and scheduling visibility: " + r);
try {
- mService.mWindowManager.setAppVisibility(r, true);
+ mService.mWindowManager.setAppVisibility(r.appToken, true);
r.sleeping = false;
r.app.pendingUiClean = true;
- r.app.thread.scheduleWindowVisibility(r, true);
+ r.app.thread.scheduleWindowVisibility(r.appToken, true);
r.stopFreezingScreenLocked(false);
} catch (Exception e) {
// Just skip on any failure; we'll make it
@@ -1195,13 +1194,13 @@
TAG, "Making invisible: " + r);
r.visible = false;
try {
- mService.mWindowManager.setAppVisibility(r, false);
+ mService.mWindowManager.setAppVisibility(r.appToken, false);
if ((r.state == ActivityState.STOPPING
|| r.state == ActivityState.STOPPED)
&& r.app != null && r.app.thread != null) {
if (DEBUG_VISBILITY) Slog.v(
TAG, "Scheduling invisibility: " + r);
- r.app.thread.scheduleWindowVisibility(r, false);
+ r.app.thread.scheduleWindowVisibility(r.appToken, false);
}
} catch (Exception e) {
// Just skip on any failure; we'll make it
@@ -1351,7 +1350,7 @@
// previous should actually be hidden depending on whether the
// new one is found to be full-screen or not.
if (prev.finishing) {
- mService.mWindowManager.setAppVisibility(prev, false);
+ mService.mWindowManager.setAppVisibility(prev.appToken, false);
if (DEBUG_SWITCH) Slog.v(TAG, "Not waiting for visible to hide: "
+ prev + ", waitingVisible="
+ (prev != null ? prev.waitingVisible : null)
@@ -1399,8 +1398,8 @@
? WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE
: WindowManagerPolicy.TRANSIT_TASK_CLOSE, false);
}
- mService.mWindowManager.setAppWillBeHidden(prev);
- mService.mWindowManager.setAppVisibility(prev, false);
+ mService.mWindowManager.setAppWillBeHidden(prev.appToken);
+ mService.mWindowManager.setAppVisibility(prev.appToken, false);
} else {
if (DEBUG_TRANSITION) Slog.v(TAG,
"Prepare open transition: prev=" + prev);
@@ -1414,8 +1413,8 @@
}
}
if (false) {
- mService.mWindowManager.setAppWillBeHidden(prev);
- mService.mWindowManager.setAppVisibility(prev, false);
+ mService.mWindowManager.setAppWillBeHidden(prev.appToken);
+ mService.mWindowManager.setAppVisibility(prev.appToken, false);
}
} else if (mHistory.size() > 1) {
if (DEBUG_TRANSITION) Slog.v(TAG,
@@ -1433,7 +1432,7 @@
if (DEBUG_SWITCH) Slog.v(TAG, "Resume running: " + next);
// This activity is now becoming visible.
- mService.mWindowManager.setAppVisibility(next, true);
+ mService.mWindowManager.setAppVisibility(next.appToken, true);
ActivityRecord lastResumedActivity = mResumedActivity;
ActivityState lastState = next.state;
@@ -1457,7 +1456,7 @@
synchronized (mService) {
Configuration config = mService.mWindowManager.updateOrientationFromAppTokens(
mService.mConfiguration,
- next.mayFreezeScreenLocked(next.app) ? next : null);
+ next.mayFreezeScreenLocked(next.app) ? next.appToken : null);
if (config != null) {
next.frozenBeforeDestroy = true;
}
@@ -1496,12 +1495,12 @@
if (DEBUG_RESULTS) Slog.v(
TAG, "Delivering results to " + next
+ ": " + a);
- next.app.thread.scheduleSendResult(next, a);
+ next.app.thread.scheduleSendResult(next.appToken, a);
}
}
if (next.newIntents != null) {
- next.app.thread.scheduleNewIntent(next.newIntents, next);
+ next.app.thread.scheduleNewIntent(next.newIntents, next.appToken);
}
EventLog.writeEvent(EventLogTags.AM_RESUME_ACTIVITY,
@@ -1511,7 +1510,7 @@
next.sleeping = false;
showAskCompatModeDialogLocked(next);
next.app.pendingUiClean = true;
- next.app.thread.scheduleResumeActivity(next,
+ next.app.thread.scheduleResumeActivity(next.appToken,
mService.isNextTransitionForward());
checkReadyForSleepLocked();
@@ -1528,7 +1527,7 @@
} else {
if (SHOW_APP_STARTING_PREVIEW && mMainStack) {
mService.mWindowManager.setAppStartingWindow(
- next, next.packageName, next.theme,
+ next.appToken, next.packageName, next.theme,
mService.compatibilityInfoForPackageLocked(
next.info.applicationInfo),
next.nonLocalizedLabel,
@@ -1549,7 +1548,7 @@
// If any exception gets thrown, toss away this
// activity and try the next one.
Slog.w(TAG, "Exception thrown during resume of " + next, e);
- requestFinishActivityLocked(next, Activity.RESULT_CANCELED, null,
+ requestFinishActivityLocked(next.appToken, Activity.RESULT_CANCELED, null,
"resume-exception");
return true;
}
@@ -1567,7 +1566,7 @@
} else {
if (SHOW_APP_STARTING_PREVIEW) {
mService.mWindowManager.setAppStartingWindow(
- next, next.packageName, next.theme,
+ next.appToken, next.packageName, next.theme,
mService.compatibilityInfoForPackageLocked(
next.info.applicationInfo),
next.nonLocalizedLabel,
@@ -1610,10 +1609,10 @@
}
mHistory.add(addPos, r);
r.putInHistory();
- mService.mWindowManager.addAppToken(addPos, r, r.task.taskId,
+ mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
r.info.screenOrientation, r.fullscreen);
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
return;
}
@@ -1677,7 +1676,7 @@
mNoAnimActivities.remove(r);
}
mService.mWindowManager.addAppToken(
- addPos, r, r.task.taskId, r.info.screenOrientation, r.fullscreen);
+ addPos, r.appToken, r.task.taskId, r.info.screenOrientation, r.fullscreen);
boolean doShow = true;
if (newTask) {
// Even though this activity is starting fresh, we still need
@@ -1705,19 +1704,20 @@
else if (prev.nowVisible) prev = null;
}
mService.mWindowManager.setAppStartingWindow(
- r, r.packageName, r.theme,
+ r.appToken, r.packageName, r.theme,
mService.compatibilityInfoForPackageLocked(
r.info.applicationInfo), r.nonLocalizedLabel,
- r.labelRes, r.icon, r.windowFlags, prev, showStartingIcon);
+ r.labelRes, r.icon, r.windowFlags,
+ prev != null ? prev.appToken : null, showStartingIcon);
}
} else {
// If this is the first activity, don't do any fancy animations,
// because there is nothing for it to animate on top of.
- mService.mWindowManager.addAppToken(addPos, r, r.task.taskId,
+ mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
r.info.screenOrientation, r.fullscreen);
}
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
if (doResume) {
@@ -1725,6 +1725,15 @@
}
}
+ final void validateAppTokensLocked() {
+ mValidateAppTokens.clear();
+ mValidateAppTokens.ensureCapacity(mHistory.size());
+ for (int i=0; i<mHistory.size(); i++) {
+ mValidateAppTokens.add(mHistory.get(i).appToken);
+ }
+ mService.mWindowManager.validateAppTokens(mValidateAppTokens);
+ }
+
/**
* Perform a reset of the given task, if needed as part of launching it.
* Returns the new HistoryRecord at the top of the task.
@@ -1826,7 +1835,7 @@
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
+ " out to new task " + target.task);
}
- mService.mWindowManager.setAppGroupId(target, task.taskId);
+ mService.mWindowManager.setAppGroupId(target.appToken, task.taskId);
if (replyChainEnd < 0) {
replyChainEnd = targetI;
}
@@ -1849,11 +1858,11 @@
}
mHistory.remove(srcPos);
mHistory.add(dstPos, p);
- mService.mWindowManager.moveAppToken(dstPos, p);
- mService.mWindowManager.setAppGroupId(p, p.task.taskId);
+ mService.mWindowManager.moveAppToken(dstPos, p.appToken);
+ mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
dstPos++;
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
i++;
}
@@ -1985,10 +1994,10 @@
mHistory.add(lastReparentPos, p);
if (DEBUG_TASKS) Slog.v(TAG, "Pulling activity " + p
+ " in to resetting task " + task);
- mService.mWindowManager.moveAppToken(lastReparentPos, p);
- mService.mWindowManager.setAppGroupId(p, p.task.taskId);
+ mService.mWindowManager.moveAppToken(lastReparentPos, p.appToken);
+ mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
}
replyChainEnd = -1;
@@ -2081,7 +2090,7 @@
if (ret.launchMode == ActivityInfo.LAUNCH_MULTIPLE
&& (launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) == 0) {
if (!ret.finishing) {
- int index = indexOfTokenLocked(ret);
+ int index = indexOfTokenLocked(ret.appToken);
if (index >= 0) {
finishActivityLocked(ret, index, Activity.RESULT_CANCELED,
null, "clear");
@@ -3007,7 +3016,7 @@
return res;
}
- resultTo = outActivity[0];
+ resultTo = outActivity[0] != null ? outActivity[0].appToken : null;
}
}
} finally {
@@ -3065,7 +3074,7 @@
ArrayList<ResultInfo> list = new ArrayList<ResultInfo>();
list.add(new ResultInfo(resultWho, requestCode,
resultCode, data));
- r.app.thread.scheduleSendResult(r, list);
+ r.app.thread.scheduleSendResult(r.appToken, list);
return;
} catch (Exception e) {
Slog.w(TAG, "Exception thrown sending result to " + r, e);
@@ -3080,7 +3089,7 @@
if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_HISTORY) != 0
|| (r.info.flags&ActivityInfo.FLAG_NO_HISTORY) != 0) {
if (!r.finishing) {
- requestFinishActivityLocked(r, Activity.RESULT_CANCELED, null,
+ requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
"no-history");
}
} else if (r.app != null && r.app.thread != null) {
@@ -3098,9 +3107,9 @@
if (DEBUG_VISBILITY) Slog.v(
TAG, "Stopping visible=" + r.visible + " for " + r);
if (!r.visible) {
- mService.mWindowManager.setAppVisibility(r, false);
+ mService.mWindowManager.setAppVisibility(r.appToken, false);
}
- r.app.thread.scheduleStopActivity(r, r.visible, r.configChangeFlags);
+ r.app.thread.scheduleStopActivity(r.appToken, r.visible, r.configChangeFlags);
if (mService.isSleeping()) {
r.setSleeping(true);
}
@@ -3145,7 +3154,7 @@
// normal flow and hide it once we determine that it is
// hidden by the activities in front of it.
if (localLOGV) Slog.v(TAG, "Before stopping, can hide: " + s);
- mService.mWindowManager.setAppVisibility(s, false);
+ mService.mWindowManager.setAppVisibility(s.appToken, false);
}
}
if ((!s.waitingVisible || mService.isSleeping()) && remove) {
@@ -3186,14 +3195,14 @@
boolean enableScreen = false;
synchronized (mService) {
- if (token != null) {
- mHandler.removeMessages(IDLE_TIMEOUT_MSG, token);
+ ActivityRecord r = ActivityRecord.forToken(token);
+ if (r != null) {
+ mHandler.removeMessages(IDLE_TIMEOUT_MSG, r);
}
// Get the activity record.
- int index = indexOfTokenLocked(token);
+ int index = indexOfActivityLocked(r);
if (index >= 0) {
- ActivityRecord r = mHistory.get(index);
res = r;
if (fromTimeout) {
@@ -3413,7 +3422,7 @@
: WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE, false);
// Tell window manager to prepare for this one to be removed.
- mService.mWindowManager.setAppVisibility(r, false);
+ mService.mWindowManager.setAppVisibility(r.appToken, false);
if (mPausingActivity == null) {
if (DEBUG_PAUSE) Slog.v(TAG, "Finish needs to pause: " + r);
@@ -3440,7 +3449,7 @@
private final ActivityRecord finishCurrentActivityLocked(ActivityRecord r,
int mode) {
- final int index = indexOfTokenLocked(r);
+ final int index = indexOfActivityLocked(r);
if (index < 0) {
return null;
}
@@ -3570,9 +3579,9 @@
if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r
+ " (removed from history)");
r.state = ActivityState.DESTROYED;
- mService.mWindowManager.removeAppToken(r);
+ mService.mWindowManager.removeAppToken(r.appToken);
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
cleanUpActivityServicesLocked(r);
r.removeUriPermissionsLocked();
@@ -3653,7 +3662,7 @@
try {
if (DEBUG_SWITCH) Slog.i(TAG, "Destroying: " + r);
- r.app.thread.scheduleDestroyActivity(r, r.finishing,
+ r.app.thread.scheduleDestroyActivity(r.appToken, r.finishing,
r.configChangeFlags);
} catch (Exception e) {
// We can just ignore exceptions here... if the process
@@ -3712,11 +3721,13 @@
final void activityDestroyed(IBinder token) {
synchronized (mService) {
- mHandler.removeMessages(DESTROY_TIMEOUT_MSG, token);
+ ActivityRecord r = ActivityRecord.forToken(token);
+ if (r != null) {
+ mHandler.removeMessages(DESTROY_TIMEOUT_MSG, r);
+ }
- int index = indexOfTokenLocked(token);
+ int index = indexOfActivityLocked(r);
if (index >= 0) {
- ActivityRecord r = mHistory.get(index);
if (r.state == ActivityState.DESTROYING) {
final long origId = Binder.clearCallingIdentity();
removeActivityFromHistoryLocked(r);
@@ -3781,7 +3792,7 @@
return;
}
- ArrayList moved = new ArrayList();
+ ArrayList<IBinder> moved = new ArrayList<IBinder>();
// Applying the affinities may have removed entries from the history,
// so get the size again.
@@ -3803,7 +3814,7 @@
}
mHistory.remove(pos);
mHistory.add(top, r);
- moved.add(0, r);
+ moved.add(0, r.appToken);
top--;
}
pos--;
@@ -3826,7 +3837,7 @@
mService.mWindowManager.moveAppTokensToTop(moved);
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
finishTaskMoveLocked(task);
@@ -3873,7 +3884,7 @@
}
}
- ArrayList moved = new ArrayList();
+ ArrayList<IBinder> moved = new ArrayList<IBinder>();
if (DEBUG_TRANSITION) Slog.v(TAG,
"Prepare to back transition: task=" + task);
@@ -3898,7 +3909,7 @@
}
mHistory.remove(pos);
mHistory.add(bottom, r);
- moved.add(r);
+ moved.add(r.appToken);
bottom++;
}
pos++;
@@ -3918,7 +3929,7 @@
}
mService.mWindowManager.moveAppTokensToBottom(moved);
if (VALIDATE_TOKENS) {
- mService.mWindowManager.validateAppTokens(mHistory);
+ validateAppTokensLocked();
}
finishTaskMoveLocked(task);
@@ -4148,7 +4159,7 @@
if (r.app != null && r.app.thread != null) {
try {
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Sending new config to " + r);
- r.app.thread.scheduleActivityConfigurationChanged(r);
+ r.app.thread.scheduleActivityConfigurationChanged(r.appToken);
} catch (RemoteException e) {
// If process died, whatever.
}
@@ -4178,7 +4189,7 @@
try {
if (DEBUG_SWITCH) Slog.i(TAG, "Switch is restarting resumed " + r);
r.forceNewConfig = false;
- r.app.thread.scheduleRelaunchActivity(r, results, newIntents,
+ r.app.thread.scheduleRelaunchActivity(r.appToken, results, newIntents,
changes, !andResume, mService.mConfiguration);
// Note: don't need to call pauseIfSleepingLocked() here, because
// the caller will only pass in 'andResume' if this activity is
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 423a78f..c344bc6 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -73,7 +73,7 @@
private Context mContext;
private final static String TAG = "Tethering";
private final static boolean DBG = true;
- private final static boolean VDBG = true;
+ private final static boolean VDBG = false;
// TODO - remove both of these - should be part of interface inspection/selection stuff
private String[] mTetherableUsbRegexs;
@@ -228,7 +228,7 @@
if (isUsb(iface)) {
// ignore usb0 down after enabling RNDIS
// we will handle disconnect in interfaceRemoved instead
- if (VDBG) Log.d(TAG, "ignoring interface down for " + iface);
+ if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
} else if (sm != null) {
sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
mIfaces.remove(iface);
@@ -298,7 +298,6 @@
mIfaces.put(iface, sm);
sm.start();
}
- if (VDBG) Log.d(TAG, "interfaceAdded :" + iface);
}
public void interfaceRemoved(String iface) {
@@ -415,7 +414,7 @@
broadcast.putStringArrayListExtra(ConnectivityManager.EXTRA_ERRORED_TETHER,
erroredList);
mContext.sendStickyBroadcast(broadcast);
- if (VDBG) {
+ if (DBG) {
Log.d(TAG, "sendTetherStateChangedBroadcast " + availableList.size() + ", " +
activeList.size() + ", " + erroredList.size());
}
@@ -865,7 +864,7 @@
@Override
public boolean processMessage(Message message) {
- if (VDBG) Log.d(TAG, "InitialState.processMessage what=" + message.what);
+ if (DBG) Log.d(TAG, "InitialState.processMessage what=" + message.what);
boolean retValue = true;
switch (message.what) {
case CMD_TETHER_REQUESTED:
@@ -906,7 +905,7 @@
}
@Override
public boolean processMessage(Message message) {
- if (VDBG) Log.d(TAG, "StartingState.processMessage what=" + message.what);
+ if (DBG) Log.d(TAG, "StartingState.processMessage what=" + message.what);
boolean retValue = true;
switch (message.what) {
// maybe a parent class?
@@ -985,7 +984,7 @@
@Override
public boolean processMessage(Message message) {
- if (VDBG) Log.d(TAG, "TetheredState.processMessage what=" + message.what);
+ if (DBG) Log.d(TAG, "TetheredState.processMessage what=" + message.what);
boolean retValue = true;
boolean error = false;
switch (message.what) {
@@ -1061,7 +1060,7 @@
ConnectivityManager.TETHER_ERROR_MASTER_ERROR);
break;
}
- if (VDBG) Log.d(TAG, "Tether lost upstream connection " + mIfaceName);
+ if (DBG) Log.d(TAG, "Tether lost upstream connection " + mIfaceName);
sendTetherStateChangedBroadcast();
if (mUsb) {
if (!Tethering.this.configureUsbIface(false)) {
@@ -1296,7 +1295,7 @@
}
}
- if (VDBG) {
+ if (DBG) {
Log.d(TAG, "chooseUpstreamType(" + tryCell + "), preferredApn ="
+ mPreferredUpstreamMobileApn + ", got type=" + upType);
}
@@ -1328,7 +1327,7 @@
}
protected void notifyTetheredOfNewUpstreamIface(String ifaceName) {
- if (VDBG) Log.d(TAG, "notifying tethered with iface =" + ifaceName);
+ if (DBG) Log.d(TAG, "notifying tethered with iface =" + ifaceName);
mUpstreamIfaceName = ifaceName;
for (Object o : mNotifyList) {
TetherInterfaceSM sm = (TetherInterfaceSM)o;
@@ -1344,7 +1343,7 @@
}
@Override
public boolean processMessage(Message message) {
- if (VDBG) Log.d(TAG, "MasterInitialState.processMessage what=" + message.what);
+ if (DBG) Log.d(TAG, "MasterInitialState.processMessage what=" + message.what);
boolean retValue = true;
switch (message.what) {
case CMD_TETHER_MODE_REQUESTED:
@@ -1386,7 +1385,7 @@
}
@Override
public boolean processMessage(Message message) {
- if (VDBG) Log.d(TAG, "TetherModeAliveState.processMessage what=" + message.what);
+ if (DBG) Log.d(TAG, "TetherModeAliveState.processMessage what=" + message.what);
boolean retValue = true;
switch (message.what) {
case CMD_TETHER_MODE_REQUESTED:
diff --git a/services/java/com/android/server/net/NetworkPolicyManagerService.java b/services/java/com/android/server/net/NetworkPolicyManagerService.java
index 289ea1f..2a1b1db 100644
--- a/services/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -190,6 +190,7 @@
private static final int MSG_METERED_IFACES_CHANGED = 2;
private static final int MSG_FOREGROUND_ACTIVITIES_CHANGED = 3;
private static final int MSG_PROCESS_DIED = 4;
+ private static final int MSG_LIMIT_REACHED = 5;
private final Context mContext;
private final IActivityManager mActivityManager;
@@ -225,8 +226,6 @@
/** Set of currently active {@link Notification} tags. */
private HashSet<String> mActiveNotifs = Sets.newHashSet();
- /** Current values from {@link #setPolicyDataEnable(int, boolean)}. */
- private SparseBooleanArray mActiveNetworkEnabled = new SparseBooleanArray();
/** Foreground at both UID and PID granularity. */
private SparseBooleanArray mUidForeground = new SparseBooleanArray();
@@ -424,19 +423,8 @@
// only someone like NMS should be calling us
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
- synchronized (mRulesLock) {
- if (mMeteredIfaces.contains(iface) && !LIMIT_GLOBAL_ALERT.equals(limitName)) {
- try {
- // force stats update to make sure we have numbers that
- // caused alert to trigger.
- mNetworkStats.forceUpdate();
- } catch (RemoteException e) {
- // ignored; service lives in system_server
- }
-
- updateNetworkEnabledLocked();
- updateNotificationsLocked();
- }
+ if (!LIMIT_GLOBAL_ALERT.equals(limitName)) {
+ mHandler.obtainMessage(MSG_LIMIT_REACHED, iface).sendToTarget();
}
}
};
@@ -1481,6 +1469,25 @@
}
return true;
}
+ case MSG_LIMIT_REACHED: {
+ final String iface = (String) msg.obj;
+
+ synchronized (mRulesLock) {
+ if (mMeteredIfaces.contains(iface)) {
+ try {
+ // force stats update to make sure we have
+ // numbers that caused alert to trigger.
+ mNetworkStats.forceUpdate();
+ } catch (RemoteException e) {
+ // ignored; service lives in system_server
+ }
+
+ updateNetworkEnabledLocked();
+ updateNotificationsLocked();
+ }
+ }
+ return true;
+ }
default: {
return false;
}
@@ -1519,21 +1526,13 @@
}
/**
- * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)},
- * dispatching only when actually changed.
+ * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)}.
*/
private void setPolicyDataEnable(int networkType, boolean enabled) {
- synchronized (mActiveNetworkEnabled) {
- final boolean prevEnabled = mActiveNetworkEnabled.get(networkType, true);
- if (prevEnabled == enabled) return;
-
- try {
- mConnManager.setPolicyDataEnable(networkType, enabled);
- } catch (RemoteException e) {
- // ignored; service lives in system_server
- }
-
- mActiveNetworkEnabled.put(networkType, enabled);
+ try {
+ mConnManager.setPolicyDataEnable(networkType, enabled);
+ } catch (RemoteException e) {
+ // ignored; service lives in system_server
}
}
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index 494c655..6365525 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -152,10 +152,6 @@
private static final String TAG_NETSTATS_ERROR = "netstats_error";
- private static final String DEV = "dev";
- private static final String XT = "xt";
- private static final String UID = "uid";
-
private final Context mContext;
private final INetworkManagementService mNetworkManager;
private final IAlarmManager mAlarmManager;
@@ -278,6 +274,9 @@
readNetworkXtStatsLocked();
}
+ // bootstrap initial stats to prevent double-counting later
+ bootstrapStats();
+
// watch for network interfaces to be claimed
final IntentFilter connFilter = new IntentFilter(CONNECTIVITY_ACTION_IMMEDIATE);
mContext.registerReceiver(mConnReceiver, connFilter, CONNECTIVITY_INTERNAL, mHandler);
@@ -311,9 +310,6 @@
registerPollAlarmLocked();
registerGlobalAlert();
- // bootstrap initial stats to prevent double-counting later
- bootstrapStats();
-
mDropBox = (DropBoxManager) mContext.getSystemService(Context.DROPBOX_SERVICE);
}
@@ -810,9 +806,7 @@
final NetworkStats networkDevSnapshot;
try {
// collect any tethering stats
- final String[] tetheredIfacePairs = mConnManager.getTetheredIfacePairs();
- final NetworkStats tetherSnapshot = mNetworkManager.getNetworkStatsTethering(
- tetheredIfacePairs);
+ final NetworkStats tetherSnapshot = getNetworkStatsTethering();
// record uid stats, folding in tethering stats
uidSnapshot = mNetworkManager.getNetworkStatsUidDetail(UID_ALL);
@@ -837,9 +831,9 @@
// persist when enough network data has occurred
final long persistNetworkDevDelta = computeStatsDelta(
- mLastPersistNetworkDevSnapshot, networkDevSnapshot, true, DEV).getTotalBytes();
+ mLastPersistNetworkDevSnapshot, networkDevSnapshot, true, "devp").getTotalBytes();
final long persistNetworkXtDelta = computeStatsDelta(
- mLastPersistNetworkXtSnapshot, networkXtSnapshot, true, XT).getTotalBytes();
+ mLastPersistNetworkXtSnapshot, networkXtSnapshot, true, "xtp").getTotalBytes();
final boolean networkOverThreshold = persistNetworkDevDelta > threshold
|| persistNetworkXtDelta > threshold;
if (persistForce || (persistNetwork && networkOverThreshold)) {
@@ -851,7 +845,7 @@
// persist when enough uid data has occurred
final long persistUidDelta = computeStatsDelta(
- mLastPersistUidSnapshot, uidSnapshot, true, UID).getTotalBytes();
+ mLastPersistUidSnapshot, uidSnapshot, true, "uidp").getTotalBytes();
if (persistForce || (persistUid && persistUidDelta > threshold)) {
writeUidStatsLocked();
mLastPersistUidSnapshot = uidSnapshot;
@@ -880,7 +874,7 @@
final HashSet<String> unknownIface = Sets.newHashSet();
final NetworkStats delta = computeStatsDelta(
- mLastPollNetworkDevSnapshot, networkDevSnapshot, false, DEV);
+ mLastPollNetworkDevSnapshot, networkDevSnapshot, false, "dev");
final long timeStart = currentTime - delta.getElapsedRealtime();
NetworkStats.Entry entry = null;
@@ -910,7 +904,7 @@
final HashSet<String> unknownIface = Sets.newHashSet();
final NetworkStats delta = computeStatsDelta(
- mLastPollNetworkXtSnapshot, networkXtSnapshot, false, XT);
+ mLastPollNetworkXtSnapshot, networkXtSnapshot, false, "xt");
final long timeStart = currentTime - delta.getElapsedRealtime();
NetworkStats.Entry entry = null;
@@ -940,9 +934,9 @@
ensureUidStatsLoadedLocked();
final NetworkStats delta = computeStatsDelta(
- mLastPollUidSnapshot, uidSnapshot, false, UID);
+ mLastPollUidSnapshot, uidSnapshot, false, "uid");
final NetworkStats operationsDelta = computeStatsDelta(
- mLastPollOperationsSnapshot, mOperations, false, UID);
+ mLastPollOperationsSnapshot, mOperations, false, "uidop");
final long timeStart = currentTime - delta.getElapsedRealtime();
NetworkStats.Entry entry = null;
@@ -971,8 +965,7 @@
}
mLastPollUidSnapshot = uidSnapshot;
- mLastPollOperationsSnapshot = mOperations;
- mOperations = new NetworkStats(0L, 10);
+ mLastPollOperationsSnapshot = mOperations.clone();
}
/**
@@ -1510,20 +1503,25 @@
NetworkStats before, NetworkStats current, boolean collectStale, String type) {
if (before != null) {
try {
- return current.subtract(before);
+ return current.subtract(before, false);
} catch (NonMonotonicException e) {
Log.w(TAG, "found non-monotonic values; saving to dropbox");
// record error for debugging
final StringBuilder builder = new StringBuilder();
- builder.append("found non-monotonic " + type + "values at left[" + e.leftIndex
+ builder.append("found non-monotonic " + type + " values at left[" + e.leftIndex
+ "] - right[" + e.rightIndex + "]\n");
builder.append("left=").append(e.left).append('\n');
builder.append("right=").append(e.right).append('\n');
mDropBox.addText(TAG_NETSTATS_ERROR, builder.toString());
- // return empty delta to avoid recording broken stats
- return new NetworkStats(0L, 10);
+ try {
+ // return clamped delta to help recover
+ return current.subtract(before, true);
+ } catch (NonMonotonicException e1) {
+ Log.wtf(TAG, "found non-monotonic values; returning empty delta", e1);
+ return new NetworkStats(0L, 10);
+ }
}
} else if (collectStale) {
// caller is okay collecting stale stats for first call.
@@ -1535,6 +1533,20 @@
}
}
+ /**
+ * Return snapshot of current tethering statistics. Will return empty
+ * {@link NetworkStats} if any problems are encountered.
+ */
+ private NetworkStats getNetworkStatsTethering() throws RemoteException {
+ try {
+ final String[] tetheredIfacePairs = mConnManager.getTetheredIfacePairs();
+ return mNetworkManager.getNetworkStatsTethering(tetheredIfacePairs);
+ } catch (IllegalStateException e) {
+ Log.wtf(TAG, "problem reading network stats", e);
+ return new NetworkStats(0L, 10);
+ }
+ }
+
private static NetworkStats computeNetworkXtSnapshotFromUid(NetworkStats uidSnapshot) {
return uidSnapshot.groupedByIface();
}
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index bfe6613..36442a0 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -63,6 +63,8 @@
import java.util.HashSet;
import java.util.Iterator;
+import libcore.io.IoUtils;
+
/**
* Holds information about dynamic settings.
*/
@@ -998,8 +1000,8 @@
FileUtils.sync(fstr);
str.close();
journal.commit();
- }
- catch (Exception e) {
+ } catch (Exception e) {
+ IoUtils.closeQuietly(str);
journal.rollback();
}
diff --git a/services/java/com/android/server/wm/InputManager.java b/services/java/com/android/server/wm/InputManager.java
index df7e0e1..a4f0a0c2 100644
--- a/services/java/com/android/server/wm/InputManager.java
+++ b/services/java/com/android/server/wm/InputManager.java
@@ -675,7 +675,13 @@
} catch (NumberFormatException e) {
}
if (result < 1) {
- result = 55;
+ // This number equates to the refresh rate * 1.5. The rate should be at least
+ // equal to the screen refresh rate. We increase the rate by 50% to compensate for
+ // the discontinuity between the actual rate that events come in at (they do
+ // not necessarily come in constantly and are not handled synchronously).
+ // Ideally, we would use Display.getRefreshRate(), but as this does not necessarily
+ // return a sensible result, we use '60' as our default assumed refresh rate.
+ result = 90;
}
return result;
}
diff --git a/services/java/com/android/server/wm/ScreenRotationAnimation.java b/services/java/com/android/server/wm/ScreenRotationAnimation.java
index 131f11c..8fc9a70 100644
--- a/services/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -88,13 +88,14 @@
try {
try {
mSurface = new Surface(session, 0, "FreezeSurface",
- -1, mWidth, mHeight, PixelFormat.OPAQUE, Surface.FX_SURFACE_SCREENSHOT);
+ -1, mWidth, mHeight, PixelFormat.OPAQUE, Surface.FX_SURFACE_SCREENSHOT | Surface.HIDDEN);
if (mSurface == null || !mSurface.isValid()) {
// Screenshot failed, punt.
mSurface = null;
return;
}
mSurface.setLayer(FREEZE_LAYER + 1);
+ mSurface.show();
} catch (Surface.OutOfResourcesException e) {
Slog.w(TAG, "Unable to allocate freeze surface", e);
}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 8ed7966..50321b3 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -3070,7 +3070,7 @@
// Application Window Tokens
// -------------------------------------------------------------
- public void validateAppTokens(List tokens) {
+ public void validateAppTokens(List<IBinder> tokens) {
int v = tokens.size()-1;
int m = mAppTokens.size()-1;
while (v >= 0 && m >= 0) {
@@ -5809,7 +5809,87 @@
return curSize;
}
- private int computeSmallestWidth(boolean rotated, int dw, int dh, float density) {
+ private int reduceConfigLayout(int curLayout, int rotation, float density,
+ int dw, int dh) {
+ // Get the app screen size at this rotation.
+ int w = mPolicy.getNonDecorDisplayWidth(dw, dh, rotation);
+ int h = mPolicy.getNonDecorDisplayHeight(dw, dh, rotation);
+
+ // Compute the screen layout size class for this rotation.
+ int screenLayoutSize;
+ boolean screenLayoutLong;
+ boolean screenLayoutCompatNeeded;
+ int longSize = w;
+ int shortSize = h;
+ if (longSize < shortSize) {
+ int tmp = longSize;
+ longSize = shortSize;
+ shortSize = tmp;
+ }
+ longSize = (int)(longSize/density);
+ shortSize = (int)(shortSize/density);
+
+ // These semi-magic numbers define our compatibility modes for
+ // applications with different screens. These are guarantees to
+ // app developers about the space they can expect for a particular
+ // configuration. DO NOT CHANGE!
+ if (longSize < 470) {
+ // This is shorter than an HVGA normal density screen (which
+ // is 480 pixels on its long side).
+ screenLayoutSize = Configuration.SCREENLAYOUT_SIZE_SMALL;
+ screenLayoutLong = false;
+ screenLayoutCompatNeeded = false;
+ } else {
+ // What size is this screen screen?
+ if (longSize >= 960 && shortSize >= 720) {
+ // 1.5xVGA or larger screens at medium density are the point
+ // at which we consider it to be an extra large screen.
+ screenLayoutSize = Configuration.SCREENLAYOUT_SIZE_XLARGE;
+ } else if (longSize >= 640 && shortSize >= 480) {
+ // VGA or larger screens at medium density are the point
+ // at which we consider it to be a large screen.
+ screenLayoutSize = Configuration.SCREENLAYOUT_SIZE_LARGE;
+ } else {
+ screenLayoutSize = Configuration.SCREENLAYOUT_SIZE_NORMAL;
+ }
+
+ // If this screen is wider than normal HVGA, or taller
+ // than FWVGA, then for old apps we want to run in size
+ // compatibility mode.
+ if (shortSize > 321 || longSize > 570) {
+ screenLayoutCompatNeeded = true;
+ } else {
+ screenLayoutCompatNeeded = false;
+ }
+
+ // Is this a long screen?
+ if (((longSize*3)/5) >= (shortSize-1)) {
+ // Anything wider than WVGA (5:3) is considering to be long.
+ screenLayoutLong = true;
+ } else {
+ screenLayoutLong = false;
+ }
+ }
+
+ // Now reduce the last screenLayout to not be better than what we
+ // have found.
+ if (!screenLayoutLong) {
+ curLayout = (curLayout&~Configuration.SCREENLAYOUT_LONG_MASK)
+ | Configuration.SCREENLAYOUT_LONG_NO;
+ }
+ if (screenLayoutCompatNeeded) {
+ curLayout |= Configuration.SCREENLAYOUT_COMPAT_NEEDED;
+ }
+ int curSize = curLayout&Configuration.SCREENLAYOUT_SIZE_MASK;
+ if (screenLayoutSize < curSize) {
+ curLayout = (curLayout&~Configuration.SCREENLAYOUT_SIZE_MASK)
+ | screenLayoutSize;
+ }
+ return curLayout;
+ }
+
+ private void computeSmallestWidthAndScreenLayout(boolean rotated, int dw, int dh,
+ float density, Configuration outConfig) {
// We need to determine the smallest width that will occur under normal
// operation. To this, start with the base screen size and compute the
// width under the different possible rotations. We need to un-rotate
@@ -5826,7 +5906,14 @@
sw = reduceConfigWidthSize(sw, Surface.ROTATION_90, density, unrotDh, unrotDw);
sw = reduceConfigWidthSize(sw, Surface.ROTATION_180, density, unrotDw, unrotDh);
sw = reduceConfigWidthSize(sw, Surface.ROTATION_270, density, unrotDh, unrotDw);
- return sw;
+ int sl = Configuration.SCREENLAYOUT_SIZE_XLARGE
+ | Configuration.SCREENLAYOUT_LONG_YES;
+ sl = reduceConfigLayout(sl, Surface.ROTATION_0, density, unrotDw, unrotDh);
+ sl = reduceConfigLayout(sl, Surface.ROTATION_90, density, unrotDh, unrotDw);
+ sl = reduceConfigLayout(sl, Surface.ROTATION_180, density, unrotDw, unrotDh);
+ sl = reduceConfigLayout(sl, Surface.ROTATION_270, density, unrotDh, unrotDw);
+ outConfig.smallestScreenWidthDp = sw;
+ outConfig.screenLayout = sl;
}
private int reduceCompatConfigWidthSize(int curSize, int rotation, DisplayMetrics dm,
@@ -5924,64 +6011,12 @@
/ dm.density);
config.screenHeightDp = (int)(mPolicy.getConfigDisplayHeight(dw, dh, mRotation)
/ dm.density);
- config.smallestScreenWidthDp = computeSmallestWidth(rotated, dw, dh, dm.density);
+ computeSmallestWidthAndScreenLayout(rotated, dw, dh, dm.density, config);
config.compatScreenWidthDp = (int)(config.screenWidthDp / mCompatibleScreenScale);
config.compatScreenHeightDp = (int)(config.screenHeightDp / mCompatibleScreenScale);
config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated, dm, dw, dh);
- // Compute the screen layout size class.
- int screenLayout;
- int longSize = mAppDisplayWidth;
- int shortSize = mAppDisplayHeight;
- if (longSize < shortSize) {
- int tmp = longSize;
- longSize = shortSize;
- shortSize = tmp;
- }
- longSize = (int)(longSize/dm.density);
- shortSize = (int)(shortSize/dm.density);
-
- // These semi-magic numbers define our compatibility modes for
- // applications with different screens. These are guarantees to
- // app developers about the space they can expect for a particular
- // configuration. DO NOT CHANGE!
- if (longSize < 470) {
- // This is shorter than an HVGA normal density screen (which
- // is 480 pixels on its long side).
- screenLayout = Configuration.SCREENLAYOUT_SIZE_SMALL
- | Configuration.SCREENLAYOUT_LONG_NO;
- } else {
- // What size is this screen screen?
- if (longSize >= 960 && shortSize >= 720) {
- // 1.5xVGA or larger screens at medium density are the point
- // at which we consider it to be an extra large screen.
- screenLayout = Configuration.SCREENLAYOUT_SIZE_XLARGE;
- } else if (longSize >= 640 && shortSize >= 480) {
- // VGA or larger screens at medium density are the point
- // at which we consider it to be a large screen.
- screenLayout = Configuration.SCREENLAYOUT_SIZE_LARGE;
- } else {
- screenLayout = Configuration.SCREENLAYOUT_SIZE_NORMAL;
- }
-
- // If this screen is wider than normal HVGA, or taller
- // than FWVGA, then for old apps we want to run in size
- // compatibility mode.
- if (shortSize > 321 || longSize > 570) {
- screenLayout |= Configuration.SCREENLAYOUT_COMPAT_NEEDED;
- }
-
- // Is this a long screen?
- if (((longSize*3)/5) >= (shortSize-1)) {
- // Anything wider than WVGA (5:3) is considering to be long.
- screenLayout |= Configuration.SCREENLAYOUT_LONG_YES;
- } else {
- screenLayout |= Configuration.SCREENLAYOUT_LONG_NO;
- }
- }
- config.screenLayout = screenLayout;
-
// Determine whether a hard keyboard is available and enabled.
boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
if (hardKeyboardAvailable != mHardKeyboardAvailable) {
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index d82a7e2..7575ebd 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -166,7 +166,11 @@
ssize_t SensorDevice::poll(sensors_event_t* buffer, size_t count) {
if (!mSensorDevice) return NO_INIT;
- return mSensorDevice->poll(mSensorDevice, buffer, count);
+ ssize_t c;
+ do {
+ c = mSensorDevice->poll(mSensorDevice, buffer, count);
+ } while (c == -EINTR);
+ return c;
}
status_t SensorDevice::activate(void* ident, int handle, int enabled)
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index d2d2d8b..6202143 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -286,7 +286,8 @@
}
} while (count >= 0 || Thread::exitPending());
- LOGW("Exiting SensorService::threadLoop!");
+ LOGW("Exiting SensorService::threadLoop => aborting...");
+ abort();
return false;
}
@@ -478,8 +479,9 @@
if (ns < 0)
return BAD_VALUE;
- if (ns == 0) {
- ns = sensor->getSensor().getMinDelayNs();
+ nsecs_t minDelayNs = sensor->getSensor().getMinDelayNs();
+ if (ns < minDelayNs) {
+ ns = minDelayNs;
}
if (ns < MINIMUM_EVENTS_PERIOD)
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index b916bd7..53502db 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -31,7 +31,7 @@
endif
ifneq (,$(findstring $(TARGET_DEVICE),tuna toro maguro))
- LOCAL_CFLAGS += -DREFRESH_RATE=48
+ LOCAL_CFLAGS += -DREFRESH_RATE=59
endif
diff --git a/services/surfaceflinger/LayerScreenshot.cpp b/services/surfaceflinger/LayerScreenshot.cpp
index e30ccbf..68e6660 100644
--- a/services/surfaceflinger/LayerScreenshot.cpp
+++ b/services/surfaceflinger/LayerScreenshot.cpp
@@ -27,6 +27,7 @@
#include "SurfaceFlinger.h"
#include "DisplayHardware/DisplayHardware.h"
+
namespace android {
// ---------------------------------------------------------------------------
@@ -45,23 +46,64 @@
}
}
+status_t LayerScreenshot::captureLocked() {
+ GLfloat u, v;
+ status_t result = mFlinger->renderScreenToTextureLocked(0, &mTextureName, &u, &v);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ initTexture(u, v);
+ return NO_ERROR;
+}
+
status_t LayerScreenshot::capture() {
GLfloat u, v;
status_t result = mFlinger->renderScreenToTexture(0, &mTextureName, &u, &v);
if (result != NO_ERROR) {
return result;
}
+ initTexture(u, v);
+ return NO_ERROR;
+}
+void LayerScreenshot::initTexture(GLfloat u, GLfloat v) {
glBindTexture(GL_TEXTURE_2D, mTextureName);
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-
mTexCoords[0] = 0; mTexCoords[1] = v;
mTexCoords[2] = 0; mTexCoords[3] = 0;
mTexCoords[4] = u; mTexCoords[5] = 0;
mTexCoords[6] = u; mTexCoords[7] = v;
+}
- return NO_ERROR;
+void LayerScreenshot::initStates(uint32_t w, uint32_t h, uint32_t flags) {
+ LayerBaseClient::initStates(w, h, flags);
+ if (!(flags & ISurfaceComposer::eHidden)) {
+ capture();
+ }
+}
+
+uint32_t LayerScreenshot::doTransaction(uint32_t flags)
+{
+ const Layer::State& draw(drawingState());
+ const Layer::State& curr(currentState());
+
+ if (draw.flags & ISurfaceComposer::eLayerHidden) {
+ if (!(curr.flags & ISurfaceComposer::eLayerHidden)) {
+ // we're going from hidden to visible
+ status_t err = captureLocked();
+ if (err != NO_ERROR) {
+ LOGW("createScreenshotSurface failed (%s)", strerror(-err));
+ }
+ }
+ } else if (curr.flags & ISurfaceComposer::eLayerHidden) {
+ // we're going from visible to hidden
+ if (mTextureName) {
+ glDeleteTextures(1, &mTextureName);
+ mTextureName = 0;
+ }
+ }
+ return LayerBaseClient::doTransaction(flags);
}
void LayerScreenshot::onDraw(const Region& clip) const
diff --git a/services/surfaceflinger/LayerScreenshot.h b/services/surfaceflinger/LayerScreenshot.h
index e3a2b19..ab90047 100644
--- a/services/surfaceflinger/LayerScreenshot.h
+++ b/services/surfaceflinger/LayerScreenshot.h
@@ -41,12 +41,18 @@
status_t capture();
+ virtual void initStates(uint32_t w, uint32_t h, uint32_t flags);
+ virtual uint32_t doTransaction(uint32_t flags);
virtual void onDraw(const Region& clip) const;
virtual bool isOpaque() const { return false; }
virtual bool isSecure() const { return false; }
virtual bool isProtectedByApp() const { return false; }
virtual bool isProtectedByDRM() const { return false; }
virtual const char* getTypeId() const { return "LayerScreenshot"; }
+
+private:
+ status_t captureLocked();
+ void initTexture(GLfloat u, GLfloat v);
};
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index a6d4147..1b00e93 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1217,23 +1217,25 @@
sp<Client> client( static_cast<Client *>(s.client.get()) );
transactionFlags |= setClientStateLocked(client, s.state);
}
- if (transactionFlags) {
- setTransactionFlags(transactionFlags);
- }
- // if this is a synchronous transaction, wait for it to take effect before
- // returning.
- if (flags & eSynchronous) {
- mTransationPending = true;
- }
- while (mTransationPending) {
- status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5));
- if (CC_UNLIKELY(err != NO_ERROR)) {
- // just in case something goes wrong in SF, return to the
- // called after a few seconds.
- LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
- mTransationPending = false;
- break;
+ if (transactionFlags) {
+ // this triggers the transaction
+ setTransactionFlags(transactionFlags);
+
+ // if this is a synchronous transaction, wait for it to take effect
+ // before returning.
+ if (flags & eSynchronous) {
+ mTransationPending = true;
+ }
+ while (mTransationPending) {
+ status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5));
+ if (CC_UNLIKELY(err != NO_ERROR)) {
+ // just in case something goes wrong in SF, return to the
+ // called after a few seconds.
+ LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
+ mTransationPending = false;
+ break;
+ }
}
}
}
@@ -1360,11 +1362,6 @@
uint32_t w, uint32_t h, uint32_t flags)
{
sp<LayerScreenshot> layer = new LayerScreenshot(this, display, client);
- status_t err = layer->capture();
- if (err != NO_ERROR) {
- layer.clear();
- LOGW("createScreenshotSurface failed (%s)", strerror(-err));
- }
return layer;
}
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index ea5bfa7..17028db 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -186,6 +186,8 @@
status_t renderScreenToTexture(DisplayID dpy,
GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
+ status_t renderScreenToTextureLocked(DisplayID dpy,
+ GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
status_t postMessageAsync(const sp<MessageBase>& msg,
nsecs_t reltime=0, uint32_t flags = 0);
@@ -328,8 +330,6 @@
status_t turnElectronBeamOnImplLocked(int32_t mode);
status_t electronBeamOffAnimationImplLocked();
status_t electronBeamOnAnimationImplLocked();
- status_t renderScreenToTextureLocked(DisplayID dpy,
- GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
void debugFlashRegions();
void debugShowFPS() const;
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 34f8848..f2ccb5b 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1513,14 +1513,65 @@
static final int MIN_MATCH = 7;
/**
- * isEmergencyNumber: checks a given number against the list of
- * emergency numbers provided by the RIL and SIM card.
+ * Checks a given number against the list of
+ * emergency numbers provided by the RIL and SIM card.
*
* @param number the number to look up.
- * @return if the number is in the list of emergency numbers
- * listed in the ril / sim, then return true, otherwise false.
+ * @return true if the number is in the list of emergency numbers
+ * listed in the RIL / SIM, otherwise return false.
*/
public static boolean isEmergencyNumber(String number) {
+ // Return true only if the specified number *exactly* matches
+ // one of the emergency numbers listed by the RIL / SIM.
+ return isEmergencyNumberInternal(number, true /* useExactMatch */);
+ }
+
+ /**
+ * Checks if given number might *potentially* result in
+ * a call to an emergency service on the current network.
+ *
+ * Specifically, this method will return true if the specified number
+ * is an emergency number according to the list managed by the RIL or
+ * SIM, *or* if the specified number simply starts with the same
+ * digits as any of the emergency numbers listed in the RIL / SIM.
+ *
+ * This method is intended for internal use by the phone app when
+ * deciding whether to allow ACTION_CALL intents from 3rd party apps
+ * (where we're required to *not* allow emergency calls to be placed.)
+ *
+ * @param number the number to look up.
+ * @return true if the number is in the list of emergency numbers
+ * listed in the RIL / SIM, *or* if the number starts with the
+ * same digits as any of those emergency numbers.
+ *
+ * @hide
+ */
+ public static boolean isPotentialEmergencyNumber(String number) {
+ // Check against the emergency numbers listed by the RIL / SIM,
+ // and *don't* require an exact match.
+ return isEmergencyNumberInternal(number, false /* useExactMatch */);
+ }
+
+ /**
+ * Helper function for isEmergencyNumber(String) and
+ * isPotentialEmergencyNumber(String).
+ *
+ * @param number the number to look up.
+ *
+ * @param useExactMatch if true, consider a number to be an emergency
+ * number only if it *exactly* matches a number listed in
+ * the RIL / SIM. If false, a number is considered to be an
+ * emergency number if it simply starts with the same digits
+ * as any of the emergency numbers listed in the RIL / SIM.
+ * (Setting useExactMatch to false allows you to identify
+ * number that could *potentially* result in emergency calls
+ * since many networks will actually ignore trailing digits
+ * after a valid emergency number.)
+ *
+ * @return true if the number is in the list of emergency numbers
+ * listed in the RIL / sim, otherwise return false.
+ */
+ private static boolean isEmergencyNumberInternal(String number, boolean useExactMatch) {
// If the number passed in is null, just return false:
if (number == null) return false;
@@ -1540,16 +1591,26 @@
// searches through the comma-separated list for a match,
// return true if one is found.
for (String emergencyNum : numbers.split(",")) {
- if (number.startsWith(emergencyNum)) {
- return true;
+ if (useExactMatch) {
+ if (number.equals(emergencyNum)) {
+ return true;
+ }
+ } else {
+ if (number.startsWith(emergencyNum)) {
+ return true;
+ }
}
}
// no matches found against the list!
return false;
}
- //no ecclist system property, so use our own list.
- return (number.startsWith("112") || number.startsWith("911"));
+ // No ecclist system property, so use our own list.
+ if (useExactMatch) {
+ return (number.equals("112") || number.equals("911"));
+ } else {
+ return (number.startsWith("112") || number.startsWith("911"));
+ }
}
/**
@@ -1559,31 +1620,81 @@
* @param defaultCountryIso the specific country which the number should be checked against
* @return if the number is an emergency number for the specific country, then return true,
* otherwise false
+ *
* @hide
*/
public static boolean isEmergencyNumber(String number, String defaultCountryIso) {
- PhoneNumberUtil util = PhoneNumberUtil.getInstance();
- try {
- PhoneNumber pn = util.parse(number, defaultCountryIso);
- // libphonenumber guarantees short numbers such as emergency numbers are classified as
- // invalid. Therefore, if the number passes the validation test, we believe it is not an
- // emergency number.
- // TODO: Compare against a list of country-specific known emergency numbers instead, once
- // that has been collected.
- if (util.isValidNumber(pn)) {
- return false;
- } else if ("BR".equalsIgnoreCase(defaultCountryIso) && number.length() >= 8) {
- // This is to prevent Brazilian local numbers which start with 911 being incorrectly
- // classified as emergency numbers. 911 is not an emergency number in Brazil; it is also
- // not possible to append additional digits to an emergency number to dial the number in
- // Brazil - it won't connect.
- // TODO: Clean this up once a list of country-specific known emergency numbers is
- // collected.
- return false;
+ return isEmergencyNumberInternal(number,
+ defaultCountryIso,
+ true /* useExactMatch */);
+ }
+
+ /**
+ * Checks if a given number might *potentially* result in a call to an
+ * emergency service, for a specific country.
+ *
+ * Specifically, this method will return true if the specified number
+ * is an emergency number in the specified country, *or* if the number
+ * simply starts with the same digits as any emergency number for that
+ * country.
+ *
+ * This method is intended for internal use by the phone app when
+ * deciding whether to allow ACTION_CALL intents from 3rd party apps
+ * (where we're required to *not* allow emergency calls to be placed.)
+ *
+ * @param number the number to look up.
+ * @param defaultCountryIso the specific country which the number should be checked against
+ * @return true if the number is an emergency number for the specific
+ * country, *or* if the number starts with the same digits as
+ * any of those emergency numbers.
+ *
+ * @hide
+ */
+ public static boolean isPotentialEmergencyNumber(String number, String defaultCountryIso) {
+ return isEmergencyNumberInternal(number,
+ defaultCountryIso,
+ false /* useExactMatch */);
+ }
+
+ /**
+ * Helper function for isEmergencyNumber(String, String) and
+ * isPotentialEmergencyNumber(String, String).
+ *
+ * @param number the number to look up.
+ * @param defaultCountryIso the specific country which the number should be checked against
+ * @param useExactMatch if true, consider a number to be an emergency
+ * number only if it *exactly* matches a number listed in
+ * the RIL / SIM. If false, a number is considered to be an
+ * emergency number if it simply starts with the same digits
+ * as any of the emergency numbers listed in the RIL / SIM.
+ *
+ * @return true if the number is an emergency number for the specified country.
+ */
+ private static boolean isEmergencyNumberInternal(String number,
+ String defaultCountryIso,
+ boolean useExactMatch) {
+ PhoneNumberUtil util = PhoneNumberUtil.getInstance();
+ try {
+ PhoneNumber pn = util.parse(number, defaultCountryIso);
+ // libphonenumber guarantees short numbers such as emergency numbers are classified as
+ // invalid. Therefore, if the number passes the validation test, we believe it is not an
+ // emergency number.
+ // TODO: Compare against a list of country-specific known emergency numbers instead, once
+ // that has been collected.
+ if (util.isValidNumber(pn)) {
+ return false;
+ } else if ("BR".equalsIgnoreCase(defaultCountryIso) && number.length() >= 8) {
+ // This is to prevent Brazilian local numbers which start with 911 being incorrectly
+ // classified as emergency numbers. 911 is not an emergency number in Brazil; it is also
+ // not possible to append additional digits to an emergency number to dial the number in
+ // Brazil - it won't connect.
+ // TODO: Clean this up once a list of country-specific known emergency numbers is
+ // collected.
+ return false;
+ }
+ } catch (NumberParseException e) {
}
- } catch (NumberParseException e) {
- }
- return isEmergencyNumber(number);
+ return isEmergencyNumberInternal(number, useExactMatch);
}
/**
@@ -1592,12 +1703,66 @@
*
* @param number the number to look up.
* @param context the specific context which the number should be checked against
- * @return if a phone number is an emergency number for a local country, based on the
- * CountryDetector.
+ * @return true if the specified number is an emergency number for a local country, based on the
+ * CountryDetector.
+ *
* @see android.location.CountryDetector
* @hide
*/
public static boolean isLocalEmergencyNumber(String number, Context context) {
+ return isLocalEmergencyNumberInternal(number,
+ context,
+ true /* useExactMatch */);
+ }
+
+ /**
+ * Checks if a given number might *potentially* result in a call to an
+ * emergency service, for the country that the user is in. The current
+ * country is determined using the CountryDetector.
+ *
+ * Specifically, this method will return true if the specified number
+ * is an emergency number in the current country, *or* if the number
+ * simply starts with the same digits as any emergency number for the
+ * current country.
+ *
+ * This method is intended for internal use by the phone app when
+ * deciding whether to allow ACTION_CALL intents from 3rd party apps
+ * (where we're required to *not* allow emergency calls to be placed.)
+ *
+ * @param number the number to look up.
+ * @param context the specific context which the number should be checked against
+ * @return true if the specified number is an emergency number for a local country, based on the
+ * CountryDetector.
+ *
+ * @see android.location.CountryDetector
+ * @hide
+ */
+ public static boolean isPotentialLocalEmergencyNumber(String number, Context context) {
+ return isLocalEmergencyNumberInternal(number,
+ context,
+ false /* useExactMatch */);
+ }
+
+ /**
+ * Helper function for isLocalEmergencyNumber() and
+ * isPotentialLocalEmergencyNumber().
+ *
+ * @param number the number to look up.
+ * @param context the specific context which the number should be checked against
+ * @param useExactMatch if true, consider a number to be an emergency
+ * number only if it *exactly* matches a number listed in
+ * the RIL / SIM. If false, a number is considered to be an
+ * emergency number if it simply starts with the same digits
+ * as any of the emergency numbers listed in the RIL / SIM.
+ *
+ * @return true if the specified number is an emergency number for a
+ * local country, based on the CountryDetector.
+ *
+ * @see android.location.CountryDetector
+ */
+ private static boolean isLocalEmergencyNumberInternal(String number,
+ Context context,
+ boolean useExactMatch) {
String countryIso;
CountryDetector detector = (CountryDetector) context.getSystemService(
Context.COUNTRY_DETECTOR);
@@ -1609,7 +1774,7 @@
Log.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: "
+ countryIso);
}
- return isEmergencyNumber(number, countryIso);
+ return isEmergencyNumberInternal(number, countryIso, useExactMatch);
}
/**
diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java
index fc8a145..1410747 100644
--- a/telephony/java/android/telephony/SmsMessage.java
+++ b/telephony/java/android/telephony/SmsMessage.java
@@ -291,12 +291,31 @@
// flexibly...
int limit;
- if (ted.msgCount > 1) {
- limit = (ted.codeUnitSize == ENCODING_7BIT) ?
- MAX_USER_DATA_SEPTETS_WITH_HEADER : MAX_USER_DATA_BYTES_WITH_HEADER;
+ if (ted.codeUnitSize == ENCODING_7BIT) {
+ int udhLength;
+ if (ted.languageTable != 0 && ted.languageShiftTable != 0) {
+ udhLength = GsmAlphabet.UDH_SEPTET_COST_TWO_SHIFT_TABLES;
+ } else if (ted.languageTable != 0 || ted.languageShiftTable != 0) {
+ udhLength = GsmAlphabet.UDH_SEPTET_COST_ONE_SHIFT_TABLE;
+ } else {
+ udhLength = 0;
+ }
+
+ if (ted.msgCount > 1) {
+ udhLength += GsmAlphabet.UDH_SEPTET_COST_CONCATENATED_MESSAGE;
+ }
+
+ if (udhLength != 0) {
+ udhLength += GsmAlphabet.UDH_SEPTET_COST_LENGTH;
+ }
+
+ limit = MAX_USER_DATA_SEPTETS - udhLength;
} else {
- limit = (ted.codeUnitSize == ENCODING_7BIT) ?
- MAX_USER_DATA_SEPTETS : MAX_USER_DATA_BYTES;
+ if (ted.msgCount > 1) {
+ limit = MAX_USER_DATA_BYTES_WITH_HEADER;
+ } else {
+ limit = MAX_USER_DATA_BYTES;
+ }
}
int pos = 0; // Index in code units.
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java
index 171b371..3dd57ee 100644
--- a/telephony/java/com/android/internal/telephony/CallManager.java
+++ b/telephony/java/com/android/internal/telephony/CallManager.java
@@ -379,18 +379,19 @@
mode = AudioManager.MODE_RINGTONE;
break;
case OFFHOOK:
- Phone fgPhone = getFgPhone();
- // While foreground call is in DIALING,
- // ALERTING, ACTIVE and DISCONNECTING state
- if (getActiveFgCallState() != Call.State.IDLE
- && getActiveFgCallState() != Call.State.DISCONNECTED) {
- if (fgPhone instanceof SipPhone) {
- // enable IN_COMMUNICATION audio mode for sipPhone
- mode = AudioManager.MODE_IN_COMMUNICATION;
- } else {
- // enable IN_CALL audio mode for telephony
- mode = AudioManager.MODE_IN_CALL;
- }
+ Phone offhookPhone = getFgPhone();
+ if (getActiveFgCallState() == Call.State.IDLE) {
+ // There is no active Fg calls, the OFFHOOK state
+ // is set by the Bg call. So set the phone to bgPhone.
+ offhookPhone = getBgPhone();
+ }
+
+ if (offhookPhone instanceof SipPhone) {
+ // enable IN_COMMUNICATION audio mode for sipPhone
+ mode = AudioManager.MODE_IN_COMMUNICATION;
+ } else {
+ // enable IN_CALL audio mode for telephony
+ mode = AudioManager.MODE_IN_CALL;
}
break;
}
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 5b13603..6d9a2c2 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -167,7 +167,9 @@
// independent of mInternalDataEnabled and requests for APN access
// persisted
protected boolean mUserDataEnabled = true;
- protected boolean mPolicyDataEnabled = true;
+
+ // TODO: move away from static state once 5587429 is fixed.
+ protected static boolean sPolicyDataEnabled = true;
private boolean[] dataEnabled = new boolean[APN_NUM_TYPES];
@@ -211,7 +213,7 @@
protected static final String NULL_IP = "0.0.0.0";
// Default for the data stall alarm
- protected static final int DATA_STALL_ALARM_DELAY_IN_MS_DEFAULT = 1000 * 60 * 3;
+ protected static final int DATA_STALL_ALARM_DELAY_IN_MS_DEFAULT = 1000 * 60 * 6;
// If attempt is less than this value we're doing first level recovery
protected static final int DATA_STALL_NO_RECV_POLL_LIMIT = 1;
// Tag for tracking stale alarms
@@ -766,7 +768,7 @@
public boolean getAnyDataEnabled() {
final boolean result;
synchronized (mDataEnabledLock) {
- result = (mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled
+ result = (mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled
&& (enabledCount != 0));
}
if (!result && DBG) log("getAnyDataEnabled " + result);
@@ -1132,8 +1134,8 @@
protected void onSetPolicyDataEnabled(boolean enabled) {
synchronized (mDataEnabledLock) {
final boolean prevEnabled = getAnyDataEnabled();
- if (mPolicyDataEnabled != enabled) {
- mPolicyDataEnabled = enabled;
+ if (sPolicyDataEnabled != enabled) {
+ sPolicyDataEnabled = enabled;
if (prevEnabled != getAnyDataEnabled()) {
if (!prevEnabled) {
resetAllRetryCounts();
diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
index 2e99849..25647ac 100644
--- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java
+++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
@@ -60,25 +60,25 @@
* all combinations of header elements below will have at least one free bit
* when padding to the nearest septet boundary.
*/
- private static final int UDH_SEPTET_COST_LENGTH = 1;
+ public static final int UDH_SEPTET_COST_LENGTH = 1;
/**
* Using a non-default language locking shift table OR single shift table
* requires a user data header of 3 octets, or 4 septets, plus UDH length.
*/
- private static final int UDH_SEPTET_COST_ONE_SHIFT_TABLE = 4;
+ public static final int UDH_SEPTET_COST_ONE_SHIFT_TABLE = 4;
/**
* Using a non-default language locking shift table AND single shift table
* requires a user data header of 6 octets, or 7 septets, plus UDH length.
*/
- private static final int UDH_SEPTET_COST_TWO_SHIFT_TABLES = 7;
+ public static final int UDH_SEPTET_COST_TWO_SHIFT_TABLES = 7;
/**
* Multi-part messages require a user data header of 5 octets, or 6 septets,
* plus UDH length.
*/
- private static final int UDH_SEPTET_COST_CONCATENATED_MESSAGE = 6;
+ public static final int UDH_SEPTET_COST_CONCATENATED_MESSAGE = 6;
/**
* Converts a char to a GSM 7 bit table index.
diff --git a/telephony/java/com/android/internal/telephony/cat/CatService.java b/telephony/java/com/android/internal/telephony/cat/CatService.java
index 5420264..5a994f3 100644
--- a/telephony/java/com/android/internal/telephony/cat/CatService.java
+++ b/telephony/java/com/android/internal/telephony/cat/CatService.java
@@ -94,6 +94,8 @@
private static final int DEV_ID_TERMINAL = 0x82;
private static final int DEV_ID_NETWORK = 0x83;
+ static final String STK_DEFAULT = "Defualt Message";
+
/* Intentionally private for singleton */
private CatService(CommandsInterface ci, IccRecords ir, Context context,
IccFileHandler fh, IccCard ic) {
@@ -157,7 +159,15 @@
}
break;
case MSG_ID_PROACTIVE_COMMAND:
- cmdParams = (CommandParams) rilMsg.mData;
+ try {
+ cmdParams = (CommandParams) rilMsg.mData;
+ } catch (ClassCastException e) {
+ // for error handling : cast exception
+ CatLog.d(this, "Fail to parse proactive command");
+ sendTerminalResponse(mCurrntCmd.mCmdDet, ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+ false, 0x00, null);
+ break;
+ }
if (cmdParams != null) {
if (rilMsg.mResCode == ResultCode.OK) {
handleProactiveCommand(cmdParams);
@@ -194,6 +204,7 @@
private void handleProactiveCommand(CommandParams cmdParams) {
CatLog.d(this, cmdParams.getCommandType().name());
+ CharSequence message;
CatCmdMessage cmdMsg = new CatCmdMessage(cmdParams);
switch (cmdParams.getCommandType()) {
case SET_UP_MENU:
@@ -224,26 +235,44 @@
case CommandParamsFactory.DTTZ_SETTING:
resp = new DTTZResponseData(null);
sendTerminalResponse(cmdParams.cmdDet, ResultCode.OK, false, 0, resp);
- break;
+ return;
case CommandParamsFactory.LANGUAGE_SETTING:
resp = new LanguageResponseData(Locale.getDefault().getLanguage());
sendTerminalResponse(cmdParams.cmdDet, ResultCode.OK, false, 0, resp);
- break;
+ return;
default:
sendTerminalResponse(cmdParams.cmdDet, ResultCode.OK, false, 0, null);
return;
}
case LAUNCH_BROWSER:
+ if ((((LaunchBrowserParams) cmdParams).confirmMsg.text != null)
+ && (((LaunchBrowserParams) cmdParams).confirmMsg.text.equals(STK_DEFAULT))) {
+ message = mContext.getText(com.android.internal.R.string.launchBrowserDefault);
+ ((LaunchBrowserParams) cmdParams).confirmMsg.text = message.toString();
+ }
+ break;
case SELECT_ITEM:
case GET_INPUT:
case GET_INKEY:
+ break;
case SEND_DTMF:
case SEND_SMS:
case SEND_SS:
case SEND_USSD:
+ if ((((DisplayTextParams)cmdParams).textMsg.text != null)
+ && (((DisplayTextParams)cmdParams).textMsg.text.equals(STK_DEFAULT))) {
+ message = mContext.getText(com.android.internal.R.string.sending);
+ ((DisplayTextParams)cmdParams).textMsg.text = message.toString();
+ }
+ break;
case PLAY_TONE:
+ break;
case SET_UP_CALL:
- // nothing to do on telephony!
+ if ((((CallSetupParams) cmdParams).confirmMsg.text != null)
+ && (((CallSetupParams) cmdParams).confirmMsg.text.equals(STK_DEFAULT))) {
+ message = mContext.getText(com.android.internal.R.string.SetupCallDefault);
+ ((CallSetupParams) cmdParams).confirmMsg.text = message.toString();
+ }
break;
default:
CatLog.d(this, "Unsupported command");
diff --git a/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java b/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
index 686fe46..e7fca5a 100644
--- a/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
+++ b/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
@@ -403,6 +403,7 @@
input.ucs2 = (cmdDet.commandQualifier & 0x02) != 0;
input.yesNo = (cmdDet.commandQualifier & 0x04) != 0;
input.helpAvailable = (cmdDet.commandQualifier & 0x80) != 0;
+ input.echo = true;
mCmdParams = new GetInputParams(cmdDet, input);
@@ -625,11 +626,7 @@
ComprehensionTlv ctlv = searchForTag(ComprehensionTlvTag.ALPHA_ID,
ctlvs);
- if (ctlv != null) {
- textMsg.text = ValueParser.retrieveAlphaId(ctlv);
- } else {
- throw new ResultException(ResultCode.REQUIRED_VALUES_MISSING);
- }
+ textMsg.text = ValueParser.retrieveAlphaId(ctlv);
ctlv = searchForTag(ComprehensionTlvTag.ICON_ID, ctlvs);
if (ctlv != null) {
@@ -714,9 +711,8 @@
// parse alpha identifier.
ctlv = searchForTag(ComprehensionTlvTag.ALPHA_ID, ctlvs);
- if (ctlv != null) {
- confirmMsg.text = ValueParser.retrieveAlphaId(ctlv);
- }
+ confirmMsg.text = ValueParser.retrieveAlphaId(ctlv);
+
// parse icon identifier
ctlv = searchForTag(ComprehensionTlvTag.ICON_ID, ctlvs);
if (ctlv != null) {
@@ -841,9 +837,7 @@
// get confirmation message string.
ctlv = searchForNextTag(ComprehensionTlvTag.ALPHA_ID, iter);
- if (ctlv != null) {
- confirmMsg.text = ValueParser.retrieveAlphaId(ctlv);
- }
+ confirmMsg.text = ValueParser.retrieveAlphaId(ctlv);
ctlv = searchForTag(ComprehensionTlvTag.ICON_ID, ctlvs);
if (ctlv != null) {
diff --git a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
index 99f662d..ab26d13 100644
--- a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
+++ b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 The Android Open Source Project
+ * Copyright (C) 2011 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.
@@ -28,6 +28,7 @@
* {@hide}
*/
class ComprehensionTlv {
+ private static final String LOG_TAG = "ComprehensionTlv";
private int mTag;
private boolean mCr;
private int mLength;
@@ -88,8 +89,14 @@
int endIndex = data.length;
while (startIndex < endIndex) {
ComprehensionTlv ctlv = ComprehensionTlv.decode(data, startIndex);
- items.add(ctlv);
- startIndex = ctlv.mValueIndex + ctlv.mLength;
+ if (ctlv != null) {
+ items.add(ctlv);
+ startIndex = ctlv.mValueIndex + ctlv.mLength;
+ } else {
+ CatLog.d(LOG_TAG, "decodeMany: ctlv is null, stop decoding");
+ items.clear();
+ break;
+ }
}
return items;
@@ -117,7 +124,10 @@
case 0:
case 0xff:
case 0x80:
- throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+ // for error handling
+ // these one make exception while decoding the abnormal command.
+ // (in case of Ghana MTN simcard , JDI simcard)
+ return null;
case 0x7f: // tag is in three-byte format
tag = ((data[curIndex] & 0xff) << 8)
diff --git a/telephony/java/com/android/internal/telephony/cat/ValueParser.java b/telephony/java/com/android/internal/telephony/cat/ValueParser.java
index 34e4811..584d96c 100644
--- a/telephony/java/com/android/internal/telephony/cat/ValueParser.java
+++ b/telephony/java/com/android/internal/telephony/cat/ValueParser.java
@@ -273,18 +273,23 @@
*/
static String retrieveAlphaId(ComprehensionTlv ctlv) throws ResultException {
- byte[] rawValue = ctlv.getRawValue();
- int valueIndex = ctlv.getValueIndex();
- int length = ctlv.getLength();
- if (length != 0) {
- try {
- return IccUtils.adnStringFieldToString(rawValue, valueIndex,
- length);
- } catch (IndexOutOfBoundsException e) {
- throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+ if (ctlv != null) {
+ byte[] rawValue = ctlv.getRawValue();
+ int valueIndex = ctlv.getValueIndex();
+ int length = ctlv.getLength();
+ if (length != 0) {
+ try {
+ return IccUtils.adnStringFieldToString(rawValue, valueIndex,
+ length);
+ } catch (IndexOutOfBoundsException e) {
+ throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+ }
+ } else {
+ return CatService.STK_DEFAULT;
}
+ } else {
+ return CatService.STK_DEFAULT;
}
- return null;
}
/**
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 865caf6..7cd01a1 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -549,7 +549,7 @@
@Override
public boolean getAnyDataEnabled() {
synchronized (mDataEnabledLock) {
- if (!(mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled)) return false;
+ if (!(mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled)) return false;
for (ApnContext apnContext : mApnContexts.values()) {
// Make sure we dont have a context that going down
// and is explicitly disabled.
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmSmsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmSmsTest.java
index 41a719e..5950669 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmSmsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmSmsTest.java
@@ -16,11 +16,14 @@
package com.android.internal.telephony;
+import android.telephony.TelephonyManager;
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
import com.android.internal.telephony.gsm.SmsMessage;
import com.android.internal.util.HexDump;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
+import java.util.ArrayList;
public class GsmSmsTest extends AndroidTestCase {
@@ -232,6 +235,110 @@
};
@SmallTest
+ public void testFragmentText() throws Exception {
+ boolean isGsmPhone = (TelephonyManager.getDefault().getPhoneType() ==
+ TelephonyManager.PHONE_TYPE_GSM);
+
+ // Valid 160 character 7-bit text.
+ String text = "123456789012345678901234567890123456789012345678901234567890" +
+ "1234567890123456789012345678901234567890123456789012345678901234567890" +
+ "123456789012345678901234567890";
+ SmsMessageBase.TextEncodingDetails ted = SmsMessage.calculateLength(text, false);
+ assertEquals(1, ted.msgCount);
+ assertEquals(160, ted.codeUnitCount);
+ assertEquals(1, ted.codeUnitSize);
+ assertEquals(0, ted.languageTable);
+ assertEquals(0, ted.languageShiftTable);
+ if (isGsmPhone) {
+ ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text);
+ assertEquals(1, fragments.size());
+ }
+
+ // Valid 161 character 7-bit text.
+ text = "123456789012345678901234567890123456789012345678901234567890" +
+ "1234567890123456789012345678901234567890123456789012345678901234567890" +
+ "1234567890123456789012345678901";
+ ted = SmsMessage.calculateLength(text, false);
+ assertEquals(2, ted.msgCount);
+ assertEquals(161, ted.codeUnitCount);
+ assertEquals(1, ted.codeUnitSize);
+ assertEquals(0, ted.languageTable);
+ assertEquals(0, ted.languageShiftTable);
+ if (isGsmPhone) {
+ ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text);
+ assertEquals(2, fragments.size());
+ assertEquals(text, fragments.get(0) + fragments.get(1));
+ assertEquals(153, fragments.get(0).length());
+ assertEquals(8, fragments.get(1).length());
+ }
+ }
+
+ @SmallTest
+ public void testFragmentTurkishText() throws Exception {
+ boolean isGsmPhone = (TelephonyManager.getDefault().getPhoneType() ==
+ TelephonyManager.PHONE_TYPE_GSM);
+
+ int[] oldTables = GsmAlphabet.getEnabledSingleShiftTables();
+ int[] turkishTable = { 1 };
+ GsmAlphabet.setEnabledSingleShiftTables(turkishTable);
+
+ // Valid 77 character text with Turkish characters.
+ String text = "ĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşı" +
+ "ĞŞİğşıĞŞİğşıĞŞİğş";
+ SmsMessageBase.TextEncodingDetails ted = SmsMessage.calculateLength(text, false);
+ assertEquals(1, ted.msgCount);
+ assertEquals(154, ted.codeUnitCount);
+ assertEquals(1, ted.codeUnitSize);
+ assertEquals(0, ted.languageTable);
+ assertEquals(1, ted.languageShiftTable);
+ if (isGsmPhone) {
+ ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text);
+ assertEquals(1, fragments.size());
+ assertEquals(text, fragments.get(0));
+ assertEquals(77, fragments.get(0).length());
+ }
+
+ // Valid 78 character text with Turkish characters.
+ text = "ĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşı" +
+ "ĞŞİğşıĞŞİğşıĞŞİğşı";
+ ted = SmsMessage.calculateLength(text, false);
+ assertEquals(2, ted.msgCount);
+ assertEquals(156, ted.codeUnitCount);
+ assertEquals(1, ted.codeUnitSize);
+ assertEquals(0, ted.languageTable);
+ assertEquals(1, ted.languageShiftTable);
+ if (isGsmPhone) {
+ ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text);
+ assertEquals(2, fragments.size());
+ assertEquals(text, fragments.get(0) + fragments.get(1));
+ assertEquals(74, fragments.get(0).length());
+ assertEquals(4, fragments.get(1).length());
+ }
+
+ // Valid 160 character text with Turkish characters.
+ text = "ĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşı" +
+ "ĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğ" +
+ "ĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşıĞŞİğşı";
+ ted = SmsMessage.calculateLength(text, false);
+ assertEquals(3, ted.msgCount);
+ assertEquals(320, ted.codeUnitCount);
+ assertEquals(1, ted.codeUnitSize);
+ assertEquals(0, ted.languageTable);
+ assertEquals(1, ted.languageShiftTable);
+ if (isGsmPhone) {
+ ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text);
+ assertEquals(3, fragments.size());
+ assertEquals(text, fragments.get(0) + fragments.get(1) + fragments.get(2));
+ assertEquals(74, fragments.get(0).length());
+ assertEquals(74, fragments.get(1).length());
+ assertEquals(12, fragments.get(2).length());
+ }
+
+ GsmAlphabet.setEnabledSingleShiftTables(oldTables);
+ }
+
+
+ @SmallTest
public void testDecode() throws Exception {
decodeSingle(0); // default table
decodeSingle(1); // Turkish locking shift table
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
index e2349af..d34a7c5 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -550,21 +550,51 @@
}
@SmallTest
public void testIsEmergencyNumber() {
- assertTrue(PhoneNumberUtils.isEmergencyNumber("911", "US"));
- assertTrue(PhoneNumberUtils.isEmergencyNumber("112", "US"));
- // The next two numbers are not valid phone numbers in the US, but can be used to trick the
- // system to dial 911 and 112, which are emergency numbers in the US. For the purpose of
- // addressing that, they are also classified as emergency numbers in the US.
- assertTrue(PhoneNumberUtils.isEmergencyNumber("91112345", "US"));
- assertTrue(PhoneNumberUtils.isEmergencyNumber("11212345", "US"));
- // A valid mobile phone number from Singapore shouldn't be classified as an emergency number
- // in Singapore, as 911 is not an emergency number there.
- assertFalse(PhoneNumberUtils.isEmergencyNumber("91121234", "SG"));
- // A valid fixed-line phone number from Brazil shouldn't be classified as an emergency number
- // in Brazil, as 112 is not an emergency number there.
- assertFalse(PhoneNumberUtils.isEmergencyNumber("1121234567", "BR"));
- // A valid local phone number from Brazil shouldn't be classified as an emergency number in
- // Brazil.
- assertFalse(PhoneNumberUtils.isEmergencyNumber("91112345", "BR"));
+ // There are two parallel sets of tests here: one for the
+ // regular isEmergencyNumber() method, and the other for
+ // isPotentialEmergencyNumber().
+ //
+ // (The difference is that isEmergencyNumber() will return true
+ // only if the specified number exactly matches an actual
+ // emergency number, but isPotentialEmergencyNumber() will
+ // return true if the specified number simply starts with the
+ // same digits as any actual emergency number.)
+
+ // Tests for isEmergencyNumber():
+ assertTrue(PhoneNumberUtils.isEmergencyNumber("911", "US"));
+ assertTrue(PhoneNumberUtils.isEmergencyNumber("112", "US"));
+ // The next two numbers are not valid phone numbers in the US,
+ // so do not count as emergency numbers (but they *are* "potential"
+ // emergency numbers; see below.)
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("91112345", "US"));
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("11212345", "US"));
+ // A valid mobile phone number from Singapore shouldn't be classified as an emergency number
+ // in Singapore, as 911 is not an emergency number there.
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("91121234", "SG"));
+ // A valid fixed-line phone number from Brazil shouldn't be classified as an emergency number
+ // in Brazil, as 112 is not an emergency number there.
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("1121234567", "BR"));
+ // A valid local phone number from Brazil shouldn't be classified as an emergency number in
+ // Brazil.
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("91112345", "BR"));
+
+ // Tests for isPotentialEmergencyNumber():
+ // These first two are obviously emergency numbers:
+ assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("911", "US"));
+ assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("112", "US"));
+ // The next two numbers are not valid phone numbers in the US, but can be used to trick the
+ // system to dial 911 and 112, which are emergency numbers in the US. For the purpose of
+ // addressing that, they are also classified as "potential" emergency numbers in the US.
+ assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("91112345", "US"));
+ assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("11212345", "US"));
+ // A valid mobile phone number from Singapore shouldn't be classified as an emergency number
+ // in Singapore, as 911 is not an emergency number there.
+ assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("91121234", "SG"));
+ // A valid fixed-line phone number from Brazil shouldn't be classified as an emergency number
+ // in Brazil, as 112 is not an emergency number there.
+ assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("1121234567", "BR"));
+ // A valid local phone number from Brazil shouldn't be classified as an emergency number in
+ // Brazil.
+ assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("91112345", "BR"));
}
}
diff --git a/tests/FrameworkPerf/AndroidManifest.xml b/tests/FrameworkPerf/AndroidManifest.xml
index aa663f3..e88f4fb 100644
--- a/tests/FrameworkPerf/AndroidManifest.xml
+++ b/tests/FrameworkPerf/AndroidManifest.xml
@@ -13,6 +13,10 @@
</activity>
<service android:name="SchedulerService">
</service>
+ <service android:name="TestService" android:process=":test">
+ </service>
+ <service android:name="LocalTestService">
+ </service>
<receiver android:name="Receiver" android:exported="true">
</receiver>
</application>
diff --git a/tests/FrameworkPerf/res/layout/main.xml b/tests/FrameworkPerf/res/layout/main.xml
index 62b1a7a..7812648 100644
--- a/tests/FrameworkPerf/res/layout/main.xml
+++ b/tests/FrameworkPerf/res/layout/main.xml
@@ -91,6 +91,11 @@
android:layout_height="wrap_content"
android:text="@string/stop"
/>
+ <CheckBox android:id="@+id/local"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Local"
+ />
</LinearLayout>
<TextView android:id="@+id/log"
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
index 3979902..175f227 100644
--- a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
@@ -17,191 +17,123 @@
package com.android.frameworkperf;
import android.app.Activity;
-import android.content.Context;
+import android.content.ComponentName;
import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.res.TypedArray;
-import android.content.res.XmlResourceParser;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
+import android.content.ServiceConnection;
+import android.os.Binder;
import android.os.Bundle;
-import android.os.FileUtils;
import android.os.Handler;
-import android.os.Looper;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
import android.os.PowerManager;
-import android.os.Process;
-import android.os.SystemClock;
-import android.util.AttributeSet;
-import android.util.DisplayMetrics;
+import android.os.RemoteException;
import android.util.Log;
-import android.util.Xml;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
+import android.widget.CheckBox;
import android.widget.Spinner;
import android.widget.TextView;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.RandomAccessFile;
import java.util.ArrayList;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
/**
* So you thought sync used up your battery life.
*/
public class FrameworkPerfActivity extends Activity
implements AdapterView.OnItemSelectedListener {
static final String TAG = "Perf";
-
- final Handler mHandler = new Handler();
+ static final boolean DEBUG = false;
Spinner mFgSpinner;
Spinner mBgSpinner;
TextView mTestTime;
Button mStartButton;
Button mStopButton;
+ CheckBox mLocalCheckBox;
TextView mLog;
PowerManager.WakeLock mPartialWakeLock;
long mMaxRunTime = 5000;
boolean mStarted;
- final TestRunner mRunner = new TestRunner();
-
- final Op[] mOpPairs = new Op[] {
- new MethodCallOp(), new NoOp(),
- new MethodCallOp(), new CpuOp(),
- new MethodCallOp(), new SchedulerOp(),
- new MethodCallOp(), new GcOp(),
- new MethodCallOp(), new CreateFileOp(),
- new MethodCallOp(), new CreateWriteFileOp(),
- new MethodCallOp(), new CreateWriteSyncFileOp(),
- new MethodCallOp(), new WriteFileOp(),
- new MethodCallOp(), new ReadFileOp(),
- new SchedulerOp(), new SchedulerOp(),
- new GcOp(), new NoOp(),
- new IpcOp(), new NoOp(),
- new IpcOp(), new CpuOp(),
- new IpcOp(), new SchedulerOp(),
- new IpcOp(), new GcOp(),
- new IpcOp(), new CreateFileOp(),
- new IpcOp(), new CreateWriteFileOp(),
- new IpcOp(), new CreateWriteSyncFileOp(),
- new IpcOp(), new WriteFileOp(),
- new IpcOp(), new ReadFileOp(),
- new CreateFileOp(), new NoOp(),
- new CreateWriteFileOp(), new NoOp(),
- new CreateWriteSyncFileOp(), new NoOp(),
- new WriteFileOp(), new NoOp(),
- new ReadFileOp(), new NoOp(),
- new WriteFileOp(), new CreateWriteFileOp(),
- new ReadFileOp(), new CreateWriteFileOp(),
- new WriteFileOp(), new CreateWriteSyncFileOp(),
- new ReadFileOp(), new CreateWriteSyncFileOp(),
- new WriteFileOp(), new WriteFileOp(),
- new WriteFileOp(), new ReadFileOp(),
- new ReadFileOp(), new WriteFileOp(),
- new ReadFileOp(), new ReadFileOp(),
- new OpenXmlResOp(), new NoOp(),
- new ReadXmlAttrsOp(), new NoOp(),
- new ParseXmlResOp(), new NoOp(),
- new ParseLargeXmlResOp(), new NoOp(),
- new LayoutInflaterOp(), new NoOp(),
- new LayoutInflaterLargeOp(), new NoOp(),
- new LayoutInflaterViewOp(), new NoOp(),
- new LayoutInflaterButtonOp(), new NoOp(),
- new LayoutInflaterImageButtonOp(), new NoOp(),
- new CreateBitmapOp(), new NoOp(),
- new CreateRecycleBitmapOp(), new NoOp(),
- new LoadSmallBitmapOp(), new NoOp(),
- new LoadRecycleSmallBitmapOp(), new NoOp(),
- new LoadLargeBitmapOp(), new NoOp(),
- new LoadRecycleLargeBitmapOp(), new NoOp(),
- new LoadSmallScaledBitmapOp(), new NoOp(),
- new LoadLargeScaledBitmapOp(), new NoOp(),
- };
-
- final Op[] mAvailOps = new Op[] {
- null,
- new NoOp(),
- new CpuOp(),
- new SchedulerOp(),
- new MethodCallOp(),
- new IpcOp(),
- new CreateFileOp(),
- new CreateWriteFileOp(),
- new CreateWriteSyncFileOp(),
- new WriteFileOp(),
- new ReadFileOp(),
- new OpenXmlResOp(),
- new ReadXmlAttrsOp(),
- new ParseXmlResOp(),
- new ParseLargeXmlResOp(),
- new LayoutInflaterOp(),
- new LayoutInflaterLargeOp(),
- new LayoutInflaterViewOp(),
- new LayoutInflaterButtonOp(),
- new LayoutInflaterImageButtonOp(),
- new CreateBitmapOp(),
- new CreateRecycleBitmapOp(),
- new LoadSmallBitmapOp(),
- new LoadRecycleSmallBitmapOp(),
- new LoadLargeBitmapOp(),
- new LoadRecycleLargeBitmapOp(),
- new LoadSmallScaledBitmapOp(),
- new LoadLargeScaledBitmapOp(),
- };
-
final String[] mAvailOpLabels;
final String[] mAvailOpDescriptions;
- Op mFgTest;
- Op mBgTest;
+ int mFgTestIndex = -1;
+ int mBgTestIndex = -1;
+ TestService.Op mFgTest;
+ TestService.Op mBgTest;
int mCurOpIndex = 0;
-
- class RunResult {
- final String name;
- final String fgLongName;
- final String bgLongName;
- final long fgTime;
- final long fgOps;
- final long bgTime;
- final long bgOps;
-
- RunResult(TestRunner op) {
- name = op.getName();
- fgLongName = op.getForegroundLongName();
- bgLongName = op.getBackgroundLongName();
- fgTime = op.getForegroundTime();
- fgOps = op.getForegroundOps();
- bgTime = op.getBackgroundTime();
- bgOps = op.getBackgroundOps();
- }
-
- float getFgMsPerOp() {
- return fgOps != 0 ? (fgTime / (float)fgOps) : 0;
- }
-
- float getBgMsPerOp() {
- return bgOps != 0 ? (bgTime / (float)bgOps) : 0;
- }
- }
+ TestConnection mCurConnection;
+ boolean mConnectionBound;
final ArrayList<RunResult> mResults = new ArrayList<RunResult>();
+ class TestConnection implements ServiceConnection, IBinder.DeathRecipient {
+ Messenger mService;
+ boolean mLinked;
+
+ @Override public void onServiceConnected(ComponentName name, IBinder service) {
+ try {
+ if (!(service instanceof Binder)) {
+ // If remote, we'll be killing ye.
+ service.linkToDeath(this, 0);
+ mLinked = true;
+ }
+ mService = new Messenger(service);
+ dispatchCurOp(this);
+ } catch (RemoteException e) {
+ // Whoops, service has disappeared... try starting again.
+ Log.w(TAG, "Test service died, starting again");
+ startCurOp();
+ }
+ }
+
+ @Override public void onServiceDisconnected(ComponentName name) {
+ }
+
+ @Override public void binderDied() {
+ cleanup();
+ connectionDied(this);
+ }
+
+ void cleanup() {
+ if (mLinked) {
+ mLinked = false;
+ mService.getBinder().unlinkToDeath(this, 0);
+ }
+ }
+ }
+
+ static final int MSG_DO_NEXT_TEST = 1000;
+
+ final Handler mHandler = new Handler() {
+ @Override public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case TestService.RES_TEST_FINISHED: {
+ Bundle bundle = (Bundle)msg.obj;
+ bundle.setClassLoader(getClassLoader());
+ RunResult res = (RunResult)bundle.getParcelable("res");
+ completeCurOp(res);
+ } break;
+ case MSG_DO_NEXT_TEST: {
+ startCurOp();
+ } break;
+ }
+ }
+ };
+
+ final Messenger mMessenger = new Messenger(mHandler);
+
public FrameworkPerfActivity() {
- mAvailOpLabels = new String[mAvailOps.length];
- mAvailOpDescriptions = new String[mAvailOps.length];
- for (int i=0; i<mAvailOps.length; i++) {
- Op op = mAvailOps[i];
+ mAvailOpLabels = new String[TestService.mAvailOps.length];
+ mAvailOpDescriptions = new String[TestService.mAvailOps.length];
+ for (int i=0; i<TestService.mAvailOps.length; i++) {
+ TestService.Op op = TestService.mAvailOps[i];
if (op == null) {
mAvailOpLabels[i] = "All";
mAvailOpDescriptions[i] = "All tests";
@@ -251,6 +183,7 @@
}
});
mStopButton.setEnabled(false);
+ mLocalCheckBox = (CheckBox)findViewById(R.id.local);
mLog = (TextView)findViewById(R.id.log);
@@ -262,11 +195,13 @@
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (parent == mFgSpinner || parent == mBgSpinner) {
- Op op = mAvailOps[position];
+ TestService.Op op = TestService.mAvailOps[position];
if (parent == mFgSpinner) {
+ mFgTestIndex = position;
mFgTest = op;
((TextView)findViewById(R.id.fgtext)).setText(mAvailOpDescriptions[position]);
} else {
+ mBgTestIndex = position;
mBgTest = op;
((TextView)findViewById(R.id.bgtext)).setText(mAvailOpDescriptions[position]);
}
@@ -291,64 +226,140 @@
}
}
- void startCurOp() {
- Op fgOp, bgOp;
- if (mFgTest == null && mBgTest == null) {
- fgOp = mOpPairs[mCurOpIndex];
- bgOp = mOpPairs[mCurOpIndex+1];
- } else if (mFgTest != null && mBgTest != null) {
- fgOp = mFgTest;
- bgOp = mBgTest;
- } else if (mFgTest != null) {
- // Skip null test.
- if (mCurOpIndex == 0) {
- mCurOpIndex = 1;
- }
- fgOp = mFgTest;
- bgOp = mAvailOps[mCurOpIndex];
+ void dispatchCurOp(TestConnection conn) {
+ if (mCurConnection != conn) {
+ Log.w(TAG, "Dispatching on invalid connection: " + conn);
+ return;
+ }
+ TestArgs args = new TestArgs();
+ args.maxTime = mMaxRunTime;
+ if (mFgTestIndex == 0 && mBgTestIndex == 0) {
+ args.combOp = mCurOpIndex;
+ } else if (mFgTestIndex != 0 && mBgTestIndex != 0) {
+ args.fgOp = mFgTestIndex;
+ args.bgOp = mBgTestIndex;
} else {
// Skip null test.
if (mCurOpIndex == 0) {
mCurOpIndex = 1;
}
- fgOp = mAvailOps[mCurOpIndex];
- bgOp = mBgTest;
- }
- mRunner.run(mHandler, fgOp, bgOp, new Runnable() {
- @Override public void run() {
- RunResult result = new RunResult(mRunner);
- log(String.format("%s: fg=%d*%gms/op (%dms) / bg=%d*%gms/op (%dms)",
- result.name, result.fgOps, result.getFgMsPerOp(), result.fgTime,
- result.bgOps, result.getBgMsPerOp(), result.bgTime));
- mResults.add(result);
- if (!mStarted) {
- log("Stop");
- stopRunning();
- return;
- }
- if (mFgTest != null && mBgTest != null) {
- log("Finished");
- stopRunning();
- return;
- }
- if (mFgTest == null && mBgTest == null) {
- mCurOpIndex+=2;
- if (mCurOpIndex >= mOpPairs.length) {
- log("Finished");
- stopRunning();
- return;
- }
- } else {
- mCurOpIndex++;
- if (mCurOpIndex >= mAvailOps.length) {
- log("Finished");
- stopRunning();
- return;
- }
- }
- startCurOp();
+ if (mFgTestIndex != 0) {
+ args.fgOp = mFgTestIndex;
+ args.bgOp = mCurOpIndex;
+ } else {
+ args.fgOp = mCurOpIndex;
+ args.bgOp = mFgTestIndex;
}
- });
+ }
+ Bundle bundle = new Bundle();
+ bundle.putParcelable("args", args);
+ Message msg = Message.obtain(null, TestService.CMD_START_TEST, bundle);
+ msg.replyTo = mMessenger;
+ try {
+ conn.mService.send(msg);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failure communicating with service", e);
+ }
+ }
+
+ void completeCurOp(RunResult result) {
+ log(String.format("%s: fg=%d*%gms/op (%dms) / bg=%d*%gms/op (%dms)",
+ result.name, result.fgOps, result.getFgMsPerOp(), result.fgTime,
+ result.bgOps, result.getBgMsPerOp(), result.bgTime));
+ mResults.add(result);
+ if (!mStarted) {
+ log("Stop");
+ stopRunning();
+ return;
+ }
+ if (mFgTest != null && mBgTest != null) {
+ log("Finished");
+ stopRunning();
+ return;
+ }
+ if (mFgTest == null && mBgTest == null) {
+ mCurOpIndex+=2;
+ if (mCurOpIndex >= TestService.mOpPairs.length) {
+ log("Finished");
+ stopRunning();
+ return;
+ }
+ } else {
+ mCurOpIndex++;
+ if (mCurOpIndex >= TestService.mAvailOps.length) {
+ log("Finished");
+ stopRunning();
+ return;
+ }
+ }
+ startCurOp();
+ }
+
+ void disconnect() {
+ final TestConnection conn = mCurConnection;
+ if (conn != null) {
+ if (DEBUG) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Log.i(TAG, "Unbinding " + conn, here);
+ }
+ if (mConnectionBound) {
+ unbindService(conn);
+ mConnectionBound = false;
+ }
+ if (conn.mLinked) {
+ Message msg = Message.obtain(null, TestService.CMD_TERMINATE);
+ try {
+ conn.mService.send(msg);
+ return;
+ } catch (RemoteException e) {
+ Log.w(TAG, "Test service aleady died when terminating");
+ }
+ }
+ conn.cleanup();
+ }
+ connectionDied(conn);
+ }
+
+ void connectionDied(TestConnection conn) {
+ if (mCurConnection == conn) {
+ // Now that we know the test process has died, we can commence
+ // the next test. Just give a little delay to allow the activity
+ // manager to know it has died as well (not a disaster if it hasn't
+ // yet, though).
+ if (mConnectionBound) {
+ unbindService(conn);
+ }
+ mCurConnection = null;
+ mHandler.sendMessageDelayed(Message.obtain(null, MSG_DO_NEXT_TEST), 100);
+ }
+ }
+
+ void startCurOp() {
+ if (DEBUG) Log.i(TAG, "startCurOp: mCurConnection=" + mCurConnection);
+ if (mCurConnection != null) {
+ disconnect();
+ return;
+ }
+ if (mStarted) {
+ mHandler.removeMessages(TestService.RES_TEST_FINISHED);
+ mHandler.removeMessages(TestService.RES_TERMINATED);
+ mHandler.removeMessages(MSG_DO_NEXT_TEST);
+ mCurConnection = new TestConnection();
+ Intent intent;
+ if (mLocalCheckBox.isChecked()) {
+ intent = new Intent(this, LocalTestService.class);
+ } else {
+ intent = new Intent(this, TestService.class);
+ }
+ if (DEBUG) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Log.i(TAG, "Binding " + mCurConnection, here);
+ }
+ bindService(intent, mCurConnection, BIND_AUTO_CREATE|BIND_IMPORTANT);
+ mConnectionBound = true;
+ }
}
void startRunning() {
@@ -357,6 +368,7 @@
mStarted = true;
mStartButton.setEnabled(false);
mStopButton.setEnabled(true);
+ mLocalCheckBox.setEnabled(false);
mTestTime.setEnabled(false);
mFgSpinner.setEnabled(false);
mBgSpinner.setEnabled(false);
@@ -371,9 +383,11 @@
void stopRunning() {
if (mStarted) {
+ disconnect();
mStarted = false;
mStartButton.setEnabled(true);
mStopButton.setEnabled(false);
+ mLocalCheckBox.setEnabled(true);
mTestTime.setEnabled(true);
mFgSpinner.setEnabled(true);
mBgSpinner.setEnabled(true);
@@ -412,842 +426,4 @@
mLog.setText(mLog.getText() + "\n" + s);
Log.i(TAG, s);
}
-
- enum BackgroundMode {
- NOTHING,
- CPU,
- SCHEDULER
- };
-
- public class TestRunner {
- Handler mHandler;
- Op mForegroundOp;
- Op mBackgroundOp;
- Runnable mDoneCallback;
-
- RunnerThread mBackgroundThread;
- RunnerThread mForegroundThread;
- long mStartTime;
-
- boolean mBackgroundRunning;
- boolean mForegroundRunning;
-
- long mBackgroundEndTime;
- long mBackgroundOps;
- long mForegroundEndTime;
- long mForegroundOps;
-
- public TestRunner() {
- }
-
- public String getForegroundName() {
- return mForegroundOp.getName();
- }
-
- public String getBackgroundName() {
- return mBackgroundOp.getName();
- }
-
- public String getName() {
- String fgName = mForegroundOp.getName();
- String bgName = mBackgroundOp.getName();
- StringBuilder res = new StringBuilder();
- if (fgName != null) {
- res.append(fgName);
- res.append("Fg");
- }
- if (bgName != null) {
- res.append(bgName);
- res.append("Bg");
- }
- return res.toString();
- }
-
- public String getForegroundLongName() {
- return mForegroundOp.getLongName();
- }
-
- public String getBackgroundLongName() {
- return mBackgroundOp.getLongName();
- }
-
- public void run(Handler handler, Op foreground, Op background, Runnable doneCallback) {
- mHandler = handler;
- mForegroundOp = foreground;
- mBackgroundOp = background;
- mDoneCallback = doneCallback;
- mBackgroundThread = new RunnerThread("background", new Runnable() {
- @Override public void run() {
- boolean running;
- int ops = 0;
- do {
- running = mBackgroundOp.onRun();
- ops++;
- } while (evalRepeat(running, true) && running);
- mBackgroundEndTime = SystemClock.uptimeMillis();
- mBackgroundOps = ops * mBackgroundOp.getOpsPerRun();
- threadFinished(false);
- }
- }, Process.THREAD_PRIORITY_BACKGROUND);
- mForegroundThread = new RunnerThread("background", new Runnable() {
- @Override public void run() {
- boolean running;
- int ops = 0;
- do {
- running = mForegroundOp.onRun();
- ops++;
- } while (evalRepeat(true, running) && running);
- mForegroundEndTime = SystemClock.uptimeMillis();
- mForegroundOps = ops * mForegroundOp.getOpsPerRun();
- threadFinished(true);
- }
- }, Process.THREAD_PRIORITY_FOREGROUND);
-
- mForegroundOp.onInit(FrameworkPerfActivity.this, true);
- mBackgroundOp.onInit(FrameworkPerfActivity.this, false);
-
- synchronized (this) {
- mStartTime = SystemClock.uptimeMillis();
- mBackgroundRunning = true;
- mForegroundRunning = true;
- }
-
- mBackgroundThread.start();
- mForegroundThread.start();
- }
-
- public long getForegroundTime() {
- return mForegroundEndTime-mStartTime;
- }
-
- public long getForegroundOps() {
- return mForegroundOps;
- }
-
- public long getBackgroundTime() {
- return mBackgroundEndTime-mStartTime;
- }
-
- public long getBackgroundOps() {
- return mBackgroundOps;
- }
-
- private boolean evalRepeat(boolean bgRunning, boolean fgRunning) {
- synchronized (this) {
- if (!bgRunning) {
- mBackgroundRunning = false;
- }
- if (!fgRunning) {
- mForegroundRunning = false;
- }
- if (!mBackgroundRunning && !mForegroundRunning) {
- return false;
- }
- long now = SystemClock.uptimeMillis();
- if (now > (mStartTime+mMaxRunTime)) {
- return false;
- }
- return true;
- }
- }
-
- private void threadFinished(boolean foreground) {
- synchronized (this) {
- if (foreground) {
- mForegroundRunning = false;
- } else {
- mBackgroundRunning = false;
- }
- if (!mBackgroundRunning && !mForegroundRunning) {
- mHandler.post(new Runnable() {
- @Override public void run() {
- mForegroundOp.onTerm(FrameworkPerfActivity.this);
- mBackgroundOp.onTerm(FrameworkPerfActivity.this);
- if (mDoneCallback != null) {
- mDoneCallback.run();
- }
- }
- });
- }
- }
- }
- }
-
- class RunnerThread extends Thread {
- private final Runnable mOp;
- private final int mPriority;
-
- RunnerThread(String name, Runnable op, int priority) {
- super(name);
- mOp = op;
- mPriority = priority;
- }
-
- public void run() {
- Process.setThreadPriority(mPriority);
- mOp.run();
- }
- }
-
- static public abstract class Op {
- final String mName;
- final String mLongName;
-
- public Op(String name, String longName) {
- mName = name;
- mLongName = longName;
- }
-
- public String getName() {
- return mName;
- }
-
- public String getLongName() {
- return mLongName;
- }
-
- void onInit(Context context, boolean foreground) {
- }
-
- abstract boolean onRun();
-
- void onTerm(Context context) {
- }
-
- int getOpsPerRun() {
- return 1;
- }
- }
-
- static class NoOp extends Op {
- NoOp() {
- super(null, "Nothing");
- }
-
- boolean onRun() {
- return false;
- }
-
- int getOpsPerRun() {
- return 0;
- }
- }
-
- static class CpuOp extends Op {
- CpuOp() {
- super("CPU", "Consume CPU");
- }
-
- boolean onRun() {
- return true;
- }
- }
-
- static class SchedulerOp extends Op {
- SchedulerOp() {
- super("Sched", "Change scheduler group");
- }
-
- boolean onRun() {
- Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
- Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
- return true;
- }
- }
-
- static class GcOp extends Op {
- GcOp() {
- super("Gc", "Run garbage collector");
- }
-
- boolean onRun() {
- byte[] stuff = new byte[1024*1024];
- return true;
- }
- }
-
- static class MethodCallOp extends Op {
- MethodCallOp() {
- super("MethodCall", "Method call");
- }
-
- boolean onRun() {
- final int N = getOpsPerRun();
- for (int i=0; i<N; i++) {
- someFunc(i);
- }
- return true;
- }
-
- int someFunc(int foo) {
- return 0;
- }
-
- int getOpsPerRun() {
- return 500;
- }
- }
-
- static class IpcOp extends Op {
- PackageManager mPm;
- String mProcessName;
-
- IpcOp() {
- super("Ipc", "IPC to system process");
- }
-
- void onInit(Context context, boolean foreground) {
- mPm = context.getPackageManager();
- mProcessName = context.getApplicationInfo().processName;
- }
-
- boolean onRun() {
- final int N = getOpsPerRun();
- for (int i=0; i<N; i++) {
- mPm.queryContentProviders(mProcessName, Process.myUid(), 0);
- }
- return true;
- }
-
- int getOpsPerRun() {
- return 100;
- }
- }
-
- static class OpenXmlResOp extends Op {
- Context mContext;
-
- OpenXmlResOp() {
- super("OpenXmlRes", "Open (and close) an XML resource");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- XmlResourceParser parser = mContext.getResources().getLayout(R.xml.simple);
- parser.close();
- return true;
- }
- }
-
- static class ReadXmlAttrsOp extends Op {
- Context mContext;
- XmlResourceParser mParser;
- AttributeSet mAttrs;
-
- ReadXmlAttrsOp() {
- super("ReadXmlAttrs", "Read attributes from an XML tag");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- mParser = mContext.getResources().getLayout(R.xml.simple);
- mAttrs = Xml.asAttributeSet(mParser);
-
- int eventType;
- try {
- // Find the first <item> tag.
- eventType = mParser.getEventType();
- String tagName;
- do {
- if (eventType == XmlPullParser.START_TAG) {
- tagName = mParser.getName();
- if (tagName.equals("item")) {
- break;
- }
- }
- eventType = mParser.next();
- } while (eventType != XmlPullParser.END_DOCUMENT);
- } catch (XmlPullParserException e) {
- throw new RuntimeException("I died", e);
- } catch (IOException e) {
- throw new RuntimeException("I died", e);
- }
- }
-
- void onTerm(Context context) {
- mParser.close();
- }
-
- boolean onRun() {
- TypedArray a = mContext.obtainStyledAttributes(mAttrs,
- com.android.internal.R.styleable.MenuItem);
- a.recycle();
- return true;
- }
- }
-
- static class ParseXmlResOp extends Op {
- Context mContext;
-
- ParseXmlResOp() {
- super("ParseXmlRes", "Parse compiled XML resource");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- SimpleInflater inf = new SimpleInflater(mContext);
- inf.inflate(R.xml.simple);
- return true;
- }
- }
-
- static class ParseLargeXmlResOp extends Op {
- Context mContext;
-
- ParseLargeXmlResOp() {
- super("ParseLargeXmlRes", "Parse large XML resource");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- SimpleInflater inf = new SimpleInflater(mContext);
- inf.inflate(R.xml.simple_large);
- return true;
- }
- }
-
- static class LayoutInflaterOp extends Op {
- Context mContext;
-
- LayoutInflaterOp() {
- super("LayoutInflater", "Inflate layout resource");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- inf.inflate(R.layout.small_layout, null);
- return true;
- }
- }
-
- static class LayoutInflaterLargeOp extends Op {
- Context mContext;
-
- LayoutInflaterLargeOp() {
- super("LayoutInflaterLarge", "Inflate large layout resource");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- inf.inflate(R.layout.large_layout, null);
- return true;
- }
- }
-
- static class LayoutInflaterViewOp extends Op {
- Context mContext;
-
- LayoutInflaterViewOp() {
- super("LayoutInflaterView", "Inflate layout with 50 View objects");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- inf.inflate(R.layout.view_layout, null);
- return true;
- }
- }
-
- static class LayoutInflaterButtonOp extends Op {
- Context mContext;
-
- LayoutInflaterButtonOp() {
- super("LayoutInflaterButton", "Inflate layout with 50 Button objects");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- inf.inflate(R.layout.button_layout, null);
- return true;
- }
- }
-
- static class LayoutInflaterImageButtonOp extends Op {
- Context mContext;
-
- LayoutInflaterImageButtonOp() {
- super("LayoutInflaterImageButton", "Inflate layout with 50 ImageButton objects");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- inf.inflate(R.layout.image_button_layout, null);
- return true;
- }
- }
-
- static class CreateBitmapOp extends Op {
- Context mContext;
-
- CreateBitmapOp() {
- super("CreateBitmap", "Create a Bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ARGB_8888);
- return true;
- }
- }
-
- static class CreateRecycleBitmapOp extends Op {
- Context mContext;
-
- CreateRecycleBitmapOp() {
- super("CreateRecycleBitmap", "Create and recycle a Bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ARGB_8888);
- bm.recycle();
- return true;
- }
- }
-
- static class LoadSmallBitmapOp extends Op {
- Context mContext;
-
- LoadSmallBitmapOp() {
- super("LoadSmallBitmap", "Load small raw bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.stat_sample, opts);
- return true;
- }
- }
-
- static class LoadRecycleSmallBitmapOp extends Op {
- Context mContext;
-
- LoadRecycleSmallBitmapOp() {
- super("LoadRecycleSmallBitmap", "Load and recycle small raw bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.stat_sample, opts);
- bm.recycle();
- return true;
- }
- }
-
- static class LoadLargeBitmapOp extends Op {
- Context mContext;
-
- LoadLargeBitmapOp() {
- super("LoadLargeBitmap", "Load large raw bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.wallpaper_goldengate, opts);
- return true;
- }
- }
-
- static class LoadRecycleLargeBitmapOp extends Op {
- Context mContext;
-
- LoadRecycleLargeBitmapOp() {
- super("LoadRecycleLargeBitmap", "Load and recycle large raw bitmap");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.wallpaper_goldengate, opts);
- bm.recycle();
- return true;
- }
- }
-
- static class LoadSmallScaledBitmapOp extends Op {
- Context mContext;
-
- LoadSmallScaledBitmapOp() {
- super("LoadSmallScaledBitmap", "Load small raw bitmap that is scaled for density");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.stat_sample_scale, opts);
- return true;
- }
- }
-
- static class LoadLargeScaledBitmapOp extends Op {
- Context mContext;
-
- LoadLargeScaledBitmapOp() {
- super("LoadLargeScaledBitmap", "Load large raw bitmap that is scaled for density");
- }
-
- void onInit(Context context, boolean foreground) {
- mContext = context;
- }
-
- boolean onRun() {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
- Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
- R.drawable.wallpaper_goldengate_scale, opts);
- return true;
- }
- }
-
- static class CreateFileOp extends Op {
- File mFile;
-
- CreateFileOp() {
- super("CreateFile", "Create and delete a file");
- }
-
- void onInit(Context context, boolean foreground) {
- mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
- mFile.delete();
- }
-
- boolean onRun() {
- try {
- mFile.createNewFile();
- } catch (IOException e) {
- Log.w(TAG, "Failure creating " + mFile, e);
- }
- mFile.delete();
- return true;
- }
- }
-
- static class CreateWriteFileOp extends Op {
- File mFile;
-
- CreateWriteFileOp() {
- super("CreateWriteFile", "Create, write, and delete a file");
- }
-
- void onInit(Context context, boolean foreground) {
- mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
- mFile.delete();
- }
-
- boolean onRun() {
- try {
- FileOutputStream fos = new FileOutputStream(mFile);
- fos.write(1);
- fos.close();
- } catch (IOException e) {
- Log.w(TAG, "Failure creating " + mFile, e);
- }
- mFile.delete();
- return true;
- }
- }
-
- static class CreateWriteSyncFileOp extends Op {
- File mFile;
-
- CreateWriteSyncFileOp() {
- super("CreateWriteSyncFile", "Create, write, sync, and delete a file");
- }
-
- void onInit(Context context, boolean foreground) {
- mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
- mFile.delete();
- }
-
- boolean onRun() {
- try {
- FileOutputStream fos = new FileOutputStream(mFile);
- fos.write(1);
- fos.flush();
- FileUtils.sync(fos);
- fos.close();
- } catch (IOException e) {
- Log.w(TAG, "Failure creating " + mFile, e);
- }
- mFile.delete();
- return true;
- }
- }
-
- static class WriteFileOp extends Op {
- File mFile;
- RandomAccessFile mRAF;
- byte[] mBuffer;
-
- WriteFileOp() {
- super("WriteFile", "Truncate and write a 64k file");
- }
-
- void onInit(Context context, boolean foreground) {
- mBuffer = new byte[1024*64];
- for (int i=0; i<mBuffer.length; i++) {
- mBuffer[i] = (byte)i;
- }
- mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
- mFile.delete();
- try {
- mRAF = new RandomAccessFile(mFile, "rw");
- } catch (FileNotFoundException e) {
- Log.w(TAG, "Failure creating " + mFile, e);
- }
- }
-
- boolean onRun() {
- try {
- mRAF.seek(0);
- mRAF.setLength(0);
- mRAF.write(mBuffer);
- } catch (IOException e) {
- Log.w(TAG, "Failure writing " + mFile, e);
- }
- return true;
- }
-
- void onTerm(Context context) {
- try {
- mRAF.close();
- } catch (IOException e) {
- Log.w(TAG, "Failure closing " + mFile, e);
- }
- mFile.delete();
- }
- }
-
- static class ReadFileOp extends Op {
- File mFile;
- RandomAccessFile mRAF;
- byte[] mBuffer;
-
- ReadFileOp() {
- super("ReadFile", "Seek and read a 64k file");
- }
-
- void onInit(Context context, boolean foreground) {
- mBuffer = new byte[1024*64];
- for (int i=0; i<mBuffer.length; i++) {
- mBuffer[i] = (byte)i;
- }
- mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
- mFile.delete();
- try {
- mRAF = new RandomAccessFile(mFile, "rw");
- mRAF.seek(0);
- mRAF.setLength(0);
- mRAF.write(mBuffer);
- } catch (IOException e) {
- Log.w(TAG, "Failure creating " + mFile, e);
- }
- }
-
- boolean onRun() {
- try {
- mRAF.seek(0);
- mRAF.read(mBuffer);
- } catch (IOException e) {
- Log.w(TAG, "Failure reading " + mFile, e);
- }
- return true;
- }
-
- void onTerm(Context context) {
- try {
- mRAF.close();
- } catch (IOException e) {
- Log.w(TAG, "Failure closing " + mFile, e);
- }
- mFile.delete();
- }
- }
}
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/LocalTestService.java b/tests/FrameworkPerf/src/com/android/frameworkperf/LocalTestService.java
new file mode 100644
index 0000000..09c6be8
--- /dev/null
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/LocalTestService.java
@@ -0,0 +1,6 @@
+package com.android.frameworkperf;
+
+public class LocalTestService extends TestService {
+ void terminate() {
+ }
+}
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/RunResult.java b/tests/FrameworkPerf/src/com/android/frameworkperf/RunResult.java
new file mode 100644
index 0000000..d14e434
--- /dev/null
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/RunResult.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2011 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 com.android.frameworkperf;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class RunResult implements Parcelable {
+ final String name;
+ final String fgLongName;
+ final String bgLongName;
+ final long fgTime;
+ final long fgOps;
+ final long bgTime;
+ final long bgOps;
+
+ RunResult(TestService.TestRunner op) {
+ name = op.getName();
+ fgLongName = op.getForegroundLongName();
+ bgLongName = op.getBackgroundLongName();
+ fgTime = op.getForegroundTime();
+ fgOps = op.getForegroundOps();
+ bgTime = op.getBackgroundTime();
+ bgOps = op.getBackgroundOps();
+ }
+
+ RunResult(Parcel source) {
+ name = source.readString();
+ fgLongName = source.readString();
+ bgLongName = source.readString();
+ fgTime = source.readLong();
+ fgOps = source.readLong();
+ bgTime = source.readLong();
+ bgOps = source.readLong();
+ }
+
+ float getFgMsPerOp() {
+ return fgOps != 0 ? (fgTime / (float)fgOps) : 0;
+ }
+
+ float getBgMsPerOp() {
+ return bgOps != 0 ? (bgTime / (float)bgOps) : 0;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(name);
+ dest.writeString(fgLongName);
+ dest.writeString(bgLongName);
+ dest.writeLong(fgTime);
+ dest.writeLong(fgOps);
+ dest.writeLong(bgTime);
+ dest.writeLong(bgOps);
+ }
+
+ public static final Parcelable.Creator<RunResult> CREATOR
+ = new Parcelable.Creator<RunResult>() {
+ public RunResult createFromParcel(Parcel in) {
+ return new RunResult(in);
+ }
+
+ public RunResult[] newArray(int size) {
+ return new RunResult[size];
+ }
+ };
+}
\ No newline at end of file
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/TestArgs.java b/tests/FrameworkPerf/src/com/android/frameworkperf/TestArgs.java
new file mode 100644
index 0000000..f2f7c56
--- /dev/null
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/TestArgs.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 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 com.android.frameworkperf;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class TestArgs implements Parcelable {
+ long maxTime;
+ int combOp = -1;
+ int fgOp = -1;
+ int bgOp = -1;
+
+ public TestArgs() {
+ }
+
+ public TestArgs(Parcel source) {
+ maxTime = source.readLong();
+ combOp = source.readInt();
+ fgOp = source.readInt();
+ bgOp = source.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeLong(maxTime);
+ dest.writeInt(combOp);
+ dest.writeInt(fgOp);
+ dest.writeInt(bgOp);
+ }
+
+ public static final Parcelable.Creator<TestArgs> CREATOR
+ = new Parcelable.Creator<TestArgs>() {
+ public TestArgs createFromParcel(Parcel in) {
+ return new TestArgs(in);
+ }
+
+ public TestArgs[] newArray(int size) {
+ return new TestArgs[size];
+ }
+ };
+}
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/TestService.java b/tests/FrameworkPerf/src/com/android/frameworkperf/TestService.java
new file mode 100644
index 0000000..3d939bd
--- /dev/null
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/TestService.java
@@ -0,0 +1,1054 @@
+/*
+ * Copyright (C) 2011 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 com.android.frameworkperf;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.res.TypedArray;
+import android.content.res.XmlResourceParser;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Bundle;
+import android.os.FileUtils;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.Process;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.util.AttributeSet;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.Xml;
+import android.view.LayoutInflater;
+
+public class TestService extends Service {
+ static final String TAG = "Perf";
+
+ final static Op[] mOpPairs = new Op[] {
+ new MethodCallOp(), new NoOp(),
+ new MethodCallOp(), new CpuOp(),
+ new MethodCallOp(), new SchedulerOp(),
+ new MethodCallOp(), new GcOp(),
+ new MethodCallOp(), new CreateFileOp(),
+ new MethodCallOp(), new CreateWriteFileOp(),
+ new MethodCallOp(), new CreateWriteSyncFileOp(),
+ new MethodCallOp(), new WriteFileOp(),
+ new MethodCallOp(), new ReadFileOp(),
+ new SchedulerOp(), new SchedulerOp(),
+ new GcOp(), new NoOp(),
+ new IpcOp(), new NoOp(),
+ new IpcOp(), new CpuOp(),
+ new IpcOp(), new SchedulerOp(),
+ new IpcOp(), new GcOp(),
+ new IpcOp(), new CreateFileOp(),
+ new IpcOp(), new CreateWriteFileOp(),
+ new IpcOp(), new CreateWriteSyncFileOp(),
+ new IpcOp(), new WriteFileOp(),
+ new IpcOp(), new ReadFileOp(),
+ new CreateFileOp(), new NoOp(),
+ new CreateWriteFileOp(), new NoOp(),
+ new CreateWriteSyncFileOp(), new NoOp(),
+ new WriteFileOp(), new NoOp(),
+ new ReadFileOp(), new NoOp(),
+ new WriteFileOp(), new CreateWriteFileOp(),
+ new ReadFileOp(), new CreateWriteFileOp(),
+ new WriteFileOp(), new CreateWriteSyncFileOp(),
+ new ReadFileOp(), new CreateWriteSyncFileOp(),
+ new WriteFileOp(), new WriteFileOp(),
+ new WriteFileOp(), new ReadFileOp(),
+ new ReadFileOp(), new WriteFileOp(),
+ new ReadFileOp(), new ReadFileOp(),
+ new OpenXmlResOp(), new NoOp(),
+ new ReadXmlAttrsOp(), new NoOp(),
+ new ParseXmlResOp(), new NoOp(),
+ new ParseLargeXmlResOp(), new NoOp(),
+ new LayoutInflaterOp(), new NoOp(),
+ new LayoutInflaterLargeOp(), new NoOp(),
+ new LayoutInflaterViewOp(), new NoOp(),
+ new LayoutInflaterButtonOp(), new NoOp(),
+ new LayoutInflaterImageButtonOp(), new NoOp(),
+ new CreateBitmapOp(), new NoOp(),
+ new CreateRecycleBitmapOp(), new NoOp(),
+ new LoadSmallBitmapOp(), new NoOp(),
+ new LoadRecycleSmallBitmapOp(), new NoOp(),
+ new LoadLargeBitmapOp(), new NoOp(),
+ new LoadRecycleLargeBitmapOp(), new NoOp(),
+ new LoadSmallScaledBitmapOp(), new NoOp(),
+ new LoadLargeScaledBitmapOp(), new NoOp(),
+ };
+
+ final static Op[] mAvailOps = new Op[] {
+ null,
+ new NoOp(),
+ new CpuOp(),
+ new SchedulerOp(),
+ new MethodCallOp(),
+ new IpcOp(),
+ new CreateFileOp(),
+ new CreateWriteFileOp(),
+ new CreateWriteSyncFileOp(),
+ new WriteFileOp(),
+ new ReadFileOp(),
+ new OpenXmlResOp(),
+ new ReadXmlAttrsOp(),
+ new ParseXmlResOp(),
+ new ParseLargeXmlResOp(),
+ new LayoutInflaterOp(),
+ new LayoutInflaterLargeOp(),
+ new LayoutInflaterViewOp(),
+ new LayoutInflaterButtonOp(),
+ new LayoutInflaterImageButtonOp(),
+ new CreateBitmapOp(),
+ new CreateRecycleBitmapOp(),
+ new LoadSmallBitmapOp(),
+ new LoadRecycleSmallBitmapOp(),
+ new LoadLargeBitmapOp(),
+ new LoadRecycleLargeBitmapOp(),
+ new LoadSmallScaledBitmapOp(),
+ new LoadLargeScaledBitmapOp(),
+ };
+
+ static final int CMD_START_TEST = 1;
+ static final int CMD_TERMINATE = 2;
+
+ static final int MSG_REALLY_START = 1000;
+ static final int MSG_REALLY_TERMINATE = 1001;
+
+ static final int RES_TEST_FINISHED = 1;
+ static final int RES_TERMINATED = 2;
+
+ final Handler mHandler = new Handler() {
+ @Override public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case CMD_START_TEST: {
+ // Give a little time for things to settle down.
+ Message newMsg = Message.obtain(null, MSG_REALLY_START);
+ newMsg.obj = msg.obj;
+ newMsg.replyTo = msg.replyTo;
+ sendMessageDelayed(newMsg, 500);
+ } break;
+ case MSG_REALLY_START: {
+ Bundle bundle = (Bundle)msg.obj;
+ bundle.setClassLoader(getClassLoader());
+ final TestArgs args = (TestArgs)bundle.getParcelable("args");
+ final Messenger replyTo = msg.replyTo;
+ mRunner.run(this, args, new Runnable() {
+ @Override public void run() {
+ if (replyTo != null) {
+ Message msg = Message.obtain(null, RES_TEST_FINISHED);
+ Bundle bundle = new Bundle();
+ bundle.putParcelable("res", new RunResult(mRunner));
+ msg.obj = bundle;
+ try {
+ replyTo.send(msg);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+ });
+ } break;
+ case CMD_TERMINATE: {
+ // Give a little time for things to settle down.
+ Message newMsg = Message.obtain(null, MSG_REALLY_TERMINATE);
+ newMsg.obj = msg.obj;
+ newMsg.replyTo = msg.replyTo;
+ sendMessageDelayed(newMsg, 50);
+ } break;
+ case MSG_REALLY_TERMINATE: {
+ if (msg.replyTo != null) {
+ Message reply = Message.obtain(null, RES_TERMINATED);
+ try {
+ msg.replyTo.send(reply);
+ } catch (RemoteException e) {
+ }
+ }
+ terminate();
+ } break;
+ }
+ }
+ };
+
+ final TestRunner mRunner = new TestRunner();
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return (new Messenger(mHandler)).getBinder();
+ }
+
+ void terminate() {
+ Runtime.getRuntime().exit(0);
+ }
+
+ enum BackgroundMode {
+ NOTHING,
+ CPU,
+ SCHEDULER
+ };
+
+ public class TestRunner {
+ Handler mHandler;
+ long mMaxRunTime;
+ Op mForegroundOp;
+ Op mBackgroundOp;
+ Runnable mDoneCallback;
+
+ RunnerThread mBackgroundThread;
+ RunnerThread mForegroundThread;
+ long mStartTime;
+
+ boolean mBackgroundRunning;
+ boolean mForegroundRunning;
+
+ long mBackgroundEndTime;
+ long mBackgroundOps;
+ long mForegroundEndTime;
+ long mForegroundOps;
+
+ public TestRunner() {
+ }
+
+ public String getForegroundName() {
+ return mForegroundOp.getName();
+ }
+
+ public String getBackgroundName() {
+ return mBackgroundOp.getName();
+ }
+
+ public String getName() {
+ String fgName = mForegroundOp.getName();
+ String bgName = mBackgroundOp.getName();
+ StringBuilder res = new StringBuilder();
+ if (fgName != null) {
+ res.append(fgName);
+ res.append("Fg");
+ }
+ if (bgName != null) {
+ res.append(bgName);
+ res.append("Bg");
+ }
+ return res.toString();
+ }
+
+ public String getForegroundLongName() {
+ return mForegroundOp.getLongName();
+ }
+
+ public String getBackgroundLongName() {
+ return mBackgroundOp.getLongName();
+ }
+
+ public void run(Handler handler, TestArgs args, Runnable doneCallback) {
+ mHandler = handler;
+ mMaxRunTime = args.maxTime;
+ if (args.combOp >= 0) {
+ mForegroundOp = mOpPairs[args.combOp];
+ mBackgroundOp = mOpPairs[args.combOp+1];
+ } else {
+ mForegroundOp = mAvailOps[args.fgOp];
+ mBackgroundOp = mAvailOps[args.bgOp];
+ }
+ mDoneCallback = doneCallback;
+ mBackgroundThread = new RunnerThread("background", new Runnable() {
+ @Override public void run() {
+ boolean running;
+ int ops = 0;
+ do {
+ running = mBackgroundOp.onRun();
+ ops++;
+ } while (evalRepeat(running, true) && running);
+ mBackgroundEndTime = SystemClock.uptimeMillis();
+ mBackgroundOps = ops * mBackgroundOp.getOpsPerRun();
+ threadFinished(false);
+ }
+ }, Process.THREAD_PRIORITY_BACKGROUND);
+ mForegroundThread = new RunnerThread("background", new Runnable() {
+ @Override public void run() {
+ boolean running;
+ int ops = 0;
+ do {
+ running = mForegroundOp.onRun();
+ ops++;
+ } while (evalRepeat(true, running) && running);
+ mForegroundEndTime = SystemClock.uptimeMillis();
+ mForegroundOps = ops * mForegroundOp.getOpsPerRun();
+ threadFinished(true);
+ }
+ }, Process.THREAD_PRIORITY_FOREGROUND);
+
+ mForegroundOp.onInit(TestService.this, true);
+ mBackgroundOp.onInit(TestService.this, false);
+
+ synchronized (this) {
+ mStartTime = SystemClock.uptimeMillis();
+ mBackgroundRunning = true;
+ mForegroundRunning = true;
+ }
+
+ mBackgroundThread.start();
+ mForegroundThread.start();
+ }
+
+ public long getForegroundTime() {
+ return mForegroundEndTime-mStartTime;
+ }
+
+ public long getForegroundOps() {
+ return mForegroundOps;
+ }
+
+ public long getBackgroundTime() {
+ return mBackgroundEndTime-mStartTime;
+ }
+
+ public long getBackgroundOps() {
+ return mBackgroundOps;
+ }
+
+ private boolean evalRepeat(boolean bgRunning, boolean fgRunning) {
+ synchronized (this) {
+ if (!bgRunning) {
+ mBackgroundRunning = false;
+ }
+ if (!fgRunning) {
+ mForegroundRunning = false;
+ }
+ if (!mBackgroundRunning && !mForegroundRunning) {
+ return false;
+ }
+ long now = SystemClock.uptimeMillis();
+ if (now > (mStartTime+mMaxRunTime)) {
+ return false;
+ }
+ return true;
+ }
+ }
+
+ private void threadFinished(boolean foreground) {
+ synchronized (this) {
+ if (foreground) {
+ mForegroundRunning = false;
+ } else {
+ mBackgroundRunning = false;
+ }
+ if (!mBackgroundRunning && !mForegroundRunning) {
+ mHandler.post(new Runnable() {
+ @Override public void run() {
+ mForegroundOp.onTerm(TestService.this);
+ mBackgroundOp.onTerm(TestService.this);
+ if (mDoneCallback != null) {
+ mDoneCallback.run();
+ }
+ }
+ });
+ }
+ }
+ }
+ }
+
+ class RunnerThread extends Thread {
+ private final Runnable mOp;
+ private final int mPriority;
+
+ RunnerThread(String name, Runnable op, int priority) {
+ super(name);
+ mOp = op;
+ mPriority = priority;
+ }
+
+ public void run() {
+ Process.setThreadPriority(mPriority);
+ mOp.run();
+ }
+ }
+
+ static public abstract class Op {
+ final String mName;
+ final String mLongName;
+
+ public Op(String name, String longName) {
+ mName = name;
+ mLongName = longName;
+ }
+
+ public String getName() {
+ return mName;
+ }
+
+ public String getLongName() {
+ return mLongName;
+ }
+
+ void onInit(Context context, boolean foreground) {
+ }
+
+ abstract boolean onRun();
+
+ void onTerm(Context context) {
+ }
+
+ int getOpsPerRun() {
+ return 1;
+ }
+ }
+
+ static class NoOp extends Op {
+ NoOp() {
+ super(null, "Nothing");
+ }
+
+ boolean onRun() {
+ return false;
+ }
+
+ int getOpsPerRun() {
+ return 0;
+ }
+ }
+
+ static class CpuOp extends Op {
+ CpuOp() {
+ super("CPU", "Consume CPU");
+ }
+
+ boolean onRun() {
+ return true;
+ }
+ }
+
+ static class SchedulerOp extends Op {
+ SchedulerOp() {
+ super("Sched", "Change scheduler group");
+ }
+
+ boolean onRun() {
+ Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
+ Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
+ return true;
+ }
+ }
+
+ static class GcOp extends Op {
+ GcOp() {
+ super("Gc", "Run garbage collector");
+ }
+
+ boolean onRun() {
+ byte[] stuff = new byte[1024*1024];
+ return true;
+ }
+ }
+
+ static class MethodCallOp extends Op {
+ MethodCallOp() {
+ super("MethodCall", "Method call");
+ }
+
+ boolean onRun() {
+ final int N = getOpsPerRun();
+ for (int i=0; i<N; i++) {
+ someFunc(i);
+ }
+ return true;
+ }
+
+ int someFunc(int foo) {
+ return 0;
+ }
+
+ int getOpsPerRun() {
+ return 500;
+ }
+ }
+
+ static class IpcOp extends Op {
+ PackageManager mPm;
+ String mProcessName;
+
+ IpcOp() {
+ super("Ipc", "IPC to system process");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mPm = context.getPackageManager();
+ mProcessName = context.getApplicationInfo().processName;
+ }
+
+ boolean onRun() {
+ final int N = getOpsPerRun();
+ for (int i=0; i<N; i++) {
+ mPm.queryContentProviders(mProcessName, Process.myUid(), 0);
+ }
+ return true;
+ }
+
+ int getOpsPerRun() {
+ return 100;
+ }
+ }
+
+ static class OpenXmlResOp extends Op {
+ Context mContext;
+
+ OpenXmlResOp() {
+ super("OpenXmlRes", "Open (and close) an XML resource");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ XmlResourceParser parser = mContext.getResources().getLayout(R.xml.simple);
+ parser.close();
+ return true;
+ }
+ }
+
+ static class ReadXmlAttrsOp extends Op {
+ Context mContext;
+ XmlResourceParser mParser;
+ AttributeSet mAttrs;
+
+ ReadXmlAttrsOp() {
+ super("ReadXmlAttrs", "Read attributes from an XML tag");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ mParser = mContext.getResources().getLayout(R.xml.simple);
+ mAttrs = Xml.asAttributeSet(mParser);
+
+ int eventType;
+ try {
+ // Find the first <item> tag.
+ eventType = mParser.getEventType();
+ String tagName;
+ do {
+ if (eventType == XmlPullParser.START_TAG) {
+ tagName = mParser.getName();
+ if (tagName.equals("item")) {
+ break;
+ }
+ }
+ eventType = mParser.next();
+ } while (eventType != XmlPullParser.END_DOCUMENT);
+ } catch (XmlPullParserException e) {
+ throw new RuntimeException("I died", e);
+ } catch (IOException e) {
+ throw new RuntimeException("I died", e);
+ }
+ }
+
+ void onTerm(Context context) {
+ mParser.close();
+ }
+
+ boolean onRun() {
+ TypedArray a = mContext.obtainStyledAttributes(mAttrs,
+ com.android.internal.R.styleable.MenuItem);
+ a.recycle();
+ return true;
+ }
+ }
+
+ static class ParseXmlResOp extends Op {
+ Context mContext;
+
+ ParseXmlResOp() {
+ super("ParseXmlRes", "Parse compiled XML resource");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ SimpleInflater inf = new SimpleInflater(mContext);
+ inf.inflate(R.xml.simple);
+ return true;
+ }
+ }
+
+ static class ParseLargeXmlResOp extends Op {
+ Context mContext;
+
+ ParseLargeXmlResOp() {
+ super("ParseLargeXmlRes", "Parse large XML resource");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ SimpleInflater inf = new SimpleInflater(mContext);
+ inf.inflate(R.xml.simple_large);
+ return true;
+ }
+ }
+
+ static class LayoutInflaterOp extends Op {
+ Context mContext;
+
+ LayoutInflaterOp() {
+ super("LayoutInflater", "Inflate layout resource");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ inf.inflate(R.layout.small_layout, null);
+ return true;
+ }
+ }
+
+ static class LayoutInflaterLargeOp extends Op {
+ Context mContext;
+
+ LayoutInflaterLargeOp() {
+ super("LayoutInflaterLarge", "Inflate large layout resource");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ inf.inflate(R.layout.large_layout, null);
+ return true;
+ }
+ }
+
+ static class LayoutInflaterViewOp extends Op {
+ Context mContext;
+
+ LayoutInflaterViewOp() {
+ super("LayoutInflaterView", "Inflate layout with 50 View objects");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ inf.inflate(R.layout.view_layout, null);
+ return true;
+ }
+ }
+
+ static class LayoutInflaterButtonOp extends Op {
+ Context mContext;
+
+ LayoutInflaterButtonOp() {
+ super("LayoutInflaterButton", "Inflate layout with 50 Button objects");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ inf.inflate(R.layout.button_layout, null);
+ return true;
+ }
+ }
+
+ static class LayoutInflaterImageButtonOp extends Op {
+ Context mContext;
+
+ LayoutInflaterImageButtonOp() {
+ super("LayoutInflaterImageButton", "Inflate layout with 50 ImageButton objects");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ LayoutInflater inf = (LayoutInflater)mContext.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+ inf.inflate(R.layout.image_button_layout, null);
+ return true;
+ }
+ }
+
+ static class CreateBitmapOp extends Op {
+ Context mContext;
+
+ CreateBitmapOp() {
+ super("CreateBitmap", "Create a Bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ARGB_8888);
+ return true;
+ }
+ }
+
+ static class CreateRecycleBitmapOp extends Op {
+ Context mContext;
+
+ CreateRecycleBitmapOp() {
+ super("CreateRecycleBitmap", "Create and recycle a Bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ARGB_8888);
+ bm.recycle();
+ return true;
+ }
+ }
+
+ static class LoadSmallBitmapOp extends Op {
+ Context mContext;
+
+ LoadSmallBitmapOp() {
+ super("LoadSmallBitmap", "Load small raw bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.stat_sample, opts);
+ return true;
+ }
+ }
+
+ static class LoadRecycleSmallBitmapOp extends Op {
+ Context mContext;
+
+ LoadRecycleSmallBitmapOp() {
+ super("LoadRecycleSmallBitmap", "Load and recycle small raw bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.stat_sample, opts);
+ bm.recycle();
+ return true;
+ }
+ }
+
+ static class LoadLargeBitmapOp extends Op {
+ Context mContext;
+
+ LoadLargeBitmapOp() {
+ super("LoadLargeBitmap", "Load large raw bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.wallpaper_goldengate, opts);
+ return true;
+ }
+ }
+
+ static class LoadRecycleLargeBitmapOp extends Op {
+ Context mContext;
+
+ LoadRecycleLargeBitmapOp() {
+ super("LoadRecycleLargeBitmap", "Load and recycle large raw bitmap");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.wallpaper_goldengate, opts);
+ bm.recycle();
+ return true;
+ }
+ }
+
+ static class LoadSmallScaledBitmapOp extends Op {
+ Context mContext;
+
+ LoadSmallScaledBitmapOp() {
+ super("LoadSmallScaledBitmap", "Load small raw bitmap that is scaled for density");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.stat_sample_scale, opts);
+ return true;
+ }
+ }
+
+ static class LoadLargeScaledBitmapOp extends Op {
+ Context mContext;
+
+ LoadLargeScaledBitmapOp() {
+ super("LoadLargeScaledBitmap", "Load large raw bitmap that is scaled for density");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mContext = context;
+ }
+
+ boolean onRun() {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
+ Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(),
+ R.drawable.wallpaper_goldengate_scale, opts);
+ return true;
+ }
+ }
+
+ static class CreateFileOp extends Op {
+ File mFile;
+
+ CreateFileOp() {
+ super("CreateFile", "Create and delete a file");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
+ mFile.delete();
+ }
+
+ boolean onRun() {
+ try {
+ mFile.createNewFile();
+ } catch (IOException e) {
+ Log.w(TAG, "Failure creating " + mFile, e);
+ }
+ mFile.delete();
+ return true;
+ }
+ }
+
+ static class CreateWriteFileOp extends Op {
+ File mFile;
+
+ CreateWriteFileOp() {
+ super("CreateWriteFile", "Create, write, and delete a file");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
+ mFile.delete();
+ }
+
+ boolean onRun() {
+ try {
+ FileOutputStream fos = new FileOutputStream(mFile);
+ fos.write(1);
+ fos.close();
+ } catch (IOException e) {
+ Log.w(TAG, "Failure creating " + mFile, e);
+ }
+ mFile.delete();
+ return true;
+ }
+ }
+
+ static class CreateWriteSyncFileOp extends Op {
+ File mFile;
+
+ CreateWriteSyncFileOp() {
+ super("CreateWriteSyncFile", "Create, write, sync, and delete a file");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
+ mFile.delete();
+ }
+
+ boolean onRun() {
+ try {
+ FileOutputStream fos = new FileOutputStream(mFile);
+ fos.write(1);
+ fos.flush();
+ FileUtils.sync(fos);
+ fos.close();
+ } catch (IOException e) {
+ Log.w(TAG, "Failure creating " + mFile, e);
+ }
+ mFile.delete();
+ return true;
+ }
+ }
+
+ static class WriteFileOp extends Op {
+ File mFile;
+ RandomAccessFile mRAF;
+ byte[] mBuffer;
+
+ WriteFileOp() {
+ super("WriteFile", "Truncate and write a 64k file");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mBuffer = new byte[1024*64];
+ for (int i=0; i<mBuffer.length; i++) {
+ mBuffer[i] = (byte)i;
+ }
+ mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
+ mFile.delete();
+ try {
+ mRAF = new RandomAccessFile(mFile, "rw");
+ } catch (FileNotFoundException e) {
+ Log.w(TAG, "Failure creating " + mFile, e);
+ }
+ }
+
+ boolean onRun() {
+ try {
+ mRAF.seek(0);
+ mRAF.setLength(0);
+ mRAF.write(mBuffer);
+ } catch (IOException e) {
+ Log.w(TAG, "Failure writing " + mFile, e);
+ }
+ return true;
+ }
+
+ void onTerm(Context context) {
+ try {
+ mRAF.close();
+ } catch (IOException e) {
+ Log.w(TAG, "Failure closing " + mFile, e);
+ }
+ mFile.delete();
+ }
+ }
+
+ static class ReadFileOp extends Op {
+ File mFile;
+ RandomAccessFile mRAF;
+ byte[] mBuffer;
+
+ ReadFileOp() {
+ super("ReadFile", "Seek and read a 64k file");
+ }
+
+ void onInit(Context context, boolean foreground) {
+ mBuffer = new byte[1024*64];
+ for (int i=0; i<mBuffer.length; i++) {
+ mBuffer[i] = (byte)i;
+ }
+ mFile = context.getFileStreamPath(foreground ? "test-fg.file" : "test-bg.file");
+ mFile.delete();
+ try {
+ mRAF = new RandomAccessFile(mFile, "rw");
+ mRAF.seek(0);
+ mRAF.setLength(0);
+ mRAF.write(mBuffer);
+ } catch (IOException e) {
+ Log.w(TAG, "Failure creating " + mFile, e);
+ }
+ }
+
+ boolean onRun() {
+ try {
+ mRAF.seek(0);
+ mRAF.read(mBuffer);
+ } catch (IOException e) {
+ Log.w(TAG, "Failure reading " + mFile, e);
+ }
+ return true;
+ }
+
+ void onTerm(Context context) {
+ try {
+ mRAF.close();
+ } catch (IOException e) {
+ Log.w(TAG, "Failure closing " + mFile, e);
+ }
+ mFile.delete();
+ }
+ }
+}
diff --git a/wifi/java/android/net/wifi/WifiApConfigStore.java b/wifi/java/android/net/wifi/WifiApConfigStore.java
index bb5427d..0531ca3 100644
--- a/wifi/java/android/net/wifi/WifiApConfigStore.java
+++ b/wifi/java/android/net/wifi/WifiApConfigStore.java
@@ -19,11 +19,16 @@
import android.content.Context;
import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.os.Environment;
-import android.os.Message;
import android.os.Handler;
-import android.os.HandlerThread;
+import android.os.Message;
+import android.os.Messenger;
import android.util.Log;
+import com.android.internal.util.AsyncChannel;
+import com.android.internal.R;
+import com.android.internal.util.State;
+import com.android.internal.util.StateMachine;
+
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
@@ -34,16 +39,13 @@
import java.net.InetAddress;
import java.util.UUID;
-import com.android.internal.R;
-
-
/**
* Provides API to the WifiStateMachine for doing read/write access
* to soft access point configuration
*/
-class WifiApConfigStore {
+class WifiApConfigStore extends StateMachine {
- private static Context sContext;
+ private Context mContext;
private static final String TAG = "WifiApConfigStore";
private static final String AP_CONFIG_FILE = Environment.getDataDirectory() +
@@ -51,131 +53,160 @@
private static final int AP_CONFIG_FILE_VERSION = 1;
- private static WifiConfiguration sApConfig = new WifiConfiguration();
- private static final Object sApConfigLock = new Object();
+ private State mDefaultState = new DefaultState();
+ private State mInactiveState = new InactiveState();
+ private State mActiveState = new ActiveState();
- private static FileReadWriteHandler sFileReadWriteHandler;
- private static final int READ_AP_CONFIG = 1;
- private static final int WRITE_AP_CONFIG = 2;
+ private WifiConfiguration mWifiApConfig = null;
+ private AsyncChannel mReplyChannel = new AsyncChannel();
- static void initialize(Context context) {
- sContext = context;
+ WifiApConfigStore(Context context, Handler target) {
+ super(TAG, target.getLooper());
- /* File operations happen on a seperate thread */
- HandlerThread configThread = new HandlerThread("WifiApConfigStore");
- configThread.start();
- sFileReadWriteHandler = new FileReadWriteHandler(configThread.getLooper());
- Message.obtain(sFileReadWriteHandler, READ_AP_CONFIG).sendToTarget();
+ mContext = context;
+ addState(mDefaultState);
+ addState(mInactiveState, mDefaultState);
+ addState(mActiveState, mDefaultState);
+
+ setInitialState(mInactiveState);
}
-
- static void setApConfiguration(WifiConfiguration config) {
- synchronized (sApConfigLock) {
- sApConfig = config;
- }
- Message.obtain(sFileReadWriteHandler, WRITE_AP_CONFIG, new WifiConfiguration(config))
- .sendToTarget();
+ public static WifiApConfigStore makeWifiApConfigStore(Context context, Handler target) {
+ WifiApConfigStore s = new WifiApConfigStore(context, target);
+ s.start();
+ return s;
}
- static WifiConfiguration getApConfiguration() {
- synchronized (sApConfigLock) {
- return new WifiConfiguration(sApConfig);
- }
- }
-
- /**
- * File read/write handler
- */
- private static class FileReadWriteHandler extends Handler {
-
- public FileReadWriteHandler(android.os.Looper looper) {
- super(looper);
- }
-
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case WRITE_AP_CONFIG:
- writeApConfiguration((WifiConfiguration) msg.obj);
+ class DefaultState extends State {
+ public boolean processMessage(Message message) {
+ switch (message.what) {
+ case WifiStateMachine.CMD_SET_AP_CONFIG:
+ case WifiStateMachine.CMD_SET_AP_CONFIG_COMPLETED:
+ Log.e(TAG, "Unexpected message: " + message);
break;
- case READ_AP_CONFIG:
- readApConfiguration();
+ case WifiStateMachine.CMD_REQUEST_AP_CONFIG:
+ mReplyChannel.replyToMessage(message,
+ WifiStateMachine.CMD_RESPONSE_AP_CONFIG, mWifiApConfig);
break;
default:
- Log.e(TAG, "Unknown command in FileReadWriteHandler: " + msg);
+ Log.e(TAG, "Failed to handle " + message);
break;
}
+ return HANDLED;
}
+ }
- private static void writeApConfiguration(final WifiConfiguration config) {
- DataOutputStream out = null;
- try {
- out = new DataOutputStream(new BufferedOutputStream(
- new FileOutputStream(AP_CONFIG_FILE)));
-
- out.writeInt(AP_CONFIG_FILE_VERSION);
- out.writeUTF(config.SSID);
- int authType = config.getAuthType();
- out.writeInt(authType);
- if(authType != KeyMgmt.NONE) {
- out.writeUTF(config.preSharedKey);
- }
- } catch (IOException e) {
- Log.e(TAG, "Error writing hotspot configuration" + e);
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {}
- }
+ class InactiveState extends State {
+ public boolean processMessage(Message message) {
+ switch (message.what) {
+ case WifiStateMachine.CMD_SET_AP_CONFIG:
+ mWifiApConfig = (WifiConfiguration) message.obj;
+ transitionTo(mActiveState);
+ break;
+ default:
+ return NOT_HANDLED;
}
+ return HANDLED;
+ }
+ }
+
+ class ActiveState extends State {
+ public void enter() {
+ new Thread(new Runnable() {
+ public void run() {
+ writeApConfiguration(mWifiApConfig);
+ sendMessage(WifiStateMachine.CMD_SET_AP_CONFIG_COMPLETED);
+ }
+ }).start();
}
- private static void readApConfiguration() {
- DataInputStream in = null;
- try {
- WifiConfiguration config = new WifiConfiguration();
- in = new DataInputStream(new BufferedInputStream(new FileInputStream(
- AP_CONFIG_FILE)));
-
- int version = in.readInt();
- if (version != 1) {
- Log.e(TAG, "Bad version on hotspot configuration file, set defaults");
- setDefaultApConfiguration();
- return;
- }
- config.SSID = in.readUTF();
- int authType = in.readInt();
- config.allowedKeyManagement.set(authType);
- if (authType != KeyMgmt.NONE) {
- config.preSharedKey = in.readUTF();
- }
- synchronized (sApConfigLock) {
- sApConfig = config;
- }
- } catch (IOException ignore) {
- setDefaultApConfiguration();
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {}
- }
+ public boolean processMessage(Message message) {
+ switch (message.what) {
+ //TODO: have feedback to the user when we do this
+ //to indicate the write is currently in progress
+ case WifiStateMachine.CMD_SET_AP_CONFIG:
+ deferMessage(message);
+ break;
+ case WifiStateMachine.CMD_SET_AP_CONFIG_COMPLETED:
+ transitionTo(mInactiveState);
+ break;
+ default:
+ return NOT_HANDLED;
}
+ return HANDLED;
}
+ }
- /* Generate a default WPA2 based configuration with a random password.
- We are changing the Wifi Ap configuration storage from secure settings to a
- flat file accessible only by the system. A WPA2 based default configuration
- will keep the device secure after the update */
- private static void setDefaultApConfiguration() {
+ void loadApConfiguration() {
+ DataInputStream in = null;
+ try {
WifiConfiguration config = new WifiConfiguration();
- config.SSID = sContext.getString(R.string.wifi_tether_configure_ssid_default);
- config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
- String randomUUID = UUID.randomUUID().toString();
- //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
- config.preSharedKey = randomUUID.substring(0, 8) + randomUUID.substring(9,13);
- setApConfiguration(config);
+ in = new DataInputStream(new BufferedInputStream(new FileInputStream(
+ AP_CONFIG_FILE)));
+
+ int version = in.readInt();
+ if (version != 1) {
+ Log.e(TAG, "Bad version on hotspot configuration file, set defaults");
+ setDefaultApConfiguration();
+ return;
+ }
+ config.SSID = in.readUTF();
+ int authType = in.readInt();
+ config.allowedKeyManagement.set(authType);
+ if (authType != KeyMgmt.NONE) {
+ config.preSharedKey = in.readUTF();
+ }
+ mWifiApConfig = config;
+ } catch (IOException ignore) {
+ setDefaultApConfiguration();
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {}
+ }
}
}
+
+ Messenger getMessenger() {
+ return new Messenger(getHandler());
+ }
+
+ private void writeApConfiguration(final WifiConfiguration config) {
+ DataOutputStream out = null;
+ try {
+ out = new DataOutputStream(new BufferedOutputStream(
+ new FileOutputStream(AP_CONFIG_FILE)));
+
+ out.writeInt(AP_CONFIG_FILE_VERSION);
+ out.writeUTF(config.SSID);
+ int authType = config.getAuthType();
+ out.writeInt(authType);
+ if(authType != KeyMgmt.NONE) {
+ out.writeUTF(config.preSharedKey);
+ }
+ } catch (IOException e) {
+ Log.e(TAG, "Error writing hotspot configuration" + e);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {}
+ }
+ }
+ }
+
+ /* Generate a default WPA2 based configuration with a random password.
+ We are changing the Wifi Ap configuration storage from secure settings to a
+ flat file accessible only by the system. A WPA2 based default configuration
+ will keep the device secure after the update */
+ private void setDefaultApConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);
+ config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
+ String randomUUID = UUID.randomUUID().toString();
+ //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
+ config.preSharedKey = randomUUID.substring(0, 8) + randomUUID.substring(9,13);
+ sendMessage(WifiStateMachine.CMD_SET_AP_CONFIG, config);
+ }
}
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 00fae2e..aadcaad 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -184,6 +184,7 @@
private WifiP2pManager mWifiP2pManager;
//Used to initiate a connection with WifiP2pService
private AsyncChannel mWifiP2pChannel = new AsyncChannel();
+ private AsyncChannel mWifiApConfigChannel = new AsyncChannel();
// Event log tags (must be in sync with event-log-tags)
private static final int EVENTLOG_WIFI_STATE_CHANGED = 50021;
@@ -233,12 +234,16 @@
static final int CMD_STOP_AP = BASE + 24;
/* Set the soft access point configuration */
static final int CMD_SET_AP_CONFIG = BASE + 25;
- /* Get the soft access point configuration */
- static final int CMD_GET_AP_CONFIG = BASE + 26;
+ /* Soft access point configuration set completed */
+ static final int CMD_SET_AP_CONFIG_COMPLETED = BASE + 26;
+ /* Request the soft access point configuration */
+ static final int CMD_REQUEST_AP_CONFIG = BASE + 27;
+ /* Response to access point configuration request */
+ static final int CMD_RESPONSE_AP_CONFIG = BASE + 28;
/* Set configuration on tether interface */
- static final int CMD_TETHER_INTERFACE = BASE + 27;
+ static final int CMD_TETHER_INTERFACE = BASE + 29;
- static final int CMD_BLUETOOTH_ADAPTER_STATE_CHANGE = BASE + 28;
+ static final int CMD_BLUETOOTH_ADAPTER_STATE_CHANGE = BASE + 30;
/* Supplicant commands */
/* Is supplicant alive ? */
@@ -530,6 +535,11 @@
mWpsStateMachine = new WpsStateMachine(context, this, getHandler());
mLinkProperties = new LinkProperties();
+ WifiApConfigStore wifiApConfigStore = WifiApConfigStore.makeWifiApConfigStore(
+ context, getHandler());
+ wifiApConfigStore.loadApConfiguration();
+ mWifiApConfigChannel.connectSync(mContext, getHandler(), wifiApConfigStore.getMessenger());
+
mNetworkInfo.setIsAvailable(false);
mLinkProperties.clear();
mLastBssid = null;
@@ -659,11 +669,11 @@
}
public void setWifiApConfiguration(WifiConfiguration config) {
- sendMessage(obtainMessage(CMD_SET_AP_CONFIG, config));
+ mWifiApConfigChannel.sendMessage(CMD_SET_AP_CONFIG, config);
}
- public WifiConfiguration syncGetWifiApConfiguration(AsyncChannel channel) {
- Message resultMsg = channel.sendMessageSynchronously(CMD_GET_AP_CONFIG);
+ public WifiConfiguration syncGetWifiApConfiguration() {
+ Message resultMsg = mWifiApConfigChannel.sendMessageSynchronously(CMD_REQUEST_AP_CONFIG);
WifiConfiguration ret = (WifiConfiguration) resultMsg.obj;
resultMsg.recycle();
return ret;
@@ -1714,25 +1724,27 @@
* TODO: Add control channel setup through hostapd that allows changing config
* on a running daemon
*/
- private boolean startSoftApWithConfig(WifiConfiguration config) {
- if (config == null) {
- config = WifiApConfigStore.getApConfiguration();
- } else {
- WifiApConfigStore.setApConfiguration(config);
- }
- try {
- mNwService.startAccessPoint(config, mInterfaceName, SOFTAP_IFACE);
- } catch (Exception e) {
- loge("Exception in softap start " + e);
- try {
- mNwService.stopAccessPoint(mInterfaceName);
- mNwService.startAccessPoint(config, mInterfaceName, SOFTAP_IFACE);
- } catch (Exception e1) {
- loge("Exception in softap re-start " + e1);
- return false;
+ private void startSoftApWithConfig(final WifiConfiguration config) {
+ // start hostapd on a seperate thread
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ mNwService.startAccessPoint(config, mInterfaceName, SOFTAP_IFACE);
+ } catch (Exception e) {
+ loge("Exception in softap start " + e);
+ try {
+ mNwService.stopAccessPoint(mInterfaceName);
+ mNwService.startAccessPoint(config, mInterfaceName, SOFTAP_IFACE);
+ } catch (Exception e1) {
+ loge("Exception in softap re-start " + e1);
+ sendMessage(CMD_START_AP_FAILURE);
+ return;
+ }
+ }
+ if (DBG) log("Soft AP start successful");
+ sendMessage(CMD_START_AP_SUCCESS);
}
- }
- return true;
+ }).start();
}
/********************************************************
@@ -1775,13 +1787,6 @@
case CMD_ENABLE_BACKGROUND_SCAN:
mEnableBackgroundScan = (message.arg1 == 1);
break;
- case CMD_SET_AP_CONFIG:
- WifiApConfigStore.setApConfiguration((WifiConfiguration) message.obj);
- break;
- case CMD_GET_AP_CONFIG:
- WifiConfiguration config = WifiApConfigStore.getApConfiguration();
- mReplyChannel.replyToMessage(message, message.what, config);
- break;
/* Discard */
case CMD_LOAD_DRIVER:
case CMD_UNLOAD_DRIVER:
@@ -1823,6 +1828,11 @@
case CMD_ENABLE_ALL_NETWORKS:
case DhcpStateMachine.CMD_PRE_DHCP_ACTION:
case DhcpStateMachine.CMD_POST_DHCP_ACTION:
+ /* Handled by WifiApConfigStore */
+ case CMD_SET_AP_CONFIG:
+ case CMD_SET_AP_CONFIG_COMPLETED:
+ case CMD_REQUEST_AP_CONFIG:
+ case CMD_RESPONSE_AP_CONFIG:
break;
case WifiMonitor.DRIVER_HUNG_EVENT:
setWifiEnabled(false);
@@ -1856,8 +1866,6 @@
// 50021 wifi_state_changed (custom|1|5)
EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName());
- WifiApConfigStore.initialize(mContext);
-
if (WifiNative.isDriverLoaded()) {
transitionTo(mDriverLoadedState);
}
@@ -3243,21 +3251,19 @@
if (DBG) log(getName() + "\n");
EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName());
- final Message message = Message.obtain(getCurrentMessage());
- final WifiConfiguration config = (WifiConfiguration) message.obj;
+ final Message message = getCurrentMessage();
+ if (message.what == CMD_START_AP) {
+ final WifiConfiguration config = (WifiConfiguration) message.obj;
- // start hostapd on a seperate thread
- new Thread(new Runnable() {
- public void run() {
- if (startSoftApWithConfig(config)) {
- if (DBG) log("Soft AP start successful");
- sendMessage(CMD_START_AP_SUCCESS);
- } else {
- loge("Soft AP start failed");
- sendMessage(CMD_START_AP_FAILURE);
- }
+ if (config == null) {
+ mWifiApConfigChannel.sendMessage(CMD_REQUEST_AP_CONFIG);
+ } else {
+ mWifiApConfigChannel.sendMessage(CMD_SET_AP_CONFIG, config);
+ startSoftApWithConfig(config);
}
- }).start();
+ } else {
+ throw new RuntimeException("Illegal transition to SoftApStartingState: " + message);
+ }
}
@Override
public boolean processMessage(Message message) {
@@ -3282,6 +3288,15 @@
case WifiP2pService.P2P_ENABLE_PENDING:
deferMessage(message);
break;
+ case WifiStateMachine.CMD_RESPONSE_AP_CONFIG:
+ WifiConfiguration config = (WifiConfiguration) message.obj;
+ if (config != null) {
+ startSoftApWithConfig(config);
+ } else {
+ loge("Softap config is null!");
+ sendMessage(CMD_START_AP_FAILURE);
+ }
+ break;
case CMD_START_AP_SUCCESS:
setWifiApState(WIFI_AP_STATE_ENABLED);
transitionTo(mSoftApStartedState);