diff options
29 files changed, 2602 insertions, 543 deletions
diff --git a/api/current.xml b/api/current.xml index b28780c84337..595a9f042fd5 100644 --- a/api/current.xml +++ b/api/current.xml @@ -71778,6 +71778,721 @@ visibility="public" > </field> +<field name="TONE_CDMA_ABBR_ALERT" + type="int" + transient="false" + volatile="false" + value="97" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ABBR_INTERCEPT" + type="int" + transient="false" + volatile="false" + value="37" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ABBR_REORDER" + type="int" + transient="false" + volatile="false" + value="39" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ALERT_AUTOREDIAL_LITE" + type="int" + transient="false" + volatile="false" + value="87" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ALERT_CALL_GUARD" + type="int" + transient="false" + volatile="false" + value="93" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ALERT_INCALL_LITE" + type="int" + transient="false" + volatile="false" + value="91" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ALERT_NETWORK_LITE" + type="int" + transient="false" + volatile="false" + value="86" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ANSWER" + type="int" + transient="false" + volatile="false" + value="42" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALLDROP_LITE" + type="int" + transient="false" + volatile="false" + value="95" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP" + type="int" + transient="false" + volatile="false" + value="46" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL" + type="int" + transient="false" + volatile="false" + value="45" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_PAT3" + type="int" + transient="false" + volatile="false" + value="48" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_PAT5" + type="int" + transient="false" + volatile="false" + value="50" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_PAT6" + type="int" + transient="false" + volatile="false" + value="51" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_PAT7" + type="int" + transient="false" + volatile="false" + value="52" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING" + type="int" + transient="false" + volatile="false" + value="49" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI" + type="int" + transient="false" + volatile="false" + value="47" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_CONFIRM" + type="int" + transient="false" + volatile="false" + value="41" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_DIAL_TONE_LITE" + type="int" + transient="false" + volatile="false" + value="34" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_EMERGENCY_RINGBACK" + type="int" + transient="false" + volatile="false" + value="92" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_L" + type="int" + transient="false" + volatile="false" + value="53" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_PBX_L" + type="int" + transient="false" + volatile="false" + value="71" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_PBX_SLS" + type="int" + transient="false" + volatile="false" + value="80" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_PBX_SS" + type="int" + transient="false" + volatile="false" + value="74" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_PBX_SSL" + type="int" + transient="false" + volatile="false" + value="77" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_PBX_S_X4" + type="int" + transient="false" + volatile="false" + value="83" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_SLS" + type="int" + transient="false" + volatile="false" + value="65" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_SS" + type="int" + transient="false" + volatile="false" + value="56" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_SSL" + type="int" + transient="false" + volatile="false" + value="59" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_SS_2" + type="int" + transient="false" + volatile="false" + value="62" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_HIGH_S_X4" + type="int" + transient="false" + volatile="false" + value="68" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_INTERCEPT" + type="int" + transient="false" + volatile="false" + value="36" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_KEYPAD_VOLUME_KEY_LITE" + type="int" + transient="false" + volatile="false" + value="89" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_L" + type="int" + transient="false" + volatile="false" + value="55" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_PBX_L" + type="int" + transient="false" + volatile="false" + value="73" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_PBX_SLS" + type="int" + transient="false" + volatile="false" + value="82" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_PBX_SS" + type="int" + transient="false" + volatile="false" + value="76" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_PBX_SSL" + type="int" + transient="false" + volatile="false" + value="79" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_PBX_S_X4" + type="int" + transient="false" + volatile="false" + value="85" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_SLS" + type="int" + transient="false" + volatile="false" + value="67" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_SS" + type="int" + transient="false" + volatile="false" + value="58" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_SSL" + type="int" + transient="false" + volatile="false" + value="61" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_SS_2" + type="int" + transient="false" + volatile="false" + value="64" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_LOW_S_X4" + type="int" + transient="false" + volatile="false" + value="70" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_L" + type="int" + transient="false" + volatile="false" + value="54" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_PBX_L" + type="int" + transient="false" + volatile="false" + value="72" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_PBX_SLS" + type="int" + transient="false" + volatile="false" + value="81" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_PBX_SS" + type="int" + transient="false" + volatile="false" + value="75" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_PBX_SSL" + type="int" + transient="false" + volatile="false" + value="78" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_PBX_S_X4" + type="int" + transient="false" + volatile="false" + value="84" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_SLS" + type="int" + transient="false" + volatile="false" + value="66" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_SS" + type="int" + transient="false" + volatile="false" + value="57" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_SSL" + type="int" + transient="false" + volatile="false" + value="60" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_SS_2" + type="int" + transient="false" + volatile="false" + value="63" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_MED_S_X4" + type="int" + transient="false" + volatile="false" + value="69" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_NETWORK_BUSY" + type="int" + transient="false" + volatile="false" + value="40" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_NETWORK_BUSY_ONE_SHOT" + type="int" + transient="false" + volatile="false" + value="96" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_NETWORK_CALLWAITING" + type="int" + transient="false" + volatile="false" + value="43" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_NETWORK_USA_RINGBACK" + type="int" + transient="false" + volatile="false" + value="35" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_ONE_MIN_BEEP" + type="int" + transient="false" + volatile="false" + value="88" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_PIP" + type="int" + transient="false" + volatile="false" + value="44" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_PRESSHOLDKEY_LITE" + type="int" + transient="false" + volatile="false" + value="90" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_REORDER" + type="int" + transient="false" + volatile="false" + value="38" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_SIGNAL_OFF" + type="int" + transient="false" + volatile="false" + value="98" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TONE_CDMA_SOFT_ERROR_LITE" + type="int" + transient="false" + volatile="false" + value="94" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="TONE_DTMF_0" type="int" transient="false" diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 5d5a277d1cc1..6c7bcda77705 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -88,13 +88,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS private static final String INSTANCE_KEY_COMPONENT = "comp"; private static final String INSTANCE_KEY_APPDATA = "data"; private static final String INSTANCE_KEY_GLOBALSEARCH = "glob"; - private static final String INSTANCE_KEY_DISPLAY_QUERY = "dQry"; - private static final String INSTANCE_KEY_DISPLAY_SEL_START = "sel1"; - private static final String INSTANCE_KEY_DISPLAY_SEL_END = "sel2"; - private static final String INSTANCE_KEY_SELECTED_ELEMENT = "slEl"; - private static final int INSTANCE_SELECTED_BUTTON = -2; - private static final int INSTANCE_SELECTED_QUERY = -1; - + private static final String INSTANCE_KEY_STORED_COMPONENT = "sComp"; + private static final String INSTANCE_KEY_STORED_APPDATA = "sData"; + private static final String INSTANCE_KEY_PREVIOUS_COMPONENTS = "sPrev"; + private static final String INSTANCE_KEY_USER_QUERY = "uQry"; + private static final int SEARCH_PLATE_LEFT_PADDING_GLOBAL = 12; private static final int SEARCH_PLATE_LEFT_PADDING_NON_GLOBAL = 7; @@ -450,8 +448,6 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS /** * Save the minimal set of data necessary to recreate the search * - * TODO: go through this and make sure that it saves everything that is needed - * * @return A bundle with the state of the dialog. */ @Override @@ -462,20 +458,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS bundle.putParcelable(INSTANCE_KEY_COMPONENT, mLaunchComponent); bundle.putBundle(INSTANCE_KEY_APPDATA, mAppSearchData); bundle.putBoolean(INSTANCE_KEY_GLOBALSEARCH, mGlobalSearchMode); - - // UI state - bundle.putString(INSTANCE_KEY_DISPLAY_QUERY, mSearchAutoComplete.getText().toString()); - bundle.putInt(INSTANCE_KEY_DISPLAY_SEL_START, mSearchAutoComplete.getSelectionStart()); - bundle.putInt(INSTANCE_KEY_DISPLAY_SEL_END, mSearchAutoComplete.getSelectionEnd()); - - int selectedElement = INSTANCE_SELECTED_QUERY; - if (mGoButton.isFocused()) { - selectedElement = INSTANCE_SELECTED_BUTTON; - } else if (mSearchAutoComplete.isPopupShowing()) { - selectedElement = 0; // TODO mSearchTextField.getListSelection() // 0..n - } - bundle.putInt(INSTANCE_KEY_SELECTED_ELEMENT, selectedElement); - + bundle.putParcelable(INSTANCE_KEY_STORED_COMPONENT, mStoredComponentName); + bundle.putBundle(INSTANCE_KEY_STORED_APPDATA, mStoredAppSearchData); + bundle.putParcelableArrayList(INSTANCE_KEY_PREVIOUS_COMPONENTS, mPreviousComponents); + bundle.putString(INSTANCE_KEY_USER_QUERY, mUserQuery); + return bundle; } @@ -489,45 +476,27 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS */ @Override public void onRestoreInstanceState(Bundle savedInstanceState) { - // Get the launch info ComponentName launchComponent = savedInstanceState.getParcelable(INSTANCE_KEY_COMPONENT); Bundle appSearchData = savedInstanceState.getBundle(INSTANCE_KEY_APPDATA); boolean globalSearch = savedInstanceState.getBoolean(INSTANCE_KEY_GLOBALSEARCH); - - // get the UI state - String displayQuery = savedInstanceState.getString(INSTANCE_KEY_DISPLAY_QUERY); - int querySelStart = savedInstanceState.getInt(INSTANCE_KEY_DISPLAY_SEL_START, -1); - int querySelEnd = savedInstanceState.getInt(INSTANCE_KEY_DISPLAY_SEL_END, -1); - int selectedElement = savedInstanceState.getInt(INSTANCE_KEY_SELECTED_ELEMENT); - - // show the dialog. skip any show/hide animation, we want to go fast. - // send the text that actually generates the suggestions here; we'll replace the display - // text as necessary in a moment. - if (!show(displayQuery, false, launchComponent, appSearchData, globalSearch)) { + ComponentName storedComponentName = + savedInstanceState.getParcelable(INSTANCE_KEY_STORED_COMPONENT); + Bundle storedAppSearchData = + savedInstanceState.getBundle(INSTANCE_KEY_STORED_APPDATA); + ArrayList<ComponentName> previousComponents = + savedInstanceState.getParcelableArrayList(INSTANCE_KEY_PREVIOUS_COMPONENTS); + String userQuery = savedInstanceState.getString(INSTANCE_KEY_USER_QUERY); + + // Set stored state + mStoredComponentName = storedComponentName; + mStoredAppSearchData = storedAppSearchData; + mPreviousComponents = previousComponents; + + // show the dialog. + if (!doShow(userQuery, false, launchComponent, appSearchData, globalSearch)) { // for some reason, we couldn't re-instantiate return; } - - mSearchAutoComplete.setText(displayQuery); - - // clean up the selection state - switch (selectedElement) { - case INSTANCE_SELECTED_BUTTON: - mGoButton.setEnabled(true); - mGoButton.setFocusable(true); - mGoButton.requestFocus(); - break; - case INSTANCE_SELECTED_QUERY: - if (querySelStart >= 0 && querySelEnd >= 0) { - mSearchAutoComplete.requestFocus(); - mSearchAutoComplete.setSelection(querySelStart, querySelEnd); - } - break; - default: - // TODO: defer selecting a list element until suggestion list appears -// mSearchAutoComplete.setListSelection(selectedElement) - break; - } } /** diff --git a/core/java/android/server/search/Searchables.java b/core/java/android/server/search/Searchables.java index a27667bcc246..c7cc8edf108d 100644 --- a/core/java/android/server/search/Searchables.java +++ b/core/java/android/server/search/Searchables.java @@ -57,6 +57,11 @@ public class Searchables { private SearchableInfo mDefaultSearchable = null; private SearchableInfo mDefaultSearchableForWebSearch = null; + public static String GOOGLE_SEARCH_COMPONENT_NAME = + "com.android.googlesearch/.GoogleSearch"; + public static String ENHANCED_GOOGLE_SEARCH_COMPONENT_NAME = + "com.google.android.providers.enhancedgooglesearch/.Launcher"; + /** * * @param context Context to use for looking up activities etc. @@ -341,6 +346,18 @@ public class Searchables { return component; } } + } else { + // If the current preferred activity is GoogleSearch, and we detect + // EnhancedGoogleSearch installed as well, set the latter as preferred since that + // is a superset and provides more functionality. + ComponentName cn = new ComponentName(ri.activityInfo.packageName, ri.activityInfo.name); + if (cn.flattenToShortString().equals(GOOGLE_SEARCH_COMPONENT_NAME)) { + ComponentName enhancedGoogleSearch = ComponentName.unflattenFromString( + ENHANCED_GOOGLE_SEARCH_COMPONENT_NAME); + if (setPreferredActivity(enhancedGoogleSearch, Intent.ACTION_WEB_SEARCH)) { + return enhancedGoogleSearch; + } + } } if (ri == null) return null; diff --git a/core/java/android/speech/tts/ITts.aidl b/core/java/android/speech/tts/ITts.aidl index 02211fd4ef88..75c3b30d5ab4 100755 --- a/core/java/android/speech/tts/ITts.aidl +++ b/core/java/android/speech/tts/ITts.aidl @@ -29,6 +29,8 @@ import android.content.Intent; interface ITts {
void setSpeechRate(in int speechRate);
+ void setPitch(in int pitch);
+
void speak(in String text, in int queueMode, in String[] params);
boolean isSpeaking();
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 9fc143d6c19e..c064284942d4 100755 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java @@ -450,7 +450,6 @@ public class TextToSpeech { } - /** * Sets the speech rate for the TTS engine. * @@ -483,6 +482,37 @@ public class TextToSpeech { /** + * Sets the speech pitch for the TTS engine. + * + * Note that the pitch is not universally supported by all engines and + * will be treated as a hint. The TTS library will try to use the specified + * pitch, but there is no guarantee. + * This has no effect on any pre-recorded speech. + * + * @param pitch + * The pitch for the TTS engine. 1 is the normal pitch, + * lower values lower the tone of the synthesized voice, + * greater values increase it. + */ + public void setPitch(float pitch) { + synchronized (mStartLock) { + if (!mStarted) { + return; + } + try { + if (pitch > 0) { + mITts.setPitch((int)(pitch*100)); + } + } catch (RemoteException e) { + // TTS died; restart it. + mStarted = false; + initTts(); + } + } + } + + + /** * Sets the language for the TTS engine. * * Note that the language is not universally supported by all engines and diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ec8fd96a92f0..f17f0e451d6d 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -1934,11 +1934,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility viewFlagValues &= ~SOUND_EFFECTS_ENABLED; viewFlagMasks |= SOUND_EFFECTS_ENABLED; } + break; case com.android.internal.R.styleable.View_hapticFeedbackEnabled: if (!a.getBoolean(attr, true)) { viewFlagValues &= ~HAPTIC_FEEDBACK_ENABLED; viewFlagMasks |= HAPTIC_FEEDBACK_ENABLED; } + break; case R.styleable.View_scrollbars: final int scrollbars = a.getInt(attr, SCROLLBARS_NONE); if (scrollbars != SCROLLBARS_NONE) { diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index 84cf2c8b32c2..68dafa134d66 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -20,8 +20,15 @@ import com.android.internal.R; import android.content.Context; import android.content.res.TypedArray; +import android.content.res.Resources; import android.graphics.Rect; import android.util.AttributeSet; +import android.util.SparseArray; +import android.util.Poolable; +import android.util.Pool; +import android.util.Pools; +import android.util.PoolableManager; +import static android.util.Log.d; import android.view.Gravity; import android.view.View; import android.view.ViewDebug; @@ -32,6 +39,9 @@ import android.widget.RemoteViews.RemoteView; import java.util.Comparator; import java.util.SortedSet; import java.util.TreeSet; +import java.util.LinkedList; +import java.util.ArrayList; +import java.util.HashSet; /** * A Layout where the positions of the children can be described in relation to each other or to the @@ -55,6 +65,10 @@ import java.util.TreeSet; */ @RemoteView public class RelativeLayout extends ViewGroup { + private static final String LOG_TAG = "RelativeLayout"; + + private static final boolean DEBUG_GRAPH = false; + public static final int TRUE = -1; /** @@ -142,7 +156,12 @@ public class RelativeLayout extends ViewGroup { private final Rect mSelfBounds = new Rect(); private int mIgnoreGravity; - private static SortedSet<View> mTopToBottomLeftToRightSet = null; + private SortedSet<View> mTopToBottomLeftToRightSet = null; + + private boolean mDirtyHierarchy; + private View[] mSortedHorizontalChildren = new View[0]; + private View[] mSortedVerticalChildren = new View[0]; + private final DependencyGraph mGraph = new DependencyGraph(); public RelativeLayout(Context context) { super(context); @@ -232,7 +251,43 @@ public class RelativeLayout extends ViewGroup { } @Override + public void requestLayout() { + super.requestLayout(); + mDirtyHierarchy = true; + } + + private void sortChildren() { + int count = getChildCount(); + if (mSortedVerticalChildren.length != count) mSortedVerticalChildren = new View[count]; + if (mSortedHorizontalChildren.length != count) mSortedHorizontalChildren = new View[count]; + + final DependencyGraph graph = mGraph; + graph.clear(); + + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + graph.add(child); + } + + if (DEBUG_GRAPH) { + d(LOG_TAG, "=== Sorted vertical children"); + graph.log(getResources(), ABOVE, BELOW, ALIGN_BASELINE, ALIGN_TOP, ALIGN_BOTTOM); + d(LOG_TAG, "=== Sorted horizontal children"); + graph.log(getResources(), LEFT_OF, RIGHT_OF, ALIGN_LEFT, ALIGN_RIGHT); + } + + graph.getSortedViews(mSortedVerticalChildren, ABOVE, BELOW, ALIGN_BASELINE, + ALIGN_TOP, ALIGN_BOTTOM); + graph.getSortedViews(mSortedHorizontalChildren, LEFT_OF, RIGHT_OF, ALIGN_LEFT, ALIGN_RIGHT); + } + + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (mDirtyHierarchy) { + mDirtyHierarchy = false; + sortChildren(); + } + int myWidth = -1; int myHeight = -1; @@ -261,7 +316,6 @@ public class RelativeLayout extends ViewGroup { height = myHeight; } - int len = this.getChildCount(); mHasBaselineAlignedChild = false; View ignore = null; @@ -279,13 +333,28 @@ public class RelativeLayout extends ViewGroup { ignore = findViewById(mIgnoreGravity); } - for (int i = 0; i < len; i++) { - View child = getChildAt(i); + + View[] views = mSortedVerticalChildren; + int count = views.length; + for (int i = 0; i < count; i++) { + View child = views[i]; + if (child.getVisibility() != GONE) { + LayoutParams params = (LayoutParams) child.getLayoutParams(); + applyVerticalSizeRules(params, myHeight); + measureChildVertical(child, params, myHeight); + positionChildVertical(child, params, myHeight); + } + } + + views = mSortedHorizontalChildren; + count = views.length; + for (int i = 0; i < count; i++) { + View child = views[i]; if (child.getVisibility() != GONE) { LayoutParams params = (LayoutParams) child.getLayoutParams(); - applySizeRules(params, myWidth, myHeight); + applyHorizontalSizeRules(params, myWidth); measureChild(child, params, myWidth, myHeight); - positionChild(child, params, myWidth, myHeight); + positionChildHorizontal(child, params, myWidth); if (widthMode != MeasureSpec.EXACTLY) { width = Math.max(width, params.mRight); @@ -307,15 +376,15 @@ public class RelativeLayout extends ViewGroup { } if (mHasBaselineAlignedChild) { - for (int i = 0; i < len; i++) { + for (int i = 0; i < count; i++) { View child = getChildAt(i); if (child.getVisibility() != GONE) { LayoutParams params = (LayoutParams) child.getLayoutParams(); alignBaseline(child, params); if (child != ignore || verticalGravity) { - left = Math.min(left, params.mLeft - params.leftMargin); - top = Math.min(top, params.mTop - params.topMargin); + left = Math.min(left, params.mLeft - params.leftMargin); + top = Math.min(top, params.mTop - params.topMargin); } if (child != ignore || horizontalGravity) { @@ -362,7 +431,7 @@ public class RelativeLayout extends ViewGroup { final int horizontalOffset = contentBounds.left - left; final int verticalOffset = contentBounds.top - top; if (horizontalOffset != 0 || verticalOffset != 0) { - for (int i = 0; i < len; i++) { + for (int i = 0; i < count; i++) { View child = getChildAt(i); if (child.getVisibility() != GONE && child != ignore) { LayoutParams params = (LayoutParams) child.getLayoutParams(); @@ -416,9 +485,7 @@ public class RelativeLayout extends ViewGroup { * @param myWidth Width of the the RelativeLayout * @param myHeight Height of the RelativeLayout */ - private void measureChild(View child, LayoutParams params, int myWidth, - int myHeight) { - + private void measureChild(View child, LayoutParams params, int myWidth, int myHeight) { int childWidthMeasureSpec = getChildMeasureSpec(params.mLeft, params.mRight, params.width, params.leftMargin, params.rightMargin, @@ -432,6 +499,16 @@ public class RelativeLayout extends ViewGroup { child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } + private void measureChildVertical(View child, LayoutParams params, int myHeight) { + int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); + int childHeightMeasureSpec = getChildMeasureSpec(params.mTop, + params.mBottom, params.height, + params.topMargin, params.bottomMargin, + mPaddingTop, mPaddingBottom, + myHeight); + child.measure(childWidthMeasureSpec, childHeightMeasureSpec); + } + /** * Get a measure spec that accounts for all of the constraints on this view. * This includes size contstraints imposed by the RelativeLayout as well as @@ -511,19 +588,7 @@ public class RelativeLayout extends ViewGroup { return MeasureSpec.makeMeasureSpec(childSpecSize, childSpecMode); } - /** - * After the child has been measured, assign it a position. Some views may - * already have final values for l,t,r,b. Others may have one or both edges - * unfixed (i.e. set to -1) in each dimension. These will get positioned - * based on which edge is fixed, the view's desired dimension, and whether - * or not it is centered. - * - * @param child Child to position - * @param params LayoutParams associated with child - * @param myWidth Width of the the RelativeLayout - * @param myHeight Height of the RelativeLayout - */ - private void positionChild(View child, LayoutParams params, int myWidth, int myHeight) { + private void positionChildHorizontal(View child, LayoutParams params, int myWidth) { int[] rules = params.getRules(); if (params.mLeft < 0 && params.mRight >= 0) { @@ -541,6 +606,10 @@ public class RelativeLayout extends ViewGroup { params.mRight = params.mLeft + child.getMeasuredWidth(); } } + } + + private void positionChildVertical(View child, LayoutParams params, int myHeight) { + int[] rules = params.getRules(); if (params.mTop < 0 && params.mBottom >= 0) { // Bottom is fixed, but top varies @@ -559,17 +628,7 @@ public class RelativeLayout extends ViewGroup { } } - /** - * Set l,t,r,b values in the LayoutParams for one view based on its layout rules. - * Big assumption #1: All antecedents of this view have been sized & positioned - * Big assumption #2: The dimensions of the parent view (the RelativeLayout) - * are already known if they are needed. - * - * @param childParams LayoutParams for the view being positioned - * @param myWidth Width of the the RelativeLayout - * @param myHeight Height of the RelativeLayout - */ - private void applySizeRules(LayoutParams childParams, int myWidth, int myHeight) { + private void applyHorizontalSizeRules(LayoutParams childParams, int myWidth) { int[] rules = childParams.getRules(); RelativeLayout.LayoutParams anchorParams; @@ -629,6 +688,11 @@ public class RelativeLayout extends ViewGroup { // FIXME uh oh... } } + } + + private void applyVerticalSizeRules(LayoutParams childParams, int myHeight) { + int[] rules = childParams.getRules(); + RelativeLayout.LayoutParams anchorParams; childParams.mTop = -1; childParams.mBottom = -1; @@ -1033,4 +1097,288 @@ public class RelativeLayout extends ViewGroup { return mRules; } } + + private static class DependencyGraph { + /** + * List of views with no id. These views cannot be dependencies of + * other views, so treat the apart for faster processing. + */ + private ArrayList<View> mNakedRoots = new ArrayList<View>(); + + /** + * List of nodes in the graph. Each node is identified by its + * view id (see View#getId()). + */ + private SparseArray<Node> mNodes = new SparseArray<Node>(); + + /** + * Temporary data structure used to build the list of roots + * for this graph. + */ + private LinkedList<Node> mRoots = new LinkedList<Node>(); + + /** + * Clears the graph. + */ + void clear() { + final SparseArray<Node> nodes = mNodes; + final int count = nodes.size(); + + for (int i = 0; i < count; i++) { + nodes.valueAt(i).release(); + } + nodes.clear(); + + mNakedRoots.clear(); + mRoots.clear(); + } + + /** + * Adds a view to the graph. + * + * @param view The view to be added as a node to the graph. + */ + void add(View view) { + final int id = view.getId(); + + if (id != View.NO_ID) { + mNodes.put(id, Node.acquire(view)); + } else { + mNakedRoots.add(view); + } + } + + /** + * Builds a sorted list of views. The sorting order depends on the dependencies + * between the view. For instance, if view C needs view A to be processed first + * and view A needs view B to be processed first, the dependency graph + * is: B -> A -> C. The sorted array will contain views B, A and C in this order. + * + * @param sorted The sorted list of views. The length of this array must + * be equal to getChildCount(). + * @param rules The list of rules to take into account. + */ + void getSortedViews(View[] sorted, int... rules) { + final LinkedList<Node> roots = findRoots(rules); + int index = 0; + + final ArrayList<View> nakedRoots = mNakedRoots; + final int count = nakedRoots.size(); + for ( ; index < count; index++) { + sorted[index] = nakedRoots.get(index); + } + + while (roots.size() > 0) { + final Node node = roots.removeFirst(); + final View view = node.view; + final int key = view.getId(); + + sorted[index++] = view; + + final HashSet<Node> dependents = node.dependents; + for (Node dependent : dependents) { + final SparseArray<Node> dependencies = dependent.dependencies; + + dependencies.remove(key); + if (dependencies.size() == 0) { + roots.add(dependent); + } + } + } + + if (index < sorted.length) { + throw new IllegalStateException("Circular dependencies cannot exist" + + " in RelativeLayout"); + } + } + + /** + * Finds the roots of the graph. A root is a node with no dependency and + * with [0..n] dependents. + * + * @param rulesFilter The list of rules to consider when building the + * dependencies + * + * @return A list of node, each being a root of the graph + */ + private LinkedList<Node> findRoots(int[] rulesFilter) { + final SparseArray<Node> nodes = mNodes; + final int count = nodes.size(); + + // Find roots can be invoked several times, so make sure to clear + // all dependents and dependencies before running the algorithm + for (int i = 0; i < count; i++) { + final Node node = nodes.valueAt(i); + node.dependents.clear(); + node.dependencies.clear(); + } + + // Builds up the dependents and dependencies for each node of the graph + for (int i = 0; i < count; i++) { + final Node node = nodes.valueAt(i); + + final LayoutParams layoutParams = (LayoutParams) node.view.getLayoutParams(); + final int[] rules = layoutParams.mRules; + final int rulesCount = rulesFilter.length; + + // Look only the the rules passed in parameter, this way we build only the + // dependencies for a specific set of rules + for (int j = 0; j < rulesCount; j++) { + final int rule = rules[rulesFilter[j]]; + if (rule > 0) { + // The node this node depends on + final Node dependency = nodes.get(rule); + if (dependency == node) { + throw new IllegalStateException("A view cannot have a dependency" + + " on itself"); + } + // Add the current node as a dependent + dependency.dependents.add(node); + // Add a dependency to the current node + node.dependencies.put(rule, dependency); + } + } + } + + final LinkedList<Node> roots = mRoots; + roots.clear(); + + // Finds all the roots in the graph: all nodes with no dependencies + for (int i = 0; i < count; i++) { + final Node node = nodes.valueAt(i); + if (node.dependencies.size() == 0) roots.add(node); + } + + return roots; + } + + /** + * Prints the dependency graph for the specified rules. + * + * @param resources The context's resources to print the ids. + * @param rules The list of rules to take into account. + */ + void log(Resources resources, int... rules) { + for (View view : mNakedRoots) { + printViewId(resources, view); + } + + final LinkedList<Node> roots = findRoots(rules); + for (Node node : roots) { + printNode(resources, node); + } + } + + private static void printViewId(Resources resources, View view) { + if (view.getId() != View.NO_ID) { + d(LOG_TAG, resources.getResourceEntryName(view.getId())); + } else { + d(LOG_TAG, "NO_ID"); + } + } + + private static void appendViewId(Resources resources, Node node, StringBuilder buffer) { + if (node.view.getId() != View.NO_ID) { + buffer.append(resources.getResourceEntryName(node.view.getId())); + } else { + buffer.append("NO_ID"); + } + } + + private static void printNode(Resources resources, Node node) { + if (node.dependents.size() == 0) { + printViewId(resources, node.view); + } else { + for (Node dependent : node.dependents) { + StringBuilder buffer = new StringBuilder(); + appendViewId(resources, node, buffer); + printdependents(resources, dependent, buffer); + } + } + } + + private static void printdependents(Resources resources, Node node, StringBuilder buffer) { + buffer.append(" -> "); + appendViewId(resources, node, buffer); + + if (node.dependents.size() == 0) { + d(LOG_TAG, buffer.toString()); + } else { + for (Node dependent : node.dependents) { + StringBuilder subBuffer = new StringBuilder(buffer); + printdependents(resources, dependent, subBuffer); + } + } + } + + /** + * A node in the dependency graph. A node is a view, its list of dependencies + * and its list of dependents. + * + * A node with no dependent is considered a root of the graph. + */ + static class Node implements Poolable<Node> { + /** + * The view representing this node in the layout. + */ + View view; + + /** + * The list of dependents for this node; a dependent is a node + * that needs this node to be processed first. + */ + final HashSet<Node> dependents = new HashSet<Node>(); + + /** + * The list of dependencies for this node. + */ + final SparseArray<Node> dependencies = new SparseArray<Node>(); + + /* + * START POOL IMPLEMENTATION + */ + private static final int POOL_LIMIT = 12; + private static final Pool<Node> sPool = Pools.synchronizedPool( + Pools.finitePool(new PoolableManager<Node>() { + public Node newInstance() { + return new Node(); + } + + public void onAcquired(Node element) { + } + + public void onReleased(Node element) { + } + }, POOL_LIMIT) + ); + + private Node mNext; + + public void setNextPoolable(Node element) { + mNext = element; + } + + public Node getNextPoolable() { + return mNext; + } + + static Node acquire(View view) { + final Node node = sPool.acquire(); + node.view = view; + + return node; + } + + void release() { + view = null; + dependents.clear(); + dependencies.clear(); + + sPool.release(this); + } + /* + * END POOL IMPLEMENTATION + */ + } + } } diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index 16a3bad17bf1..58a3a83f8ebc 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -984,11 +984,11 @@ public final class BatteryStatsImpl extends BatteryStats { } public void noteStartGps(int uid) { - mUidStats.get(uid).noteStartGps(); + getUidStatsLocked(uid).noteStartGps(); } public void noteStopGps(int uid) { - mUidStats.get(uid).noteStopGps(); + getUidStatsLocked(uid).noteStopGps(); } public void noteScreenOnLocked() { @@ -1032,10 +1032,7 @@ public final class BatteryStatsImpl extends BatteryStats { } public void noteUserActivityLocked(int uid, int event) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteUserActivityLocked(event); - } + getUidStatsLocked(uid).noteUserActivityLocked(event); } public void notePhoneOnLocked() { @@ -1115,16 +1112,10 @@ public final class BatteryStatsImpl extends BatteryStats { } if (mWifiOnUid != uid) { if (mWifiOnUid >= 0) { - Uid u = mUidStats.get(mWifiOnUid); - if (u != null) { - u.noteWifiTurnedOffLocked(); - } + getUidStatsLocked(mWifiOnUid).noteWifiTurnedOffLocked(); } mWifiOnUid = uid; - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteWifiTurnedOnLocked(); - } + getUidStatsLocked(uid).noteWifiTurnedOnLocked(); } } @@ -1134,10 +1125,7 @@ public final class BatteryStatsImpl extends BatteryStats { mWifiOnTimer.stopRunningLocked(this); } if (mWifiOnUid >= 0) { - Uid u = mUidStats.get(mWifiOnUid); - if (u != null) { - u.noteWifiTurnedOffLocked(); - } + getUidStatsLocked(mWifiOnUid).noteWifiTurnedOffLocked(); mWifiOnUid = -1; } } @@ -1147,10 +1135,7 @@ public final class BatteryStatsImpl extends BatteryStats { mAudioOn = true; mAudioOnTimer.startRunningLocked(this); } - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteAudioTurnedOnLocked(); - } + getUidStatsLocked(uid).noteAudioTurnedOnLocked(); } public void noteAudioOffLocked(int uid) { @@ -1158,10 +1143,7 @@ public final class BatteryStatsImpl extends BatteryStats { mAudioOn = false; mAudioOnTimer.stopRunningLocked(this); } - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteAudioTurnedOffLocked(); - } + getUidStatsLocked(uid).noteAudioTurnedOffLocked(); } public void noteVideoOnLocked(int uid) { @@ -1169,10 +1151,7 @@ public final class BatteryStatsImpl extends BatteryStats { mVideoOn = true; mVideoOnTimer.startRunningLocked(this); } - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteVideoTurnedOnLocked(); - } + getUidStatsLocked(uid).noteVideoTurnedOnLocked(); } public void noteVideoOffLocked(int uid) { @@ -1180,10 +1159,7 @@ public final class BatteryStatsImpl extends BatteryStats { mVideoOn = false; mVideoOnTimer.stopRunningLocked(this); } - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteVideoTurnedOffLocked(); - } + getUidStatsLocked(uid).noteVideoTurnedOffLocked(); } public void noteWifiRunningLocked() { @@ -1215,45 +1191,27 @@ public final class BatteryStatsImpl extends BatteryStats { } public void noteFullWifiLockAcquiredLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteFullWifiLockAcquiredLocked(); - } + getUidStatsLocked(uid).noteFullWifiLockAcquiredLocked(); } public void noteFullWifiLockReleasedLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteFullWifiLockReleasedLocked(); - } + getUidStatsLocked(uid).noteFullWifiLockReleasedLocked(); } public void noteScanWifiLockAcquiredLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteScanWifiLockAcquiredLocked(); - } + getUidStatsLocked(uid).noteScanWifiLockAcquiredLocked(); } public void noteScanWifiLockReleasedLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteScanWifiLockReleasedLocked(); - } + getUidStatsLocked(uid).noteScanWifiLockReleasedLocked(); } public void noteWifiMulticastEnabledLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteWifiMulticastEnabledLocked(); - } + getUidStatsLocked(uid).noteWifiMulticastEnabledLocked(); } public void noteWifiMulticastDisabledLocked(int uid) { - Uid u = mUidStats.get(uid); - if (u != null) { - u.noteWifiMulticastDisabledLocked(); - } + getUidStatsLocked(uid).noteWifiMulticastDisabledLocked(); } @Override public long getScreenOnTime(long batteryRealtime, int which) { diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index f742ab77f926..9f1ed40adaf0 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1804,15 +1804,15 @@ <!-- External media notification strings --> <!-- Shown when external media is being checked --> <string name="ext_media_checking_notification_title">Preparing SD card</string> - <string name="ext_media_checking_notification_message">Checking for errors</string> + <string name="ext_media_checking_notification_message">Checking for errors.</string> <!-- Shown when external media is blank (or unsupported filesystem) --> <string name="ext_media_nofs_notification_title">Blank SD card</string> - <string name="ext_media_nofs_notification_message">The SD card is blank or using an unsupported filesystem.</string> + <string name="ext_media_nofs_notification_message">SD card blank or has unsupported filesystem.</string> <!-- Shown when external media is unmountable (corrupt)) --> <string name="ext_media_unmountable_notification_title">Damaged SD card</string> - <string name="ext_media_unmountable_notification_message">The SD card is damaged. You may have to reformat your card.</string> + <string name="ext_media_unmountable_notification_message">SD card damaged. You may have to reformat it.</string> <!-- Shown when external media is unsafely removed --> <string name="ext_media_badremoval_notification_title">SD card unexpectedly removed</string> @@ -1820,11 +1820,11 @@ <!-- Shown when external media has been safely removed --> <string name="ext_media_safe_unmount_notification_title">SD card safe to remove</string> - <string name="ext_media_safe_unmount_notification_message">The SD card can now be safely removed.</string> + <string name="ext_media_safe_unmount_notification_message">You can safely remove SD card.</string> <!-- Shown when external media is missing --> <string name="ext_media_nomedia_notification_title">Removed SD card</string> - <string name="ext_media_nomedia_notification_message">The SD has been removed. Insert a new SD card to increase your device storage.</string> + <string name="ext_media_nomedia_notification_message">SD card removed. Insert a new one.</string> <!-- Shown in LauncherActivity when the requested target Intent didn't return any matching Activities, leaving the list empty. --> <string name="activity_list_empty">No matching activities found</string> diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h index 6b0cc8ab8cce..eafa661eeee1 100644 --- a/include/media/ToneGenerator.h +++ b/include/media/ToneGenerator.h @@ -71,6 +71,82 @@ public: TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). + + // CDMA Tones + TONE_CDMA_DIAL_TONE_LITE, + TONE_CDMA_NETWORK_USA_RINGBACK, + TONE_CDMA_INTERCEPT, + TONE_CDMA_ABBR_INTERCEPT, + TONE_CDMA_REORDER, + TONE_CDMA_ABBR_REORDER, + TONE_CDMA_NETWORK_BUSY, + TONE_CDMA_CONFIRM, + TONE_CDMA_ANSWER, + TONE_CDMA_NETWORK_CALLWAITING, + TONE_CDMA_PIP, + + // ISDN + TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal + TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup + TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI + TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3 + TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING + TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5 + TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6 + TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7 + // ISDN end + + // IS54 + TONE_CDMA_HIGH_L, // IS54 High Pitch Long + TONE_CDMA_MED_L, // IS54 Med Pitch Long + TONE_CDMA_LOW_L, // IS54 Low Pitch Long + TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short + TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short + TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short + TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long + TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long + TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long + TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2 + TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2 + TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2 + TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short + TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short + TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short + TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short + TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short + TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short + TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long + TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long + TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long + TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short + TONE_CDMA_MED_PBX_SS, // PBX Med Short Short + TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short + TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long + TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long + TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long + TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS + TONE_CDMA_MED_PBX_SLS, // PBX Med SLS + TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS + TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS + TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS + TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS + //IS54 end + // proprietary + TONE_CDMA_ALERT_NETWORK_LITE, + TONE_CDMA_ALERT_AUTOREDIAL_LITE, + TONE_CDMA_ONE_MIN_BEEP, + TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, + TONE_CDMA_PRESSHOLDKEY_LITE, + TONE_CDMA_ALERT_INCALL_LITE, + TONE_CDMA_EMERGENCY_RINGBACK, + TONE_CDMA_ALERT_CALL_GUARD, + TONE_CDMA_SOFT_ERROR_LITE, + TONE_CDMA_CALLDROP_LITE, + // proprietary end + TONE_CDMA_NETWORK_BUSY_ONE_SHOT, + TONE_CDMA_ABBR_ALERT, + TONE_CDMA_SIGNAL_OFF, + //CDMA end NUM_TONES, NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1 }; @@ -125,7 +201,7 @@ private: static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 5; // Maximun number of segments in a tone descriptor + static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). @@ -140,6 +216,8 @@ private: // correspond to tone ON state and segments with odd index to OFF state. // The data stored in segments[] is the duration of the corresponding period in ms. // The first segment encountered with a 0 duration indicates that no more segment follows. + // - loopCnt - Number of times to repeat a sequence of seqments after playing this + // - loopIndx - The segment index to go back and play is loopcnt > 0 // - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated. // When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount. // If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be @@ -150,6 +228,8 @@ private: public: unsigned int duration; unsigned short waveFreq[TONEGEN_MAX_WAVES+1]; + unsigned short loopCnt; + unsigned short loopIndx; }; class ToneDescriptor { @@ -174,6 +254,8 @@ private: const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor + unsigned short mLoopCounter; // Current tone loopback count + int mSamplingRate; // AudioFlinger Sampling rate AudioTrack *mpAudioTrack; // Pointer to audio track used for playback Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API diff --git a/include/private/opengles/gl_context.h b/include/private/opengles/gl_context.h index 0c7ad462fb2a..a85f275bf9b1 100644 --- a/include/private/opengles/gl_context.h +++ b/include/private/opengles/gl_context.h @@ -456,7 +456,7 @@ struct matrix_stack_t { void validate(); matrixf_t& top() { return stack[depth]; } const matrixf_t& top() const { return stack[depth]; } - const uint32_t top_ops() const { return ops[depth]; } + uint32_t top_ops() const { return ops[depth]; } inline bool isRigidBody() const { return !(ops[depth] & ~(OP_TRANSLATE|OP_UNIFORM_SCALE|OP_ROTATE)); } diff --git a/include/utils/BackupHelpers.h b/include/utils/BackupHelpers.h index a21359f55eaf..759a0cc6d540 100644 --- a/include/utils/BackupHelpers.h +++ b/include/utils/BackupHelpers.h @@ -43,6 +43,7 @@ struct SnapshotHeader { struct FileState { int modTime_sec; int modTime_nsec; + int mode; int size; int crc32; int nameLen; diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp index d65a457f3987..67d07fed85cf 100644 --- a/libs/utils/BackupHelpers.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -302,6 +302,7 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD r.s.modTime_sec = st.st_mtime; r.s.modTime_nsec = 0; // workaround sim breakage //r.s.modTime_nsec = st.st_mtime_nsec; + r.s.mode = st.st_mode; r.s.size = st.st_size; // we compute the crc32 later down below, when we already have the file open. @@ -349,12 +350,12 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD g.s.crc32 = compute_crc32(fd); LOGP("%s", q.string()); - LOGP(" new: modTime=%d,%d size=%-3d crc32=0x%08x", - f.modTime_sec, f.modTime_nsec, f.size, f.crc32); - LOGP(" old: modTime=%d,%d size=%-3d crc32=0x%08x", - g.s.modTime_sec, g.s.modTime_nsec, g.s.size, g.s.crc32); + LOGP(" new: modTime=%d,%d mode=%04o size=%-3d crc32=0x%08x", + f.modTime_sec, f.modTime_nsec, f.mode, f.size, f.crc32); + LOGP(" old: modTime=%d,%d mode=%04o size=%-3d crc32=0x%08x", + g.s.modTime_sec, g.s.modTime_nsec, g.s.mode, g.s.size, g.s.crc32); if (f.modTime_sec != g.s.modTime_sec || f.modTime_nsec != g.s.modTime_nsec - || f.size != g.s.size || f.crc32 != g.s.crc32) { + || f.mode != g.s.mode || f.size != g.s.size || f.crc32 != g.s.crc32) { write_update_file(dataStream, fd, p, g.file.string()); } @@ -450,6 +451,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) r.s.modTime_sec = st.st_mtime; r.s.modTime_nsec = 0; // workaround sim breakage //r.s.modTime_nsec = st.st_mtime_nsec; + r.s.mode = st.st_mode; r.s.size = st.st_size; r.s.crc32 = crc; @@ -623,6 +625,7 @@ backup_helper_test_four() states[0].modTime_sec = 0xfedcba98; states[0].modTime_nsec = 0xdeadbeef; + states[0].mode = 0777; // decimal 511, hex 0x000001ff states[0].size = 0xababbcbc; states[0].crc32 = 0x12345678; states[0].nameLen = -12; @@ -632,6 +635,7 @@ backup_helper_test_four() states[1].modTime_sec = 0x93400031; states[1].modTime_nsec = 0xdeadbeef; + states[1].mode = 0666; // decimal 438, hex 0x000001b6 states[1].size = 0x88557766; states[1].crc32 = 0x22334422; states[1].nameLen = -1; @@ -641,6 +645,7 @@ backup_helper_test_four() states[2].modTime_sec = 0x33221144; states[2].modTime_nsec = 0xdeadbeef; + states[2].mode = 0744; // decimal 484, hex 0x000001e4 states[2].size = 0x11223344; states[2].crc32 = 0x01122334; states[2].nameLen = 0; @@ -650,6 +655,7 @@ backup_helper_test_four() states[3].modTime_sec = 0x33221144; states[3].modTime_nsec = 0xdeadbeef; + states[3].mode = 0755; // decimal 493, hex 0x000001ed states[3].size = 0x11223344; states[3].crc32 = 0x01122334; states[3].nameLen = 0; @@ -669,35 +675,38 @@ backup_helper_test_four() static const unsigned char correct_data[] = { // header 0x53, 0x6e, 0x61, 0x70, 0x04, 0x00, 0x00, 0x00, - 0x46, 0x69, 0x6c, 0x65, 0xac, 0x00, 0x00, 0x00, + 0x46, 0x69, 0x6c, 0x65, 0xbc, 0x00, 0x00, 0x00, // bytes_of_padding 0x98, 0xba, 0xdc, 0xfe, 0xef, 0xbe, 0xad, 0xde, - 0xbc, 0xbc, 0xab, 0xab, 0x78, 0x56, 0x34, 0x12, - 0x10, 0x00, 0x00, 0x00, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x70, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x67, + 0xff, 0x01, 0x00, 0x00, 0xbc, 0xbc, 0xab, 0xab, + 0x78, 0x56, 0x34, 0x12, 0x10, 0x00, 0x00, 0x00, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, // bytes_of_padding3 0x31, 0x00, 0x40, 0x93, 0xef, 0xbe, 0xad, 0xde, - 0x66, 0x77, 0x55, 0x88, 0x22, 0x44, 0x33, 0x22, - 0x11, 0x00, 0x00, 0x00, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x70, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x33, 0xab, 0xab, 0xab, + 0xb6, 0x01, 0x00, 0x00, 0x66, 0x77, 0x55, 0x88, + 0x22, 0x44, 0x33, 0x22, 0x11, 0x00, 0x00, 0x00, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, + 0x33, 0xab, 0xab, 0xab, // bytes of padding2 0x44, 0x11, 0x22, 0x33, 0xef, 0xbe, 0xad, 0xde, - 0x44, 0x33, 0x22, 0x11, 0x34, 0x23, 0x12, 0x01, - 0x12, 0x00, 0x00, 0x00, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x70, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x32, 0xab, 0xab, + 0xe4, 0x01, 0x00, 0x00, 0x44, 0x33, 0x22, 0x11, + 0x34, 0x23, 0x12, 0x01, 0x12, 0x00, 0x00, 0x00, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x32, 0xab, 0xab, // bytes of padding3 0x44, 0x11, 0x22, 0x33, 0xef, 0xbe, 0xad, 0xde, - 0x44, 0x33, 0x22, 0x11, 0x34, 0x23, 0x12, 0x01, - 0x13, 0x00, 0x00, 0x00, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x70, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x5f, 0x31, 0xab + 0xed, 0x01, 0x00, 0x00, 0x44, 0x33, 0x22, 0x11, + 0x34, 0x23, 0x12, 0x01, 0x13, 0x00, 0x00, 0x00, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x5f, 0x31, 0xab }; err = compare_file(filename, correct_data, sizeof(correct_data)); @@ -731,14 +740,14 @@ backup_helper_test_four() const FileState state = readSnapshot.valueAt(i); if (name != filenames[i] || states[i].modTime_sec != state.modTime_sec - || states[i].modTime_nsec != state.modTime_nsec + || states[i].modTime_nsec != state.modTime_nsec || states[i].mode != state.mode || states[i].size != state.size || states[i].crc32 != states[i].crc32) { - fprintf(stderr, "state %d expected={%d/%d, 0x%08x, 0x%08x, %3d} '%s'\n" - " actual={%d/%d, 0x%08x, 0x%08x, %3d} '%s'\n", i, - states[i].modTime_sec, states[i].modTime_nsec, states[i].size, states[i].crc32, - name.length(), filenames[i].string(), - state.modTime_sec, state.modTime_nsec, state.size, state.crc32, state.nameLen, - name.string()); + fprintf(stderr, "state %d expected={%d/%d, 0x%08x, %04o, 0x%08x, %3d} '%s'\n" + " actual={%d/%d, 0x%08x, %04o, 0x%08x, %3d} '%s'\n", i, + states[i].modTime_sec, states[i].modTime_nsec, states[i].mode, states[i].size, + states[i].crc32, name.length(), filenames[i].string(), + state.modTime_sec, state.modTime_nsec, state.mode, state.size, state.crc32, + state.nameLen, name.string()); matched = false; } } @@ -839,6 +848,7 @@ test_read_header_and_entity(BackupDataReader& reader, const char* str) size_t actualSize; bool done; int type; + ssize_t nRead; // printf("\n\n---------- test_read_header_and_entity -- %s\n\n", str); @@ -873,8 +883,9 @@ test_read_header_and_entity(BackupDataReader& reader, const char* str) goto finished; } - err = reader.ReadEntityData(buf, bufSize); - if (err != NO_ERROR) { + nRead = reader.ReadEntityData(buf, bufSize); + if (nRead < 0) { + err = reader.Status(); fprintf(stderr, "ReadEntityData failed with %s\n", strerror(err)); goto finished; } diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index 5c8fcf20ba01..edd1ea05c043 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -621,23 +621,37 @@ public class GpsLocationProvider extends ILocationProvider.Stub { } public void addListener(int uid) { - mClientUids.put(uid, 0); - if (mNavigating) { - try { - mBatteryStats.noteStartGps(uid); - } catch (RemoteException e) { - Log.w(TAG, "RemoteException in addListener"); + synchronized(mListeners) { + if (mClientUids.indexOfKey(uid) >= 0) { + // Shouldn't be here -- already have this uid. + Log.w(TAG, "Duplicate add listener for uid " + uid); + return; + } + mClientUids.put(uid, 0); + if (mNavigating) { + try { + mBatteryStats.noteStartGps(uid); + } catch (RemoteException e) { + Log.w(TAG, "RemoteException in addListener"); + } } } } public void removeListener(int uid) { - mClientUids.delete(uid); - if (mNavigating) { - try { - mBatteryStats.noteStopGps(uid); - } catch (RemoteException e) { - Log.w(TAG, "RemoteException in removeListener"); + synchronized(mListeners) { + if (mClientUids.indexOfKey(uid) < 0) { + // Shouldn't be here -- don't have this uid. + Log.w(TAG, "Unneeded remove listener for uid " + uid); + return; + } + mClientUids.delete(uid); + if (mNavigating) { + try { + mBatteryStats.noteStopGps(uid); + } catch (RemoteException e) { + Log.w(TAG, "RemoteException in removeListener"); + } } } } @@ -836,30 +850,33 @@ public class GpsLocationProvider extends ILocationProvider.Stub { private void reportStatus(int status) { if (VERBOSE) Log.v(TAG, "reportStatus status: " + status); - boolean wasNavigating = mNavigating; - mNavigating = (status == GPS_STATUS_SESSION_BEGIN); - - if (wasNavigating != mNavigating) { + synchronized(mListeners) { + boolean wasNavigating = mNavigating; + mNavigating = (status == GPS_STATUS_SESSION_BEGIN); + + if (wasNavigating == mNavigating) { + return; + } + if (mNavigating) { if (DEBUG) Log.d(TAG, "Acquiring wakelock"); mWakeLock.acquire(); } - synchronized(mListeners) { - int size = mListeners.size(); - for (int i = 0; i < size; i++) { - Listener listener = mListeners.get(i); - try { - if (mNavigating) { - listener.mListener.onGpsStarted(); - } else { - listener.mListener.onGpsStopped(); - } - } catch (RemoteException e) { - Log.w(TAG, "RemoteException in reportStatus"); - mListeners.remove(listener); - // adjust for size of list changing - size--; + + int size = mListeners.size(); + for (int i = 0; i < size; i++) { + Listener listener = mListeners.get(i); + try { + if (mNavigating) { + listener.mListener.onGpsStarted(); + } else { + listener.mListener.onGpsStopped(); } + } catch (RemoteException e) { + Log.w(TAG, "RemoteException in reportStatus"); + mListeners.remove(listener); + // adjust for size of list changing + size--; } } diff --git a/media/java/android/media/ToneGenerator.java b/media/java/android/media/ToneGenerator.java index 54ca6c40c563..e5ee9a31058c 100644 --- a/media/java/android/media/ToneGenerator.java +++ b/media/java/android/media/ToneGenerator.java @@ -50,12 +50,12 @@ public class ToneGenerator * * @see #ToneGenerator(int, int) */ - public static final int TONE_DTMF_2 = 2; - /** - * DTMF tone for key 3: 1477Hz, 697Hz, continuous - * - * @see #ToneGenerator(int, int) - */ + public static final int TONE_DTMF_2 = 2; + /** + * DTMF tone for key 3: 1477Hz, 697Hz, continuous + * + * @see #ToneGenerator(int, int) + */ public static final int TONE_DTMF_3 = 3; /** * DTMF tone for key 4: 1209Hz, 770Hz, continuous @@ -254,242 +254,474 @@ public class ToneGenerator * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_PIP = 33; - - /** - * CDMA SPECIFIC TONES START + * CDMA Dial tone : 425Hz continuous + * + * @see #ToneGenerator(int, int) */ - - /** TODO(Moto): Change "Proprietary" below with an appropriate specification reference */ - + public static final int TONE_CDMA_DIAL_TONE_LITE = 34; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF ... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_NETWORK_USA_RINGBACK = 35; + /** + * CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON ... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_DIAL_TONE_LITE = 34; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_INTERCEPT = 36; + /** + * CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ABBR_INTERCEPT = 37; + /** + * CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_NETWORK_USA_RINGBACK = 35; - + public static final int TONE_CDMA_REORDER = 38; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON * + * CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ABBR_REORDER = 39; + /** + * CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_REORDER = 36; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_NETWORK_BUSY = 40; + /** + * CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CONFIRM = 41; + /** * - * @hide + * CDMA answer tone: silent tone - defintion Frequency 0, 0ms ON, 0ms OFF + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_ABBR_REORDER = 37; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_ANSWER = 42; + /** * + * CDMA Network Callwaiting tone: 440Hz 300ms ON * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_NETWORK_CALLWAITING = 43; + /** + * CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_NETWORK_BUSY = 38; - - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_PIP = 44; + /** + * ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, + * 2091 32ms ON, 2556 48ms ON, 4s OFF * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL = 45; + /** + * ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, + * 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} times, + * 2091Hz 32ms ON, 4s OFF. * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_ANSWER = 39; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP = 46; + /** + * ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times + * 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, + * 2091Hz 16ms ON, 200ms OFF * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI = 47; + /** + * ISDN Call sign PAT3 tone: silent tone * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_NETWORK_CALLWAITING = 40; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 = 48; + /** + * ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times + * 2091Hz 20ms ON * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING = 49; + /** * - * @hide + * ISDN Pat5 tone: silent tone + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_PIP = 41; - - + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 = 50; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON * + * ISDN Pat6 tone: silent tone * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 = 51; + /** + * ISDN Pat7 tone: silent tone * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL = 42; - + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 = 52; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times + * 4000ms OFF, Repeat .... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_L = 53; + /** + * TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times + * 4000ms OFF, Repeat .... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP = 43; - - /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + public static final int TONE_CDMA_MED_L = 54; + /** + * TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, + * 4000ms OFF, Repeat .... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_L = 55; + /** + * CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, + * 400ms OFF, repeat .... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_SP_PRI = 44; - + public static final int TONE_CDMA_HIGH_SS = 56; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, + * 400ms OFF, repeat .... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_SS = 57; + /** + * CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, + * 400ms OFF, repeat .... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 = 45; - + public static final int TONE_CDMA_LOW_SS = 58; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, + * 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, + * 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, + * 4000ms OFF, repeat ... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_SSL = 59; + /** + * CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, + * 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, + * 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, + * 4000ms OFF, repeat ... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_RING_RING = 46; - + public static final int TONE_CDMA_MED_SSL = 60; /** - * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, + * 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, + * 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, + * 4000ms OFF, repeat ... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_SSL = 61; + /** + * CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, + * 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, + * 3000ms OFF, repeat .... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 = 47; - + public static final int TONE_CDMA_HIGH_SS_2 = 62; /** - * general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, + * 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, + * 3000ms OFF, repeat .... * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_SS_2 = 63; + /** + * CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, + * 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, + * 3000ms OFF, repeat .... * - * @hide + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 = 48; - + public static final int TONE_CDMA_LOW_SS_2 = 64; /** - * general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, + * 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, + * {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT * * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_SLS = 65; + /** + * CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, + * 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT * - * @hide + * + * @see #ToneGenerator(int, int) */ - public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 = 49; - - // TODO(Moto): Need comments for each one and we need ToneGenerator.cpp/ToneGenerator.h - - /** @hide */ - public static final int TONE_CDMA_HIGH_L = 50; - - /** @hide */ - public static final int TONE_CDMA_LOW_L = 51; - /** @hide */ - public static final int TONE_CDMA_HIGH_SS = 52; - /** @hide */ - public static final int TONE_CDMA_MED_SS = 53; - /** @hide */ - public static final int TONE_CDMA_LOW_SS = 54; - /** @hide */ - public static final int TONE_CDMA_HIGH_SSL = 55; - - - /** @hide */ - public static final int TONE_CDMA_MED_SSL = 56; - /** @hide */ - public static final int TONE_CDMA_LOW_SSL = 57; - /** @hide */ - public static final int TONE_CDMA_HIGH_SS_2 = 58; - /** @hide */ - public static final int TONE_CDMA_MED_SS_2 = 59; - /** @hide */ - public static final int TONE_CDMA_LOW_SS_2 = 60; - /** @hide */ - public static final int TONE_CDMA_HIGH_SLS = 61; - /** @hide */ - public static final int TONE_CDMA_MED_SLS = 62; - /** @hide */ - public static final int TONE_CDMA_LOW_SLS = 63; - /** @hide */ - public static final int TONE_CDMA_HIGH_S_X4 = 64; - /** @hide */ - public static final int TONE_CDMA_MED_S_X4 = 65; - /** @hide */ - public static final int TONE_CDMA_LOW_S_X4 = 66; - /** @hide */ - public static final int TONE_CDMA_HIGH_PBX_L = 67; - /** @hide */ - public static final int TONE_CDMA_MED_PBX_L = 68; - /** @hide */ - public static final int TONE_CDMA_LOW_PBX_L = 69; - /** @hide */ - public static final int TONE_CDMA_HIGH_PBX_SS = 70; - /** @hide */ - public static final int TONE_CDMA_MED_PBX_SS = 71; - /** @hide */ - public static final int TONE_CDMA_LOW_PBX_SS = 72; - /** @hide */ - public static final int TONE_CDMA_HIGH_PBX_SSL = 73; - /** @hide */ - public static final int TONE_CDMA_MED_PBX_SSL = 74; - - /** @hide */ - public static final int TONE_CDMA_LOW_PBX_SSL = 75; - /** @hide */ - public static final int TONE_CDMA_HIGH_PBX_SLS = 76; - /** @hide */ - public static final int TONE_CDMA_MED_PBX_SLS = 77; - /** @hide */ - public static final int TONE_CDMA_LOW_PBX_SLS = 78; - /** @hide */ - public static final int TONE_CDMA_HIGH_PBX_S_X4 = 79; - /** @hide */ - public static final int TONE_CDMA_MED_PBX_S_X4 = 80; - /** @hide */ - public static final int TONE_CDMA_LOW_PBX_S_X4 = 81; - /** @hide */ - public static final int TONE_CDMA_INTERCEPT_ONE_SHOT = TONE_SUP_INTERCEPT_ABBREV; - /** @hide */ - public static final int TONE_CDMA_REORDER_ONE_SHOT = TONE_CDMA_ABBR_REORDER; - /** @hide */ - public static final int TONE_CDMA_NETWORK_BUSY_ONE_SHOT = 82; - /** @hide */ - public static final int TONE_CDMA_ABBR_ALERT = 83; - /** @hide */ - public static final int TONE_CDMA_SIGNAL_OFF = 84; - /** @hide */ - public static final int TONE_CDMA_INVALID = 85; + public static final int TONE_CDMA_MED_SLS = 66; + /** + * CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, + * 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, + * {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_SLS = 67; + /** + * CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, + * 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, + * {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, + * {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_S_X4 = 68; + /** + * CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, + * 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_S_X4 = 69; + /** + * CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, + * 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + * + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_S_X4 = 70; + /** + * CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_PBX_L = 71; + /** + * CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_PBX_L = 72; + /** + * CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_PBX_L = 73; + /** + * CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times + * 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_PBX_SS = 74; + /** + * CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times + * 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_PBX_SS = 75; + /** + * CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times + * 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, + * 2000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_PBX_SS = 76; + /** + * CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times + * 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, + * {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_PBX_SSL = 77; + /** + * CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times + * 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_PBX_SSL = 78; + /** + * CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times + * 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, + * {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT.... + * + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_PBX_SSL = 79; + /** + * CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times + * 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, + * {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_PBX_SLS = 80; + /** + * CDMA HIGH PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times + * 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, + * {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_PBX_SLS = 81; + /** + * CDMA HIGH PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times + * 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, + * {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT.... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_PBX_SLS = 82; + /** + * CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, + * 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, + * {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, + * {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_HIGH_PBX_S_X4 = 83; + /** + * CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, + * 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, + * {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, + * {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_MED_PBX_S_X4 = 84; + /** + * CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, + * 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, + * {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, + * {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_LOW_PBX_S_X4 = 85; + /** + * CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON + * 622Hz 62ms ON, 1109Hz 62ms ON + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ALERT_NETWORK_LITE = 86; + /** + * CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, + * 1245 62ms ON + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ALERT_AUTOREDIAL_LITE = 87; + /** + * CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ONE_MIN_BEEP = 88; + /** + * + * CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_KEYPAD_VOLUME_KEY_LITE = 89; + /** + * CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_PRESSHOLDKEY_LITE = 90; + /** + * CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, + * 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ALERT_INCALL_LITE = 91; + /** + * CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times + * 4990ms OFF, REPEAT... + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_EMERGENCY_RINGBACK = 92; + /** + * CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ALERT_CALL_GUARD = 93; + /** + * CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_SOFT_ERROR_LITE = 94; + /** + * CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_CALLDROP_LITE = 95; + /** + * CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF. + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_NETWORK_BUSY_ONE_SHOT = 96; + /** + * CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_ABBR_ALERT = 97; + /** + * CDMA_SIGNAL_OFF - silent tone + * + * @see #ToneGenerator(int, int) + */ + public static final int TONE_CDMA_SIGNAL_OFF = 98; /** Maximum volume, for use with {@link #ToneGenerator(int,int)} */ public static final int MAX_VOLUME = AudioSystem.MAX_VOLUME; @@ -546,6 +778,71 @@ public class ToneGenerator * <li>{@link #TONE_SUP_CONGESTION_ABBREV} * <li>{@link #TONE_SUP_CONFIRM} * <li>{@link #TONE_SUP_PIP} + * <li>{@link #TONE_CDMA_DIAL_TONE_LITE} + * <li>{@link #TONE_CDMA_NETWORK_USA_RINGBACK} + * <li>{@link #TONE_CDMA_INTERCEPT} + * <li>{@link #TONE_CDMA_ABBR_INTERCEPT} + * <li>{@link #TONE_CDMA_REORDER} + * <li>{@link #TONE_CDMA_ABBR_REORDER} + * <li>{@link #TONE_CDMA_NETWORK_BUSY} + * <li>{@link #TONE_CDMA_CONFIRM} + * <li>{@link #TONE_CDMA_ANSWER} + * <li>{@link #TONE_CDMA_NETWORK_CALLWAITING} + * <li>{@link #TONE_CDMA_PIP} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_PAT3} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_PAT5} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_PAT6} + * <li>{@link #TONE_CDMA_CALL_SIGNAL_ISDN_PAT7} + * <li>{@link #TONE_CDMA_HIGH_L} + * <li>{@link #TONE_CDMA_MED_L} + * <li>{@link #TONE_CDMA_LOW_L} + * <li>{@link #TONE_CDMA_HIGH_SS} + * <li>{@link #TONE_CDMA_MED_SS} + * <li>{@link #TONE_CDMA_LOW_SS} + * <li>{@link #TONE_CDMA_HIGH_SSL} + * <li>{@link #TONE_CDMA_MED_SSL} + * <li>{@link #TONE_CDMA_LOW_SSL} + * <li>{@link #TONE_CDMA_HIGH_SS_2} + * <li>{@link #TONE_CDMA_MED_SS_2} + * <li>{@link #TONE_CDMA_LOW_SS_2} + * <li>{@link #TONE_CDMA_HIGH_SLS} + * <li>{@link #TONE_CDMA_MED_SLS} + * <li>{@link #TONE_CDMA_LOW_SLS} + * <li>{@link #TONE_CDMA_HIGH_S_X4} + * <li>{@link #TONE_CDMA_MED_S_X4} + * <li>{@link #TONE_CDMA_LOW_S_X4} + * <li>{@link #TONE_CDMA_HIGH_PBX_L} + * <li>{@link #TONE_CDMA_MED_PBX_L} + * <li>{@link #TONE_CDMA_LOW_PBX_L} + * <li>{@link #TONE_CDMA_HIGH_PBX_SS} + * <li>{@link #TONE_CDMA_MED_PBX_SS} + * <li>{@link #TONE_CDMA_LOW_PBX_SS} + * <li>{@link #TONE_CDMA_HIGH_PBX_SSL} + * <li>{@link #TONE_CDMA_MED_PBX_SSL} + * <li>{@link #TONE_CDMA_LOW_PBX_SSL} + * <li>{@link #TONE_CDMA_HIGH_PBX_SLS} + * <li>{@link #TONE_CDMA_MED_PBX_SLS} + * <li>{@link #TONE_CDMA_LOW_PBX_SLS} + * <li>{@link #TONE_CDMA_HIGH_PBX_S_X4} + * <li>{@link #TONE_CDMA_MED_PBX_S_X4} + * <li>{@link #TONE_CDMA_LOW_PBX_S_X4} + * <li>{@link #TONE_CDMA_ALERT_NETWORK_LITE} + * <li>{@link #TONE_CDMA_ALERT_AUTOREDIAL_LITE} + * <li>{@link #TONE_CDMA_ONE_MIN_BEEP} + * <li>{@link #TONE_CDMA_KEYPAD_VOLUME_KEY_LITE} + * <li>{@link #TONE_CDMA_PRESSHOLDKEY_LITE} + * <li>{@link #TONE_CDMA_ALERT_INCALL_LITE} + * <li>{@link #TONE_CDMA_EMERGENCY_RINGBACK} + * <li>{@link #TONE_CDMA_ALERT_CALL_GUARD} + * <li>{@link #TONE_CDMA_SOFT_ERROR_LITE} + * <li>{@link #TONE_CDMA_CALLDROP_LITE} + * <li>{@link #TONE_CDMA_NETWORK_BUSY_ONE_SHOT} + * <li>{@link #TONE_CDMA_ABBR_ALERT} + * <li>{@link #TONE_CDMA_SIGNAL_OFF} * </ul> * @see #ToneGenerator(int, int) */ @@ -566,7 +863,7 @@ public class ToneGenerator private native final void native_setup(int streamType, int volume); private native final void native_finalize(); - + @Override protected void finalize() { native_finalize(); } diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 81ee92c5a121..c22cd53d1d4a 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -33,199 +33,720 @@ namespace android { // Descriptors for all available tones (See ToneGenerator::ToneDescriptor class declaration for details) const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { - { segments: {{ duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 941, 0 }}, - { duration: 0 , waveFreq: { 0 }}}, + { segments: {{ duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 941, 0 }, 0, 0}, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_0 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 697, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 697, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_1 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 697, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 697, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_2 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 697, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 697, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_3 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 770, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 770, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_4 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 770, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 770, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_5 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 770, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 770, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_6 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 852, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 852, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_7 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 852, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1336, 852, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_8 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 852, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 852, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_9 - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 941, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1209, 941, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_S - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 941, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1477, 941, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_P - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 697, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 697, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_A - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 770, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 770, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_B - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 852, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 852, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_C - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 941, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 1633, 941, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_DTMF_D - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 425, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_DIAL - { segments: { { duration: 500 , waveFreq: { 425, 0 }}, - { duration: 500, waveFreq: { 0 }}, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 500 , waveFreq: { 425, 0 }, 0, 0}, + { duration: 500, waveFreq: { 0 }, 0, 0}, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_BUSY - { segments: { { duration: 200, waveFreq: { 425, 0 } }, - { duration: 200, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_CONGESTION - { segments: { { duration: 200, waveFreq: { 425, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 0, repeatSegment: 0 }, // TONE_SUP_RADIO_ACK - { segments: { { duration: 200, waveFreq: { 425, 0 }}, - { duration: 200, waveFreq: { 0 }}, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0}, + { duration: 200, waveFreq: { 0 }, 0, 0}, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 2, repeatSegment: 0 }, // TONE_SUP_RADIO_NOTAVAIL - { segments: { { duration: 330, waveFreq: { 950, 1400, 1800, 0 }}, - { duration: 1000, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 330, waveFreq: { 950, 1400, 1800, 0 }, 0, 0}, + { duration: 1000, waveFreq: { 0 }, 0, 0}, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_ERROR - { segments: { { duration: 200, waveFreq: { 425, 0 } }, - { duration: 600, waveFreq: { 0 } }, - { duration: 200, waveFreq: { 425, 0 } }, - { duration: 3000, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 200, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 600, waveFreq: { 0 }, 0, 0 }, + { duration: 200, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_CALL_WAITING - { segments: { { duration: 1000, waveFreq: { 425, 0 } }, - { duration: 4000, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 1000, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_RINGTONE - { segments: { { duration: 40, waveFreq: { 400, 1200, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 0, repeatSegment: 0 }, // TONE_PROP_BEEP - { segments: { { duration: 100, waveFreq: { 1200, 0 } }, - { duration: 100, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 100, waveFreq: { 1200, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 1, repeatSegment: 0 }, // TONE_PROP_ACK - { segments: { { duration: 400, waveFreq: { 300, 400, 500, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 400, waveFreq: { 300, 400, 500, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 0, repeatSegment: 0 }, // TONE_PROP_NACK - { segments: { { duration: 200, waveFreq: { 400, 1200, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 200, waveFreq: { 400, 1200, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 0, repeatSegment: 0 }, // TONE_PROP_PROMPT - { segments: { { duration: 40, waveFreq: { 400, 1200, 0 } }, - { duration: 200, waveFreq: { 0 } }, - { duration: 40, waveFreq: { 400, 1200, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 40, waveFreq: { 400, 1200, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 0, repeatSegment: 0 }, // TONE_PROP_BEEP2 - { segments: { { duration: 250, waveFreq: { 440, 0 } }, - { duration: 250, waveFreq: { 620, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 620, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0 }}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_SUP_INTERCEPT - { segments: { { duration: 250, waveFreq: { 440, 0 } }, - { duration: 250, waveFreq: { 620, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 620, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 7, repeatSegment: 0 }, // TONE_SUP_INTERCEPT_ABBREV - { segments: { { duration: 250, waveFreq: { 480, 620, 0 } }, - { duration: 250, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 7, repeatSegment: 0 }, // TONE_SUP_CONGESTION_ABBREV - { segments: { { duration: 100, waveFreq: { 350, 440, 0 } }, - { duration: 100, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 100, waveFreq: { 350, 440, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 2, repeatSegment: 0 }, // TONE_SUP_CONFIRM - { segments: { { duration: 100, waveFreq: { 480, 0 } }, - { duration: 100, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 100, waveFreq: { 480, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: 3, repeatSegment: 0 }, // TONE_SUP_PIP - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 350, 440, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: {{ duration: ToneGenerator::TONEGEN_INF, waveFreq: { 425, 0 }, 0, 0}, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_DIAL_TONE_LITE + { segments: { { duration: 2000, waveFreq: { 440, 480, 0 }, 0, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_NETWORK_USA_RINGBACK + { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 620, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_INTERCEPT + { segments: { { duration: 250, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 620, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ABBR_INTERCEPT + { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_REORDER + { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: 7, + repeatSegment: 0 }, // TONE_CDMA_ABBR_REORDER + { segments: { { duration: 500, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_NETWORK_BUSY + { segments: { { duration: 100, waveFreq: { 350, 440, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: 2, + repeatSegment: 0 }, // TONE_CDMA_CONFIRM + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ANSWER + { segments: { { duration: 300, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_NETWORK_CALLWAITING + { segments: { { duration: 100, waveFreq: { 480, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, + repeatCnt: 3, + repeatSegment: 0 }, // TONE_CDMA_PIP + + { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0}, 19, 0}, + { duration: 32, waveFreq: { 2091, 0}, 0, 0}, + { duration: 48, waveFreq: { 2556, 0}, 0, 0}, + { duration: 4000, waveFreq: { 0 }, 0, 0}, + { duration: 0, waveFreq: { 0 }, 0, 0}}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL + { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0}, 7, 0 }, + { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 400, waveFreq: { 0 }, 0, 0 }, + { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0}, 7, 4 }, + { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP + { segments: { { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0}, 3, 0 }, + { duration: 16, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 32, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0}, 3, 4 }, + { duration: 16, waveFreq: { 2091, 0}, 0, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0} }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 + { segments: { { duration: 32, waveFreq: { 2091, 0 }, 0, 0 }, + { duration: 64, waveFreq: { 2556, 0 }, 4, 0 }, + { duration: 20, waveFreq: { 2091, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 } , 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0} }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0} }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0} }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 + + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 39, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_L + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 39, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_L + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 39, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_L + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 15, 0 }, + { duration: 400, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_SS + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 15, 0 }, + { duration: 400, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_SS + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 15, 0 }, + { duration: 400, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_SS + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 15, 6 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_SSL + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 15, 6 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_SSL + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 15, 6 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_SSL + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 19, 0 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 19, 3 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_SS_2 + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 19, 0 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 19, 3 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_SS_2 + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 19, 0 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 19, 3 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_SS_2 + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 19, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 6 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_SLS + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 19, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 6 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_SLS + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 19, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 6 }, + { duration: 3000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_SLS + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 6 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 9, 9 }, + { duration: 2500, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_S_X4 + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 6 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 9, 9 }, + { duration: 2500, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_S_X4 + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 3 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 6 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 9, 9 }, + { duration: 2500, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_S_X4 + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 19, 0 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_PBX_L + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 19, 0 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_PBX_L + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 19, 0 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_PBX_L + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 3 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_PBX_SS + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 3 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_PBX_SS + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 3 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_PBX_SS + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 15, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_PBX_SSL + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 15, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_PBX_SSL + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 15, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_PBX_SSL + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 15, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_PBX_SLS + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 15, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_PBX_SLS + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 15, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 6 }, + { duration: 1000, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_PBX_SLS + { segments: { { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 6 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 3700, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 4000, 0 }, 7, 9 }, + { duration: 800, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_HIGH_PBX_S_X4 + { segments: { { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 6 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2600, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 2900, 0 }, 7, 9 }, + { duration: 800, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_MED_PBX_S_X4 + { segments: { { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 0 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 3 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 6 }, + { duration: 200, waveFreq: { 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1300, 0 }, 0, 0 }, + { duration: 25, waveFreq: { 1450, 0 }, 7, 9 }, + { duration: 800, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_LOW_PBX_S_X4 + + { segments: { { duration: 62, waveFreq: { 1109, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 740, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 622, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 1109, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ALERT_NETWORK_LITE + { segments: { { duration: 62, waveFreq: { 1245, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 659, 0 }, 2, 0 }, + { duration: 62, waveFreq: { 1245, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ALERT_AUTOREDIAL_LITE + { segments: { { duration: 400, waveFreq: { 1150, 770, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ONE_MIN_BEEP + { segments: { { duration: 120, waveFreq: { 941, 1477, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_KEYPAD_VOLUME_KEY_LITE + { segments: { { duration: 375, waveFreq: { 587, 0 }, 0, 0 }, + { duration: 125, waveFreq: { 1175, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_PRESSHOLDKEY_LITE + { segments: { { duration: 62, waveFreq: { 587, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 831, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 1109, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 831, 0 }, 0, 0 }, + { duration: 62, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ALERT_INCALL_LITE + { segments: { { duration: 125, waveFreq: { 941, 0 }, 0, 0 }, + { duration: 10, waveFreq: { 0 }, 2, 0 }, + { duration: 4990, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: ToneGenerator::TONEGEN_INF, + repeatSegment: 0 }, // TONE_CDMA_EMERGENCY_RINGBACK + { segments: { { duration: 125, waveFreq: { 1319, 0 }, 0, 0 }, + { duration: 125, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 2, + repeatSegment: 0 }, // TONE_CDMA_ALERT_CALL_GUARD + { segments: { { duration: 125, waveFreq: { 1047, 0 }, 0, 0 }, + { duration: 125, waveFreq: { 370, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_SOFT_ERROR_LITE + { segments: { { duration: 125, waveFreq: { 1480, 0 }, 0, 0 }, + { duration: 125, waveFreq: { 1397, 0 }, 0, 0 }, + { duration: 125, waveFreq: { 784, 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 } }, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_CALLDROP_LITE + + { segments: { { duration: 500, waveFreq: { 425, 0 }, 0, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_NETWORK_BUSY_ONE_SHOT + { segments: { { duration: 400, waveFreq: { 1150, 770 }, 0, 0 }, + { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_ABBR_ALERT + { segments: { { duration: 0, waveFreq: { 0 }, 0, 0 }}, + repeatCnt: 0, + repeatSegment: 0 }, // TONE_CDMA_SIGNAL_OFF + + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 350, 440, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_ANSI_DIAL - { segments: { { duration: 500, waveFreq: { 480, 620, 0 } }, - { duration: 500, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 500, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_ANSI_BUSY - { segments: { { duration: 250, waveFreq: { 480, 620, 0 } }, - { duration: 250, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 250, waveFreq: { 480, 620, 0 }, 0, 0 }, + { duration: 250, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_ANSI_CONGESTION - { segments: { { duration: 300, waveFreq: { 440, 0 } }, - { duration: 9700, waveFreq: { 0 } }, - { duration: 100, waveFreq: { 440, 0 } }, - { duration: 100, waveFreq: { 0 } }, - { duration: 100, waveFreq: { 440, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 300, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 9700, waveFreq: { 0 }, 0, 0 }, + { duration: 100, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 100, waveFreq: { 0 }, 0, 0 }, + { duration: 100, waveFreq: { 440, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 1 }, // TONE_ANSI_CALL_WAITING - { segments: { { duration: 2000, waveFreq: { 440, 480, 0 } }, - { duration: 4000, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 2000, waveFreq: { 440, 480, 0 }, 0, 0 }, + { duration: 4000, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_ANSI_RINGTONE - { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 400, 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: ToneGenerator::TONEGEN_INF, waveFreq: { 400, 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_JAPAN_DIAL - { segments: { { duration: 500, waveFreq: { 400, 0 } }, - { duration: 500, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 500, waveFreq: { 400, 0 }, 0, 0 }, + { duration: 500, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_JAPAN_BUSY - { segments: { { duration: 1000, waveFreq: { 400, 0 } }, - { duration: 2000, waveFreq: { 0 } }, - { duration: 0 , waveFreq: { 0 }}}, + { segments: { { duration: 1000, waveFreq: { 400, 0 }, 0, 0 }, + { duration: 2000, waveFreq: { 0 }, 0, 0 }, + { duration: 0 , waveFreq: { 0 }, 0, 0}}, repeatCnt: ToneGenerator::TONEGEN_INF, repeatSegment: 0 }, // TONE_JAPAN_RADIO_ACK + + + }; // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type @@ -529,9 +1050,9 @@ initAudioTrack_exit: // //////////////////////////////////////////////////////////////////////////////// void ToneGenerator::audioCallback(int event, void* user, void *info) { - + if (event != AudioTrack::EVENT_MORE_DATA) return; - + const AudioTrack::Buffer *buffer = static_cast<const AudioTrack::Buffer *>(info); ToneGenerator *lpToneGen = static_cast<ToneGenerator *>(user); short *lpOut = buffer->i16; @@ -549,12 +1070,12 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { unsigned int lGenSmp; unsigned int lWaveCmd = WaveGenerator::WAVEGEN_CONT; bool lSignal = false; - + lpToneGen->mLock.lock(); // Update pcm frame count and end time (current time at the end of this process) lpToneGen->mTotalSmp += lReqSmp; - + // Update tone gen state machine and select wave gen command switch (lpToneGen->mState) { case TONE_PLAYING: @@ -562,13 +1083,13 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { break; case TONE_STARTING: LOGV("Starting Cbk"); - + lWaveCmd = WaveGenerator::WAVEGEN_START; break; case TONE_STOPPING: case TONE_RESTARTING: LOGV("Stop/restart Cbk"); - + lWaveCmd = WaveGenerator::WAVEGEN_STOP; lpToneGen->mNextSegSmp = TONEGEN_INF; // forced to skip state machine management below break; @@ -578,21 +1099,21 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { lNumSmp = 0; goto audioCallback_EndLoop; } - - + + // Exit if tone sequence is over if (lpToneDesc->segments[lpToneGen->mCurSegment].duration == 0) { if (lpToneGen->mState == TONE_PLAYING) { - lpToneGen->mState = TONE_STOPPING; + lpToneGen->mState = TONE_STOPPING; } goto audioCallback_EndLoop; } - + if (lpToneGen->mTotalSmp > lpToneGen->mNextSegSmp) { // Time to go to next sequence segment - + LOGV("End Segment, time: %d\n", (unsigned int)(systemTime()/1000000)); - + lGenSmp = lReqSmp; // If segment, ON -> OFF transition : ramp volume down @@ -609,25 +1130,49 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { LOGV("ON->OFF, lGenSmp: %d, lReqSmp: %d\n", lGenSmp, lReqSmp); } - // Go to next segment - lpToneGen->mCurSegment++; + // check if we need to loop and loop for the reqd times + if (lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt) { + if (lpToneGen->mLoopCounter < lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt) { + LOGV ("in if loop loopCnt(%d) loopctr(%d), CurSeg(%d) \n", + lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, + lpToneGen->mLoopCounter, + lpToneGen->mCurSegment); + lpToneGen->mCurSegment = lpToneDesc->segments[lpToneGen->mCurSegment].loopIndx; + ++lpToneGen->mLoopCounter; + } else { + // completed loop. go to next segment + lpToneGen->mLoopCounter = 0; + lpToneGen->mCurSegment++; + LOGV ("in else loop loopCnt(%d) loopctr(%d), CurSeg(%d) \n", + lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, + lpToneGen->mLoopCounter, + lpToneGen->mCurSegment); + } + } else { + lpToneGen->mCurSegment++; + LOGV ("Goto next seg loopCnt(%d) loopctr(%d), CurSeg(%d) \n", + lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, + lpToneGen->mLoopCounter, + lpToneGen->mCurSegment); + + } // Handle loop if last segment reached if (lpToneDesc->segments[lpToneGen->mCurSegment].duration == 0) { LOGV("Last Seg: %d\n", lpToneGen->mCurSegment); - + // Pre increment loop count and restart if total count not reached. Stop sequence otherwise if (++lpToneGen->mCurCount <= lpToneDesc->repeatCnt) { LOGV("Repeating Count: %d\n", lpToneGen->mCurCount); - + lpToneGen->mCurSegment = lpToneDesc->repeatSegment; if (lpToneDesc->segments[lpToneDesc->repeatSegment].waveFreq[0] != 0) { lWaveCmd = WaveGenerator::WAVEGEN_START; } - + LOGV("New segment %d, Next Time: %d\n", lpToneGen->mCurSegment, (lpToneGen->mNextSegSmp*1000)/lpToneGen->mSamplingRate); - + } else { lGenSmp = 0; LOGV("End repeat, time: %d\n", (unsigned int)(systemTime()/1000000)); @@ -644,11 +1189,11 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { lGenSmp = 0; } } - + // Update next segment transition position. No harm to do it also for last segment as lpToneGen->mNextSegSmp won't be used any more lpToneGen->mNextSegSmp += (lpToneDesc->segments[lpToneGen->mCurSegment].duration * lpToneGen->mSamplingRate) / 1000; - + } else { // Inside a segment keep tone ON or OFF if (lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[0] == 0) { @@ -657,24 +1202,24 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { lGenSmp = lReqSmp; // If event segment, tone is currently ON } } - + if (lGenSmp) { // If samples must be generated, call all active wave generators and acumulate waves in lpOut unsigned int lFreqIdx = 0; unsigned short lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[lFreqIdx]; - + while (lFrequency != 0) { WaveGenerator *lpWaveGen = lpToneGen->mWaveGens.valueFor(lFrequency); lpWaveGen->getSamples(lpOut, lGenSmp, lWaveCmd); lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[++lFreqIdx]; } } - + lNumSmp -= lReqSmp; lpOut += lReqSmp; - + audioCallback_EndLoop: - + switch (lpToneGen->mState) { case TONE_RESTARTING: LOGV("Cbk restarting track\n"); @@ -694,7 +1239,7 @@ audioCallback_EndLoop: LOGV("Cbk Stopping track\n"); lSignal = true; lpToneGen->mpAudioTrack->stop(); - + // Force loop exit lNumSmp = 0; break; @@ -765,6 +1310,7 @@ bool ToneGenerator::prepareWave() { mTotalSmp = 0; mCurSegment = 0; mCurCount = 0; + mLoopCounter = 0; if (mpToneDesc->segments[0].duration == TONEGEN_INF) { mNextSegSmp = TONEGEN_INF; } else{ diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java index af46082a5689..84058f5401ec 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java @@ -51,8 +51,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi private SQLiteDatabase mDB; private SurfaceHolder mSurfaceHolder = null; - private static final int NUM_STRESS_LOOP = 1; - private static final int NUM_PLAYBACk_IN_EACH_LOOP = 2; + private static final int NUM_STRESS_LOOP = 10; + private static final int NUM_PLAYBACk_IN_EACH_LOOP = 20; private static final long MEDIA_STRESS_WAIT_TIME = 5000; //5 seconds private static final String MEDIA_MEMORY_OUTPUT = "/sdcard/mediaMemOutput.txt"; diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index b6f534b7ea50..14a910c87336 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -900,7 +900,7 @@ void glTexParameteriv( memcpy(textureObject->crop_rect, params, 4*sizeof(GLint)); break; default: - ogles_error(c, GL_INVALID_ENUM); + texParameterx(target, pname, GLfixed(params[0]), c); return; } } @@ -919,6 +919,13 @@ void glTexParameterx( texParameterx(target, pname, param, c); } +void glTexParameteri( + GLenum target, GLenum pname, GLint param) +{ + ogles_context_t* c = ogles_context_t::get(); + texParameterx(target, pname, GLfixed(param), c); +} + // ---------------------------------------------------------------------------- #if 0 #pragma mark - diff --git a/opengl/tests/angeles/Android.mk b/opengl/tests/angeles/Android.mk index 46958d3c3c55..e193483f5d69 100644 --- a/opengl/tests/angeles/Android.mk +++ b/opengl/tests/angeles/Android.mk @@ -5,7 +5,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= app-linux.c demo.c.arm LOCAL_SHARED_LIBRARIES := libEGL libGLESv1_CM libui LOCAL_MODULE:= angeles -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) @@ -13,5 +13,5 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= gpustate.c LOCAL_SHARED_LIBRARIES := libEGL libGLESv1_CM LOCAL_MODULE:= gpustate -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/opengl/tests/filter/Android.mk b/opengl/tests/filter/Android.mk index a448f0d46161..31b7d9a48703 100644 --- a/opengl/tests/filter/Android.mk +++ b/opengl/tests/filter/Android.mk @@ -12,6 +12,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= test-opengl-filter -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/opengl/tests/finish/Android.mk b/opengl/tests/finish/Android.mk index 26836c1caf4c..8b46cd7f1773 100644 --- a/opengl/tests/finish/Android.mk +++ b/opengl/tests/finish/Android.mk @@ -12,6 +12,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= test-opengl-finish -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/opengl/tests/textures/Android.mk b/opengl/tests/textures/Android.mk index a8c622092645..8d5f56de2bba 100644 --- a/opengl/tests/textures/Android.mk +++ b/opengl/tests/textures/Android.mk @@ -12,6 +12,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= test-opengl-textures -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/opengl/tests/tritex/Android.mk b/opengl/tests/tritex/Android.mk index 5cd1f048a309..76fd8dddc533 100644 --- a/opengl/tests/tritex/Android.mk +++ b/opengl/tests/tritex/Android.mk @@ -12,6 +12,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= test-opengl-tritex -LOCAL_MODULE_TAGS := tests +LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/packages/TtsService/jni/android_tts_SynthProxy.cpp b/packages/TtsService/jni/android_tts_SynthProxy.cpp index 54d038a480b7..0aa4fa5ec8c1 100644 --- a/packages/TtsService/jni/android_tts_SynthProxy.cpp +++ b/packages/TtsService/jni/android_tts_SynthProxy.cpp @@ -296,7 +296,7 @@ android_tts_SynthProxy_setLanguage(JNIEnv *env, jobject thiz, jint jniData, static void android_tts_SynthProxy_setSpeechRate(JNIEnv *env, jobject thiz, jint jniData, - int speechRate) + jint speechRate) { if (jniData == 0) { LOGE("android_tts_SynthProxy_setSpeechRate(): invalid JNI data"); @@ -316,6 +316,28 @@ android_tts_SynthProxy_setSpeechRate(JNIEnv *env, jobject thiz, jint jniData, } +static void +android_tts_SynthProxy_setPitch(JNIEnv *env, jobject thiz, jint jniData, + jint pitch) +{ + if (jniData == 0) { + LOGE("android_tts_SynthProxy_setPitch(): invalid JNI data"); + return; + } + + int bufSize = 10; + char buffer [bufSize]; + sprintf(buffer, "%d", pitch); + + SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData; + LOGI("setting pitch to %d", pitch); + // TODO check return codes + if (pSynthData->mNativeSynthInterface) { + pSynthData->mNativeSynthInterface->setProperty("pitch", buffer, bufSize); + } +} + + // TODO: Refactor this to get rid of any assumptions about sample rate, etc. static void android_tts_SynthProxy_synthesizeToFile(JNIEnv *env, jobject thiz, jint jniData, @@ -541,6 +563,10 @@ static JNINativeMethod gMethods[] = { "(II)V", (void*)android_tts_SynthProxy_setSpeechRate }, + { "native_setPitch", + "(II)V", + (void*)android_tts_SynthProxy_setPitch + }, { "native_playAudioBuffer", "(III)V", (void*)android_tts_SynthProxy_playAudioBuffer diff --git a/packages/TtsService/src/android/tts/SynthProxy.java b/packages/TtsService/src/android/tts/SynthProxy.java index 364dc588a602..3bdff376429c 100755 --- a/packages/TtsService/src/android/tts/SynthProxy.java +++ b/packages/TtsService/src/android/tts/SynthProxy.java @@ -81,6 +81,12 @@ public class SynthProxy { native_setSpeechRate(mJniData, speechRate); } + /** + * Sets the pitch of the synthesized voice + */ + public final void setPitch(int pitch) { + native_setPitch(mJniData, pitch); + } /** * Plays the given audio buffer @@ -145,6 +151,8 @@ public class SynthProxy { String variant); private native final void native_setSpeechRate(int jniData, int speechRate); + + private native final void native_setPitch(int jniData, int speechRate); // TODO add buffer format private native final void native_playAudioBuffer(int jniData, int bufferPointer, int bufferSize); diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index e9c4ab74d27f..21f56f853623 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -152,7 +152,6 @@ public class TtsService extends Service implements OnCompletionListener { // speech rate setSpeechRate(getDefaultRate()); - // TODO handle default pitch } @@ -179,6 +178,12 @@ public class TtsService extends Service implements OnCompletionListener { } } + + private void setPitch(int pitch) { + nativeSynth.setPitch(pitch); + } + + private void setLanguage(String lang, String country, String variant) { Log.v("TTS", "TtsService.setLanguage("+lang+", "+country+", "+variant+")"); if (isDefaultEnforced()) { @@ -706,6 +711,17 @@ public class TtsService extends Service implements OnCompletionListener { } /** + * Sets the pitch for the TTS. Note that this will only have an + * effect on synthesized speech; it will not affect pre-recorded speech. + * + * @param pitch + * The pitch that should be used for the synthesized voice + */ + public void setPitch(int pitch) { + mSelf.setPitch(pitch); + } + + /** * Sets the speech rate for the TTS, which affects the synthesized voice. * * @param lang the three letter ISO language code. diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 8cf1cc2e813f..16bb29db267e 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -4869,9 +4869,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen isRestrictedBackupMode = (mBackupTarget.backupMode == BackupRecord.RESTORE) || (mBackupTarget.backupMode == BackupRecord.BACKUP_FULL); } - ensurePackageDexOpt(app.info.packageName); - if (app.instrumentationInfo != null) { - ensurePackageDexOpt(app.instrumentationInfo.packageName); + ensurePackageDexOpt(app.instrumentationInfo != null + ? app.instrumentationInfo.packageName + : app.info.packageName); + if (app.instrumentationClass != null) { + ensurePackageDexOpt(app.instrumentationClass.getPackageName()); } thread.bindApplication(processName, app.instrumentationInfo != null ? app.instrumentationInfo : app.info, providers, diff --git a/telephony/java/com/android/internal/telephony/cdma/SignalToneUtil.java b/telephony/java/com/android/internal/telephony/cdma/SignalToneUtil.java index 925a755d2925..44958e950a0d 100644 --- a/telephony/java/com/android/internal/telephony/cdma/SignalToneUtil.java +++ b/telephony/java/com/android/internal/telephony/cdma/SignalToneUtil.java @@ -22,6 +22,9 @@ import android.util.Log; import android.media.ToneGenerator; public class SignalToneUtil { + /** A marker that isn't a valid TONE */ + public static final int CDMA_INVALID_TONE = -1; + // public final int int IS95_CONST_IR_SIGNAL_TYPE_TYPE; static public final int IS95_CONST_IR_SIGNAL_TONE = 0; static public final int IS95_CONST_IR_SIGNAL_ISDN = 1; @@ -76,7 +79,7 @@ public class SignalToneUtil { private static Integer signalParamHash(int signalType, int alertPitch, int signal) { if ((signalType < 0) || (signalType > 256) || (alertPitch > 256) || (alertPitch < 0) || (signal > 256) || (signal < 0)) { - return new Integer(ToneGenerator.TONE_CDMA_INVALID); + return new Integer(CDMA_INVALID_TONE); } return new Integer(signalType * 256 * 256 + alertPitch * 256 + signal); } @@ -84,7 +87,7 @@ public class SignalToneUtil { public static int getAudioToneFromSignalInfo(int signalType, int alertPitch, int signal) { Integer result = hm.get(signalParamHash(signalType, alertPitch, signal)); if (result == null) { - return ToneGenerator.TONE_CDMA_INVALID; + return CDMA_INVALID_TONE; } return result; } @@ -100,13 +103,13 @@ public class SignalToneUtil { ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_ISDN, TAPIAMSSCDMA_SIGNAL_PITCH_UNKNOWN, - IS95_CONST_IR_SIG_ISDN_SP_PRI), ToneGenerator.TONE_CDMA_CALL_SIGNAL_SP_PRI); + IS95_CONST_IR_SIG_ISDN_SP_PRI), ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_ISDN, TAPIAMSSCDMA_SIGNAL_PITCH_UNKNOWN, IS95_CONST_IR_SIG_ISDN_PAT_3), ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_PAT3); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_ISDN, TAPIAMSSCDMA_SIGNAL_PITCH_UNKNOWN, - IS95_CONST_IR_SIG_ISDN_PING), ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_RING_RING); + IS95_CONST_IR_SIG_ISDN_PING), ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_ISDN, TAPIAMSSCDMA_SIGNAL_PITCH_UNKNOWN, IS95_CONST_IR_SIG_ISDN_PAT_5), ToneGenerator.TONE_CDMA_CALL_SIGNAL_ISDN_PAT5); @@ -163,7 +166,7 @@ public class SignalToneUtil { IS95_CONST_IR_SIG_IS54B_L), ToneGenerator.TONE_CDMA_HIGH_L); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_IS54B, IS95_CONST_IR_ALERT_MED, - IS95_CONST_IR_SIG_IS54B_L), ToneGenerator.TONE_CDMA_INVALID); + IS95_CONST_IR_SIG_IS54B_L), ToneGenerator.TONE_CDMA_MED_L); hm.put(signalParamHash(IS95_CONST_IR_SIGNAL_IS54B, IS95_CONST_IR_ALERT_LOW, IS95_CONST_IR_SIG_IS54B_L), ToneGenerator.TONE_CDMA_LOW_L); diff --git a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java b/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java index dc6860a9aa20..719e758e96a8 100644 --- a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java +++ b/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java @@ -22,10 +22,12 @@ import android.os.Binder; import android.os.IHardwareService; import android.os.RemoteException; import android.os.ServiceManager; +import android.test.suitebuilder.annotation.SmallTest; /** * Verify that Hardware apis cannot be called without required permissions. */ +@SmallTest public class HardwareServicePermissionTest extends TestCase { private IHardwareService mHardwareService; |