Loading Android.mk +6 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ LOCAL_SRC_FILES += \ core/java/android/bluetooth/IBluetoothDevice.aidl \ core/java/android/bluetooth/IBluetoothDeviceCallback.aidl \ core/java/android/bluetooth/IBluetoothHeadset.aidl \ core/java/android/bluetooth/IBluetoothHeadsetCallback.aidl \ core/java/android/content/ISyncAdapter.aidl \ core/java/android/content/ISyncContext.aidl \ core/java/android/content/pm/IPackageDataObserver.aidl \ Loading @@ -98,6 +97,7 @@ LOCAL_SRC_FILES += \ core/java/android/view/IWindowManager.aidl \ core/java/android/view/IWindowSession.aidl \ core/java/com/android/internal/app/IBatteryStats.aidl \ core/java/com/android/internal/gadget/IGadgetService.aidl \ core/java/com/android/internal/view/IInputContext.aidl \ core/java/com/android/internal/view/IInputContextCallback.aidl \ core/java/com/android/internal/view/IInputMethod.aidl \ Loading Loading @@ -165,6 +165,7 @@ aidl_files := \ frameworks/base/core/java/android/content/Intent.aidl \ frameworks/base/core/java/android/content/SyncStats.aidl \ frameworks/base/core/java/android/content/res/Configuration.aidl \ frameworks/base/core/java/android/gadget/GadgetInfo.aidl \ frameworks/base/core/java/android/net/Uri.aidl \ frameworks/base/core/java/android/os/Bundle.aidl \ frameworks/base/core/java/android/os/ParcelFileDescriptor.aidl \ Loading Loading @@ -421,4 +422,8 @@ include $(BUILD_JAVA_LIBRARY) # Include subdirectory makefiles # ============================================================ # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework # team really wants is to build the stuff defined by this makefile. ifeq (,$(ONE_SHOT_MAKEFILE)) include $(call first-makefiles-under,$(LOCAL_PATH)) endif api/current.xml +232 −48 Original line number Diff line number Diff line Loading @@ -8563,22 +8563,198 @@ visibility="public" > </field> <field name="gallery_thumb" <field name="emo_im_angel" type="int" transient="false" volatile="false" value="17301532" value="17301668" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_cool" type="int" transient="false" volatile="false" value="17301669" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_crying" type="int" transient="false" volatile="false" value="17301670" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_embarrassed" type="int" transient="false" volatile="false" value="17301671" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_btn_search" <field name="emo_im_foot_in_mouth" type="int" transient="false" volatile="false" value="17301662" value="17301672" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_happy" type="int" transient="false" volatile="false" value="17301673" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_kissing" type="int" transient="false" volatile="false" value="17301674" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_laughing" type="int" transient="false" volatile="false" value="17301675" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_lips_are_sealed" type="int" transient="false" volatile="false" value="17301676" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_money_mouth" type="int" transient="false" volatile="false" value="17301677" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_sad" type="int" transient="false" volatile="false" value="17301678" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_surprised" type="int" transient="false" volatile="false" value="17301679" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_tongue_sticking_out" type="int" transient="false" volatile="false" value="17301680" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_undecided" type="int" transient="false" volatile="false" value="17301681" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_winking" type="int" transient="false" volatile="false" value="17301682" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_wtf" type="int" transient="false" volatile="false" value="17301683" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_yelling" type="int" transient="false" volatile="false" value="17301684" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="gallery_thumb" type="int" transient="false" volatile="false" value="17301532" static="true" final="true" deprecated="not deprecated" Loading Loading @@ -8651,17 +8827,6 @@ visibility="public" > </field> <field name="ic_dialog_menu_generic" type="int" transient="false" volatile="false" value="17301664" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_input_add" type="int" transient="false" Loading Loading @@ -9014,17 +9179,6 @@ visibility="public" > </field> <field name="ic_menu_login" type="int" transient="false" volatile="false" value="17301665" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_manage" type="int" transient="false" Loading Loading @@ -9102,17 +9256,6 @@ visibility="public" > </field> <field name="ic_menu_notifications" type="int" transient="false" volatile="false" value="17301667" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_preferences" type="int" transient="false" Loading @@ -9135,17 +9278,6 @@ visibility="public" > </field> <field name="ic_menu_refresh" type="int" transient="false" volatile="false" value="17301666" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_report_image" type="int" transient="false" Loading Loading @@ -54475,6 +54607,19 @@ <parameter name="cb" type="android.hardware.Camera.ErrorCallback"> </parameter> </method> <method name="setOneShotPreviewCallback" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="cb" type="android.hardware.Camera.PreviewCallback"> </parameter> </method> <method name="setParameters" return="void" abstract="false" Loading Loading @@ -56475,6 +56620,17 @@ visibility="public" > </method> <method name="getMaxWidth" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getWindow" return="android.app.Dialog" abstract="false" Loading Loading @@ -56558,6 +56714,23 @@ <parameter name="outInsets" type="android.inputmethodservice.InputMethodService.Insets"> </parameter> </method> <method name="onConfigureWindow" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="win" type="android.view.Window"> </parameter> <parameter name="isFullscreen" type="boolean"> </parameter> <parameter name="isCandidatesOnly" type="boolean"> </parameter> </method> <method name="onCreateBackgroundDrawable" return="android.graphics.drawable.Drawable" abstract="false" Loading Loading @@ -56760,6 +56933,17 @@ <parameter name="restarting" type="boolean"> </parameter> </method> <method name="onUnbindInput" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="onUpdateCursor" return="void" abstract="false" camera/libcameraservice/CameraService.cpp +42 −14 Original line number Diff line number Diff line Loading @@ -166,22 +166,26 @@ CameraService::Client::Client(const sp<CameraService>& cameraService, status_t CameraService::Client::checkPid() { // zero means the interface is not locked down if (mClientPid == 0) return NO_ERROR; return (int) mClientPid == IPCThreadState::self()->getCallingPid() ? NO_ERROR : -EBUSY; if (mClientPid == IPCThreadState::self()->getCallingPid()) return NO_ERROR; LOGW("Attempt to use locked camera from different process"); return -EBUSY; } status_t CameraService::Client::lock() { // lock camera to this client status_t result = checkPid(); if (result == NO_ERROR) mClientPid = IPCThreadState::self()->getCallingPid(); return result; // lock camera to this client if the the camera is unlocked if (mClientPid == 0) { mClientPid = IPCThreadState::self()->getCallingPid(); return NO_ERROR; } // returns NO_ERROR if the client already owns the camera, -EBUSY otherwise return checkPid(); } status_t CameraService::Client::unlock() { // allow anyone to use camera LOGV("unlock"); status_t result = checkPid(); if (result == NO_ERROR) mClientPid = 0; return result; Loading @@ -189,12 +193,29 @@ status_t CameraService::Client::unlock() status_t CameraService::Client::connect(const sp<ICameraClient>& client) { // remove old client LOGV("connect new client to existing camera"); // connect a new process to the camera LOGV("connect"); // hold a reference to the old client or we will deadlock if the client is // in the same process and we hold the lock when we remove the reference sp<ICameraClient> oldClient; { Mutex::Autolock _l(mLock); if (mClientPid != 0) { LOGW("Tried to connect to locked camera"); return -EBUSY; } oldClient = mCameraClient; // did the client actually change? if (client->asBinder() == mCameraClient->asBinder()) return NO_ERROR; LOGV("connect new process to existing camera client"); mCameraClient = client; mClientPid = IPCThreadState::self()->getCallingPid(); mFrameCallbackFlag = FRAME_CALLBACK_FLAG_NOOP; } return NO_ERROR; } Loading @@ -210,7 +231,7 @@ static void *unregister_surface(void *arg) CameraService::Client::~Client() { // spin down hardware // tear down client LOGD("Client E destructor"); if (mSurface != 0) { #if HAVE_ANDROID_OS Loading @@ -227,6 +248,8 @@ CameraService::Client::~Client() #endif } // make sure we tear down the hardware mClientPid = IPCThreadState::self()->getCallingPid(); disconnect(); LOGD("Client X destructor"); } Loading @@ -235,7 +258,12 @@ void CameraService::Client::disconnect() { LOGD("Client E disconnect"); Mutex::Autolock lock(mLock); if (mClientPid == 0) { LOGV("camera is unlocked, don't tear down hardware"); return; } if (checkPid() != NO_ERROR) return; mCameraService->removeClient(mCameraClient); if (mHardware != 0) { // Before destroying mHardware, we must make sure it's in the Loading core/java/android/app/SearchDialog.java +9 −0 Original line number Diff line number Diff line Loading @@ -1128,6 +1128,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS super(context, attrs, defStyle); } /** * We never allow ACTV to automatically replace the text, since we use "jamSuggestionQuery" * to do that. There's no point in letting ACTV do this here, because in the search UI, * as soon as we click a suggestion, we're going to start shutting things down. */ @Override public void replaceText(CharSequence text) { } /** * We always return true, so that the effective threshold is "zero". This allows us * to provide "null" suggestions such as "just show me some recent entries". Loading core/java/android/bluetooth/BluetoothA2dp.java +66 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ public class BluetoothA2dp { /** Playing implies connected */ public static final int STATE_PLAYING = 4; /** Default priority for a2dp devices that should allow incoming * connections */ public static final int PRIORITY_AUTO = 100; /** Default priority for a2dp devices that should not allow incoming * connections */ public static final int PRIORITY_OFF = 0; private final IBluetoothA2dp mService; private final Context mContext; Loading Loading @@ -158,6 +164,66 @@ public class BluetoothA2dp { } } /** * Set priority of a2dp sink. * Priority is a non-negative integer. By default paired sinks will have * a priority of PRIORITY_AUTO, and unpaired headset PRIORITY_NONE (0). * Sinks with priority greater than zero will accept incoming connections * (if no sink is currently connected). * Priority for unpaired sink must be PRIORITY_NONE. * @param address Paired sink * @param priority Integer priority, for example PRIORITY_AUTO or * PRIORITY_NONE * @return Result code, negative indicates an error */ public int setSinkPriority(String address, int priority) { try { return mService.setSinkPriority(address, priority); } catch (RemoteException e) { Log.w(TAG, "", e); return BluetoothError.ERROR_IPC; } } /** * Get priority of a2dp sink. * @param address Sink * @return non-negative priority, or negative error code on error. */ public int getSinkPriority(String address) { try { return mService.getSinkPriority(address); } catch (RemoteException e) { Log.w(TAG, "", e); return BluetoothError.ERROR_IPC; } } /** * Check class bits for possible A2DP Sink support. * This is a simple heuristic that tries to guess if a device with the * given class bits might be a A2DP Sink. It is not accurate for all * devices. It tries to err on the side of false positives. * @return True if this device might be a A2DP sink */ public static boolean doesClassMatchSink(int btClass) { if (BluetoothClass.Service.hasService(btClass, BluetoothClass.Service.RENDER)) { return true; } // By the A2DP spec, sinks must indicate the RENDER service. // However we found some that do not (Chordette). So lets also // match on some other class bits. switch (BluetoothClass.Device.getDevice(btClass)) { case BluetoothClass.Device.AUDIO_VIDEO_HIFI_AUDIO: case BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES: case BluetoothClass.Device.AUDIO_VIDEO_LOUDSPEAKER: case BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO: return true; default: return false; } } /** Helper for converting a state to a string. * For debug use only - strings are not internationalized. * @hide Loading Loading
Android.mk +6 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ LOCAL_SRC_FILES += \ core/java/android/bluetooth/IBluetoothDevice.aidl \ core/java/android/bluetooth/IBluetoothDeviceCallback.aidl \ core/java/android/bluetooth/IBluetoothHeadset.aidl \ core/java/android/bluetooth/IBluetoothHeadsetCallback.aidl \ core/java/android/content/ISyncAdapter.aidl \ core/java/android/content/ISyncContext.aidl \ core/java/android/content/pm/IPackageDataObserver.aidl \ Loading @@ -98,6 +97,7 @@ LOCAL_SRC_FILES += \ core/java/android/view/IWindowManager.aidl \ core/java/android/view/IWindowSession.aidl \ core/java/com/android/internal/app/IBatteryStats.aidl \ core/java/com/android/internal/gadget/IGadgetService.aidl \ core/java/com/android/internal/view/IInputContext.aidl \ core/java/com/android/internal/view/IInputContextCallback.aidl \ core/java/com/android/internal/view/IInputMethod.aidl \ Loading Loading @@ -165,6 +165,7 @@ aidl_files := \ frameworks/base/core/java/android/content/Intent.aidl \ frameworks/base/core/java/android/content/SyncStats.aidl \ frameworks/base/core/java/android/content/res/Configuration.aidl \ frameworks/base/core/java/android/gadget/GadgetInfo.aidl \ frameworks/base/core/java/android/net/Uri.aidl \ frameworks/base/core/java/android/os/Bundle.aidl \ frameworks/base/core/java/android/os/ParcelFileDescriptor.aidl \ Loading Loading @@ -421,4 +422,8 @@ include $(BUILD_JAVA_LIBRARY) # Include subdirectory makefiles # ============================================================ # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework # team really wants is to build the stuff defined by this makefile. ifeq (,$(ONE_SHOT_MAKEFILE)) include $(call first-makefiles-under,$(LOCAL_PATH)) endif
api/current.xml +232 −48 Original line number Diff line number Diff line Loading @@ -8563,22 +8563,198 @@ visibility="public" > </field> <field name="gallery_thumb" <field name="emo_im_angel" type="int" transient="false" volatile="false" value="17301532" value="17301668" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_cool" type="int" transient="false" volatile="false" value="17301669" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_crying" type="int" transient="false" volatile="false" value="17301670" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_embarrassed" type="int" transient="false" volatile="false" value="17301671" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_btn_search" <field name="emo_im_foot_in_mouth" type="int" transient="false" volatile="false" value="17301662" value="17301672" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_happy" type="int" transient="false" volatile="false" value="17301673" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_kissing" type="int" transient="false" volatile="false" value="17301674" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_laughing" type="int" transient="false" volatile="false" value="17301675" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_lips_are_sealed" type="int" transient="false" volatile="false" value="17301676" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_money_mouth" type="int" transient="false" volatile="false" value="17301677" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_sad" type="int" transient="false" volatile="false" value="17301678" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_surprised" type="int" transient="false" volatile="false" value="17301679" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_tongue_sticking_out" type="int" transient="false" volatile="false" value="17301680" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_undecided" type="int" transient="false" volatile="false" value="17301681" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_winking" type="int" transient="false" volatile="false" value="17301682" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_wtf" type="int" transient="false" volatile="false" value="17301683" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="emo_im_yelling" type="int" transient="false" volatile="false" value="17301684" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="gallery_thumb" type="int" transient="false" volatile="false" value="17301532" static="true" final="true" deprecated="not deprecated" Loading Loading @@ -8651,17 +8827,6 @@ visibility="public" > </field> <field name="ic_dialog_menu_generic" type="int" transient="false" volatile="false" value="17301664" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_input_add" type="int" transient="false" Loading Loading @@ -9014,17 +9179,6 @@ visibility="public" > </field> <field name="ic_menu_login" type="int" transient="false" volatile="false" value="17301665" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_manage" type="int" transient="false" Loading Loading @@ -9102,17 +9256,6 @@ visibility="public" > </field> <field name="ic_menu_notifications" type="int" transient="false" volatile="false" value="17301667" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_preferences" type="int" transient="false" Loading @@ -9135,17 +9278,6 @@ visibility="public" > </field> <field name="ic_menu_refresh" type="int" transient="false" volatile="false" value="17301666" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ic_menu_report_image" type="int" transient="false" Loading Loading @@ -54475,6 +54607,19 @@ <parameter name="cb" type="android.hardware.Camera.ErrorCallback"> </parameter> </method> <method name="setOneShotPreviewCallback" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="cb" type="android.hardware.Camera.PreviewCallback"> </parameter> </method> <method name="setParameters" return="void" abstract="false" Loading Loading @@ -56475,6 +56620,17 @@ visibility="public" > </method> <method name="getMaxWidth" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getWindow" return="android.app.Dialog" abstract="false" Loading Loading @@ -56558,6 +56714,23 @@ <parameter name="outInsets" type="android.inputmethodservice.InputMethodService.Insets"> </parameter> </method> <method name="onConfigureWindow" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="win" type="android.view.Window"> </parameter> <parameter name="isFullscreen" type="boolean"> </parameter> <parameter name="isCandidatesOnly" type="boolean"> </parameter> </method> <method name="onCreateBackgroundDrawable" return="android.graphics.drawable.Drawable" abstract="false" Loading Loading @@ -56760,6 +56933,17 @@ <parameter name="restarting" type="boolean"> </parameter> </method> <method name="onUnbindInput" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="onUpdateCursor" return="void" abstract="false"
camera/libcameraservice/CameraService.cpp +42 −14 Original line number Diff line number Diff line Loading @@ -166,22 +166,26 @@ CameraService::Client::Client(const sp<CameraService>& cameraService, status_t CameraService::Client::checkPid() { // zero means the interface is not locked down if (mClientPid == 0) return NO_ERROR; return (int) mClientPid == IPCThreadState::self()->getCallingPid() ? NO_ERROR : -EBUSY; if (mClientPid == IPCThreadState::self()->getCallingPid()) return NO_ERROR; LOGW("Attempt to use locked camera from different process"); return -EBUSY; } status_t CameraService::Client::lock() { // lock camera to this client status_t result = checkPid(); if (result == NO_ERROR) mClientPid = IPCThreadState::self()->getCallingPid(); return result; // lock camera to this client if the the camera is unlocked if (mClientPid == 0) { mClientPid = IPCThreadState::self()->getCallingPid(); return NO_ERROR; } // returns NO_ERROR if the client already owns the camera, -EBUSY otherwise return checkPid(); } status_t CameraService::Client::unlock() { // allow anyone to use camera LOGV("unlock"); status_t result = checkPid(); if (result == NO_ERROR) mClientPid = 0; return result; Loading @@ -189,12 +193,29 @@ status_t CameraService::Client::unlock() status_t CameraService::Client::connect(const sp<ICameraClient>& client) { // remove old client LOGV("connect new client to existing camera"); // connect a new process to the camera LOGV("connect"); // hold a reference to the old client or we will deadlock if the client is // in the same process and we hold the lock when we remove the reference sp<ICameraClient> oldClient; { Mutex::Autolock _l(mLock); if (mClientPid != 0) { LOGW("Tried to connect to locked camera"); return -EBUSY; } oldClient = mCameraClient; // did the client actually change? if (client->asBinder() == mCameraClient->asBinder()) return NO_ERROR; LOGV("connect new process to existing camera client"); mCameraClient = client; mClientPid = IPCThreadState::self()->getCallingPid(); mFrameCallbackFlag = FRAME_CALLBACK_FLAG_NOOP; } return NO_ERROR; } Loading @@ -210,7 +231,7 @@ static void *unregister_surface(void *arg) CameraService::Client::~Client() { // spin down hardware // tear down client LOGD("Client E destructor"); if (mSurface != 0) { #if HAVE_ANDROID_OS Loading @@ -227,6 +248,8 @@ CameraService::Client::~Client() #endif } // make sure we tear down the hardware mClientPid = IPCThreadState::self()->getCallingPid(); disconnect(); LOGD("Client X destructor"); } Loading @@ -235,7 +258,12 @@ void CameraService::Client::disconnect() { LOGD("Client E disconnect"); Mutex::Autolock lock(mLock); if (mClientPid == 0) { LOGV("camera is unlocked, don't tear down hardware"); return; } if (checkPid() != NO_ERROR) return; mCameraService->removeClient(mCameraClient); if (mHardware != 0) { // Before destroying mHardware, we must make sure it's in the Loading
core/java/android/app/SearchDialog.java +9 −0 Original line number Diff line number Diff line Loading @@ -1128,6 +1128,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS super(context, attrs, defStyle); } /** * We never allow ACTV to automatically replace the text, since we use "jamSuggestionQuery" * to do that. There's no point in letting ACTV do this here, because in the search UI, * as soon as we click a suggestion, we're going to start shutting things down. */ @Override public void replaceText(CharSequence text) { } /** * We always return true, so that the effective threshold is "zero". This allows us * to provide "null" suggestions such as "just show me some recent entries". Loading
core/java/android/bluetooth/BluetoothA2dp.java +66 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ public class BluetoothA2dp { /** Playing implies connected */ public static final int STATE_PLAYING = 4; /** Default priority for a2dp devices that should allow incoming * connections */ public static final int PRIORITY_AUTO = 100; /** Default priority for a2dp devices that should not allow incoming * connections */ public static final int PRIORITY_OFF = 0; private final IBluetoothA2dp mService; private final Context mContext; Loading Loading @@ -158,6 +164,66 @@ public class BluetoothA2dp { } } /** * Set priority of a2dp sink. * Priority is a non-negative integer. By default paired sinks will have * a priority of PRIORITY_AUTO, and unpaired headset PRIORITY_NONE (0). * Sinks with priority greater than zero will accept incoming connections * (if no sink is currently connected). * Priority for unpaired sink must be PRIORITY_NONE. * @param address Paired sink * @param priority Integer priority, for example PRIORITY_AUTO or * PRIORITY_NONE * @return Result code, negative indicates an error */ public int setSinkPriority(String address, int priority) { try { return mService.setSinkPriority(address, priority); } catch (RemoteException e) { Log.w(TAG, "", e); return BluetoothError.ERROR_IPC; } } /** * Get priority of a2dp sink. * @param address Sink * @return non-negative priority, or negative error code on error. */ public int getSinkPriority(String address) { try { return mService.getSinkPriority(address); } catch (RemoteException e) { Log.w(TAG, "", e); return BluetoothError.ERROR_IPC; } } /** * Check class bits for possible A2DP Sink support. * This is a simple heuristic that tries to guess if a device with the * given class bits might be a A2DP Sink. It is not accurate for all * devices. It tries to err on the side of false positives. * @return True if this device might be a A2DP sink */ public static boolean doesClassMatchSink(int btClass) { if (BluetoothClass.Service.hasService(btClass, BluetoothClass.Service.RENDER)) { return true; } // By the A2DP spec, sinks must indicate the RENDER service. // However we found some that do not (Chordette). So lets also // match on some other class bits. switch (BluetoothClass.Device.getDevice(btClass)) { case BluetoothClass.Device.AUDIO_VIDEO_HIFI_AUDIO: case BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES: case BluetoothClass.Device.AUDIO_VIDEO_LOUDSPEAKER: case BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO: return true; default: return false; } } /** Helper for converting a state to a string. * For debug use only - strings are not internationalized. * @hide Loading