diff options
24 files changed, 187 insertions, 113 deletions
diff --git a/api/current.txt b/api/current.txt index 689cdff..ed0d154 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23774,6 +23774,8 @@ package android.telephony { method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getGroupIdLevel1(); method public java.lang.String getLine1Number(); + method public java.lang.String getMmsUAProfUrl(); + method public java.lang.String getMmsUserAgent(); method public java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo(); method public java.lang.String getNetworkCountryIso(); method public java.lang.String getNetworkOperator(); diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java index 01977cd..d678f1e 100644 --- a/core/java/android/net/CaptivePortalTracker.java +++ b/core/java/android/net/CaptivePortalTracker.java @@ -179,10 +179,6 @@ public class CaptivePortalTracker extends StateMachine { } private class DefaultState extends State { - @Override - public void enter() { - setNotificationOff(); - } @Override public boolean processMessage(Message message) { @@ -208,6 +204,7 @@ public class CaptivePortalTracker extends StateMachine { private class NoActiveNetworkState extends State { @Override public void enter() { + setNotificationOff(); mNetworkInfo = null; } @@ -237,11 +234,6 @@ public class CaptivePortalTracker extends StateMachine { private class ActiveNetworkState extends State { @Override - public void enter() { - setNotificationOff(); - } - - @Override public boolean processMessage(Message message) { NetworkInfo info; switch (message.what) { @@ -284,6 +276,8 @@ public class CaptivePortalTracker extends StateMachine { if (DBG) log(getName() + message.toString()); switch (message.what) { case CMD_DELAYED_CAPTIVE_CHECK: + setNotificationOff(); + if (message.arg1 == mDelayedCheckToken) { InetAddress server = lookupHost(mServer); boolean captive = server != null && isCaptivePortal(server); @@ -362,8 +356,10 @@ public class CaptivePortalTracker extends StateMachine { private void setNotificationOff() { try { - mConnService.setProvisioningNotificationVisible(false, ConnectivityManager.TYPE_NONE, + if (mNetworkInfo != null) { + mConnService.setProvisioningNotificationVisible(false, mNetworkInfo.getType(), null, null); + } } catch (RemoteException e) { log("setNotificationOff: " + e); } diff --git a/core/java/android/webkit/CookieSyncManager.java b/core/java/android/webkit/CookieSyncManager.java index 13aa43f..154a290 100644 --- a/core/java/android/webkit/CookieSyncManager.java +++ b/core/java/android/webkit/CookieSyncManager.java @@ -89,6 +89,10 @@ public final class CookieSyncManager extends WebSyncManager { if (context == null) { throw new IllegalArgumentException("Invalid context argument"); } + // TODO: Remove this workaround after webview classic is no longer supported. + if (WebViewFactory.getProvider().getClass().getName().contains("WebViewClassic")) { + WebViewDatabase.getInstance(context); + } setGetInstanceIsAllowed(); return getInstance(); diff --git a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java index 6471e14..23ed019 100644 --- a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java +++ b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java @@ -216,6 +216,8 @@ public class ActionMenuPresenter extends BaseMenuPresenter } super.updateMenuView(cleared); + ((View) mMenuView).requestLayout(); + if (mMenu != null) { final ArrayList<MenuItemImpl> actionItems = mMenu.getActionItems(); final int count = actionItems.size(); diff --git a/core/java/com/android/internal/view/menu/ActionMenuView.java b/core/java/com/android/internal/view/menu/ActionMenuView.java index 34ade74..16a2031 100644 --- a/core/java/com/android/internal/view/menu/ActionMenuView.java +++ b/core/java/com/android/internal/view/menu/ActionMenuView.java @@ -15,8 +15,6 @@ */ package com.android.internal.view.menu; -import com.android.internal.R; - import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; @@ -27,6 +25,7 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.widget.LinearLayout; +import com.android.internal.R; /** * @hide @@ -101,7 +100,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo // Special formatting can change whether items can fit as action buttons. // Kick the menu and update presenters when this changes. - final int widthSize = MeasureSpec.getMode(widthMeasureSpec); + final int widthSize = MeasureSpec.getSize(widthMeasureSpec); if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) { mFormatItemsWidth = widthSize; mMenu.onItemsChanged(true); diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java index 458ea2f..aff697a 100644 --- a/core/java/com/android/internal/view/menu/MenuBuilder.java +++ b/core/java/com/android/internal/view/menu/MenuBuilder.java @@ -1034,6 +1034,10 @@ public class MenuBuilder implements Menu { * to avoid inadvertent reordering that may break the app's intended design. */ public void flagActionItems() { + // Important side effect: if getVisibleItems is stale it may refresh, + // which can affect action items staleness. + final ArrayList<MenuItemImpl> visibleItems = getVisibleItems(); + if (!mIsActionItemsStale) { return; } @@ -1052,7 +1056,6 @@ public class MenuBuilder implements Menu { if (flagged) { mActionItems.clear(); mNonActionItems.clear(); - ArrayList<MenuItemImpl> visibleItems = getVisibleItems(); final int itemsSize = visibleItems.size(); for (int i = 0; i < itemsSize; i++) { MenuItemImpl item = visibleItems.get(i); diff --git a/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java b/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java index aad285a..cd1ccd3 100644 --- a/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java +++ b/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java @@ -76,7 +76,7 @@ public class GlowPadView extends View { } // Tuneable parameters for animation - private static final int WAVE_ANIMATION_DURATION = 1350; + private static final int WAVE_ANIMATION_DURATION = 1000; private static final int RETURN_TO_HOME_DELAY = 1200; private static final int RETURN_TO_HOME_DURATION = 200; private static final int HIDE_ANIMATION_DELAY = 200; diff --git a/core/java/com/android/internal/widget/multiwaveview/PointCloud.java b/core/java/com/android/internal/widget/multiwaveview/PointCloud.java index bbd1276..f299935 100644 --- a/core/java/com/android/internal/widget/multiwaveview/PointCloud.java +++ b/core/java/com/android/internal/widget/multiwaveview/PointCloud.java @@ -45,8 +45,8 @@ public class PointCloud { public class WaveManager { private float radius = 50; - private float width = 200.0f; // TODO: Make configurable private float alpha = 0.0f; + public void setRadius(float r) { radius = r; } @@ -186,13 +186,12 @@ public class PointCloud { // Compute contribution from Wave float radius = hypot(point.x, point.y); - float distanceToWaveRing = (radius - waveManager.radius); float waveAlpha = 0.0f; - if (distanceToWaveRing < waveManager.width * 0.5f && distanceToWaveRing < 0.0f) { - float cosf = FloatMath.cos(PI * 0.25f * distanceToWaveRing / waveManager.width); - waveAlpha = waveManager.alpha * max(0.0f, (float) Math.pow(cosf, 20.0f)); + if (radius < waveManager.radius * 2) { + float distanceToWaveRing = (radius - waveManager.radius); + float cosf = FloatMath.cos(PI * 0.5f * distanceToWaveRing / waveManager.radius); + waveAlpha = waveManager.alpha * max(0.0f, (float) Math.pow(cosf, 6.0f)); } - return (int) (max(glowAlpha, waveAlpha) * 255); } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index e39fd2a..1ddf201 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -961,6 +961,12 @@ If false, Content-disposition fragments are ignored --> <bool name="config_mms_content_disposition_support">true</bool> + <!-- MMS user agent string --> + <string name="config_mms_user_agent" translatable="false"></string> + + <!-- MMS user agent prolfile url --> + <string name="config_mms_user_agent_profile_url" translatable="false"></string> + <!-- National Language Identifier codes for the following two config items. (from 3GPP TS 23.038 V9.1.1 Table 6.2.1.2.4.1): 0 - reserved diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index d483fe0..a541995 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -469,6 +469,8 @@ <java-symbol type="string" name="chooseActivity" /> <java-symbol type="string" name="config_default_dns_server" /> <java-symbol type="string" name="config_ethernet_iface_regex" /> + <java-symbol type="string" name="config_mms_user_agent" /> + <java-symbol type="string" name="config_mms_user_agent_profile_url" /> <java-symbol type="string" name="config_ntpServer" /> <java-symbol type="string" name="config_tether_apndata" /> <java-symbol type="string" name="config_useragentprofile_url" /> diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 84ea4c9..49c838c 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -217,7 +217,7 @@ public class AudioService extends IAudioService.Stub { * stream types that follow other stream behavior for volume settings * NOTE: do not create loops in aliases! * Some streams alias to different streams according to device category (phone or tablet) or - * use case (in call s off call...).See updateStreamVolumeAlias() for more details + * use case (in call vs off call...). See updateStreamVolumeAlias() for more details. * mStreamVolumeAlias contains the default aliases for a voice capable device (phone) and * STREAM_VOLUME_ALIAS_NON_VOICE for a non voice capable device (tablet).*/ private final int[] STREAM_VOLUME_ALIAS = new int[] { @@ -301,7 +301,7 @@ public class AudioService extends IAudioService.Stub { private int mRingerMode; /** @see System#MODE_RINGER_STREAMS_AFFECTED */ - private int mRingerModeAffectedStreams; + private int mRingerModeAffectedStreams = 0; // Streams currently muted by ringer mode private int mRingerModeMutedStreams; @@ -511,9 +511,11 @@ public class AudioService extends IAudioService.Stub { mUseFixedVolume = mContext.getResources().getBoolean( com.android.internal.R.bool.config_useFixedVolume); + // must be called before readPersistedSettings() which needs a valid mStreamVolumeAlias[] + // array initialized by updateStreamVolumeAlias() + updateStreamVolumeAlias(false /*updateVolumes*/); readPersistedSettings(); mSettingsObserver = new SettingsObserver(); - updateStreamVolumeAlias(false /*updateVolumes*/); createStreamStates(); readAndSetLowRamDevice(); @@ -632,10 +634,15 @@ public class AudioService extends IAudioService.Stub { } if (isInCommunication()) { dtmfStreamAlias = AudioSystem.STREAM_VOICE_CALL; + mRingerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_DTMF); + } else { + mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_DTMF); } mStreamVolumeAlias[AudioSystem.STREAM_DTMF] = dtmfStreamAlias; if (updateVolumes) { mStreamStates[AudioSystem.STREAM_DTMF].setAllIndexes(mStreamStates[dtmfStreamAlias]); + // apply stream mute states according to new value of mRingerModeAffectedStreams + setRingerModeInt(getRingerMode(), false); sendMsg(mAudioHandler, MSG_SET_ALL_VOLUMES, SENDMSG_QUEUE, @@ -702,37 +709,7 @@ public class AudioService extends IAudioService.Stub { mHasVibrator ? AudioManager.VIBRATE_SETTING_ONLY_SILENT : AudioManager.VIBRATE_SETTING_OFF); - // make sure settings for ringer mode are consistent with device type: non voice capable - // devices (tablets) include media stream in silent mode whereas phones don't. - mRingerModeAffectedStreams = Settings.System.getIntForUser(cr, - Settings.System.MODE_RINGER_STREAMS_AFFECTED, - ((1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_NOTIFICATION)| - (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED)), - UserHandle.USER_CURRENT); - - // ringtone, notification and system streams are always affected by ringer mode - mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_RING)| - (1 << AudioSystem.STREAM_NOTIFICATION)| - (1 << AudioSystem.STREAM_SYSTEM); - - if (mVoiceCapable) { - mRingerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_MUSIC); - } else { - mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_MUSIC); - } - synchronized (mCameraSoundForced) { - if (mCameraSoundForced) { - mRingerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_SYSTEM_ENFORCED); - } else { - mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_SYSTEM_ENFORCED); - } - } - - Settings.System.putIntForUser(cr, - Settings.System.MODE_RINGER_STREAMS_AFFECTED, - mRingerModeAffectedStreams, - UserHandle.USER_CURRENT); - + updateRingerModeAffectedStreams(); readDockAudioSettings(cr); } @@ -2553,6 +2530,50 @@ public class AudioService extends IAudioService.Stub { return (mRingerModeMutedStreams & (1 << streamType)) != 0; } + boolean updateRingerModeAffectedStreams() { + int ringerModeAffectedStreams; + // make sure settings for ringer mode are consistent with device type: non voice capable + // devices (tablets) include media stream in silent mode whereas phones don't. + ringerModeAffectedStreams = Settings.System.getIntForUser(mContentResolver, + Settings.System.MODE_RINGER_STREAMS_AFFECTED, + ((1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_NOTIFICATION)| + (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED)), + UserHandle.USER_CURRENT); + + // ringtone, notification and system streams are always affected by ringer mode + ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_RING)| + (1 << AudioSystem.STREAM_NOTIFICATION)| + (1 << AudioSystem.STREAM_SYSTEM); + + if (mVoiceCapable) { + ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_MUSIC); + } else { + ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_MUSIC); + } + synchronized (mCameraSoundForced) { + if (mCameraSoundForced) { + ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_SYSTEM_ENFORCED); + } else { + ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_SYSTEM_ENFORCED); + } + } + if (mStreamVolumeAlias[AudioSystem.STREAM_DTMF] == AudioSystem.STREAM_RING) { + ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_DTMF); + } else { + ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_DTMF); + } + + if (ringerModeAffectedStreams != mRingerModeAffectedStreams) { + Settings.System.putIntForUser(mContentResolver, + Settings.System.MODE_RINGER_STREAMS_AFFECTED, + ringerModeAffectedStreams, + UserHandle.USER_CURRENT); + mRingerModeAffectedStreams = ringerModeAffectedStreams; + return true; + } + return false; + } + public boolean isStreamAffectedByMute(int streamType) { return (mMuteAffectedStreams & (1 << streamType)) != 0; } @@ -2948,13 +2969,25 @@ public class AudioService extends IAudioService.Stub { } public synchronized void setAllIndexes(VolumeStreamState srcStream) { - Set set = srcStream.mIndex.entrySet(); + int srcStreamType = srcStream.getStreamType(); + // apply default device volume from source stream to all devices first in case + // some devices are present in this stream state but not in source stream state + int index = srcStream.getIndex(AudioSystem.DEVICE_OUT_DEFAULT); + index = rescaleIndex(index, srcStreamType, mStreamType); + Set set = mIndex.entrySet(); Iterator i = set.iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); + entry.setValue(index); + } + // Now apply actual volume for devices in source stream state + set = srcStream.mIndex.entrySet(); + i = set.iterator(); + while (i.hasNext()) { + Map.Entry entry = (Map.Entry)i.next(); int device = ((Integer)entry.getKey()).intValue(); - int index = ((Integer)entry.getValue()).intValue(); - index = rescaleIndex(index, srcStream.getStreamType(), mStreamType); + index = ((Integer)entry.getValue()).intValue(); + index = rescaleIndex(index, srcStreamType, mStreamType); setIndex(index, device); } @@ -3643,29 +3676,11 @@ public class AudioService extends IAudioService.Stub { // and mRingerModeAffectedStreams, so will leave this synchronized for now. // mRingerModeMutedStreams and mMuteAffectedStreams are safe (only accessed once). synchronized (mSettingsLock) { - int ringerModeAffectedStreams = Settings.System.getIntForUser(mContentResolver, - Settings.System.MODE_RINGER_STREAMS_AFFECTED, - ((1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_NOTIFICATION)| - (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED)), - UserHandle.USER_CURRENT); - if (mVoiceCapable) { - ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_MUSIC); - } else { - ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_MUSIC); - } - synchronized (mCameraSoundForced) { - if (mCameraSoundForced) { - ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_SYSTEM_ENFORCED); - } else { - ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_SYSTEM_ENFORCED); - } - } - if (ringerModeAffectedStreams != mRingerModeAffectedStreams) { + if (updateRingerModeAffectedStreams()) { /* * Ensure all stream types that should be affected by ringer mode * are in the proper state. */ - mRingerModeAffectedStreams = ringerModeAffectedStreams; setRingerModeInt(getRingerMode(), false); } readDockAudioSettings(mContentResolver); diff --git a/media/java/android/media/RemoteController.java b/media/java/android/media/RemoteController.java index d056269..22f6343 100644 --- a/media/java/android/media/RemoteController.java +++ b/media/java/android/media/RemoteController.java @@ -153,7 +153,7 @@ public final class RemoteController * @param state one of the playback states authorized * in {@link RemoteControlClient#setPlaybackState(int)}. * @param stateChangeTimeMs the system time at which the state change was reported, - * expressed in ms. Based on {@link android.os.SystemClock.elapsedRealtime()}. + * expressed in ms. Based on {@link android.os.SystemClock#elapsedRealtime()}. * @param currentPosMs a positive value for the current media playback position expressed * in ms, a negative value if the position is temporarily unknown. * @param speed a value expressed as a ratio of 1x playback: 1.0f is normal playback, diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java index ec3eb15..dc28bd0 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java @@ -124,6 +124,7 @@ public class KeyguardViewMediator { private static final int SHOW_ASSISTANT = 14; private static final int DISPATCH_EVENT = 15; private static final int LAUNCH_CAMERA = 16; + private static final int DISMISS = 17; /** * The default amount of time we stay awake (used for all key input) @@ -910,12 +911,16 @@ public class KeyguardViewMediator { /** * Dismiss the keyguard through the security layers. */ - public void dismiss() { + public void handleDismiss() { if (mShowing && !mHidden) { mKeyguardViewManager.dismiss(); } } + public void dismiss() { + mHandler.sendEmptyMessage(DISMISS); + } + /** * Send message to keyguard telling it to reset its state. * @param options options about how to show the keyguard @@ -1014,14 +1019,13 @@ public class KeyguardViewMediator { }; public void keyguardDone(boolean authenticated, boolean wakeup) { - mKeyguardDonePending = false; + if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")"); + EventLog.writeEvent(70000, 2); synchronized (this) { - EventLog.writeEvent(70000, 2); - if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")"); - Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0, - wakeup ? 1 : 0); - mHandler.sendMessage(msg); + mKeyguardDonePending = false; } + Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0, wakeup ? 1 : 0); + mHandler.sendMessage(msg); } /** @@ -1037,31 +1041,31 @@ public class KeyguardViewMediator { switch (msg.what) { case SHOW: handleShow((Bundle) msg.obj); - return ; + break; case HIDE: handleHide(); - return ; + break; case RESET: handleReset((Bundle) msg.obj); - return ; + break; case VERIFY_UNLOCK: handleVerifyUnlock(); - return; + break; case NOTIFY_SCREEN_OFF: handleNotifyScreenOff(); - return; + break; case NOTIFY_SCREEN_ON: handleNotifyScreenOn((IKeyguardShowCallback) msg.obj); - return; + break; case KEYGUARD_DONE: handleKeyguardDone(msg.arg1 != 0, msg.arg2 != 0); - return; + break; case KEYGUARD_DONE_DRAWING: handleKeyguardDoneDrawing(); - return; + break; case KEYGUARD_DONE_AUTHENTICATING: keyguardDone(true, true); - return; + break; case SET_HIDDEN: handleSetHidden(msg.arg1 != 0); break; @@ -1079,6 +1083,9 @@ public class KeyguardViewMediator { case LAUNCH_CAMERA: handleLaunchCamera(); break; + case DISMISS: + handleDismiss(); + break; } } }; @@ -1178,8 +1185,7 @@ public class KeyguardViewMediator { private void updateActivityLockScreenState() { try { - ActivityManagerNative.getDefault().setLockScreenShown( - mShowing && !mHidden); + ActivityManagerNative.getDefault().setLockScreenShown(mShowing && !mHidden); } catch (RemoteException e) { } } diff --git a/packages/PrintSpooler/res/layout/select_printer_activity.xml b/packages/PrintSpooler/res/layout/select_printer_activity.xml index e86e9aa..2792dcf 100644 --- a/packages/PrintSpooler/res/layout/select_printer_activity.xml +++ b/packages/PrintSpooler/res/layout/select_printer_activity.xml @@ -38,25 +38,30 @@ android:layout_gravity="center" android:gravity="center" android:orientation="vertical"> - + <ImageView - android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="12dip" android:src="@*android:drawable/ic_grayedout_printer" - android:contentDescription="@string/print_no_printers_found"> + android:contentDescription="@string/print_searching_for_printers"> </ImageView> <TextView - android:id="@+id/message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="?android:attr/textColorSecondary" - android:text="@string/print_no_printers_found"> + android:text="@string/print_searching_for_printers"> </TextView> + <ProgressBar + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:indeterminate="true" + style="@android:style/Widget.Holo.ProgressBar.Horizontal"> + </ProgressBar> + </LinearLayout> </FrameLayout> diff --git a/packages/PrintSpooler/res/values/strings.xml b/packages/PrintSpooler/res/values/strings.xml index 41775a1..5b947ba 100644 --- a/packages/PrintSpooler/res/values/strings.xml +++ b/packages/PrintSpooler/res/values/strings.xml @@ -84,7 +84,7 @@ <string name="choose_print_service">Choose print service</string> <!-- Title for the prompt shown as a placeholder if no printers are found while searching. [CHAR LIMIT=50] --> - <string name="print_no_printers_found">No printers found</string> + <string name="print_searching_for_printers">Searching for printers</string> <!-- Notifications --> diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 8474115..0c593ef 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -1613,7 +1613,6 @@ public class PrintJobConfigActivity extends Activity { mCopiesEditText = (EditText) findViewById(R.id.copies_edittext); mCopiesEditText.setText(MIN_COPIES_STRING); mCopiesEditText.addTextChangedListener(mCopiesTextWatcher); - mCopiesEditText.selectAll(); if (!TextUtils.equals(mCopiesEditText.getText(), MIN_COPIES_STRING)) { mIgnoreNextCopiesChange = true; } @@ -1622,6 +1621,7 @@ public class PrintJobConfigActivity extends Activity { // Destination. mDestinationSpinner = (Spinner) findViewById(R.id.destination_spinner); + mDestinationSpinner.setDropDownWidth(ViewGroup.LayoutParams.MATCH_PARENT); mDestinationSpinner.setAdapter(mDestinationSpinnerAdapter); mDestinationSpinner.setOnItemSelectedListener(mOnItemSelectedListener); if (mDestinationSpinnerAdapter.getCount() > 0 && mController.hasStarted()) { @@ -1954,7 +1954,6 @@ public class PrintJobConfigActivity extends Activity { && TextUtils.isEmpty(mCopiesEditText.getText())) { mIgnoreNextCopiesChange = true; mCopiesEditText.setText(String.valueOf(MIN_COPIES)); - mCopiesEditText.selectAll(); mCopiesEditText.requestFocus(); } @@ -2151,6 +2150,8 @@ public class PrintJobConfigActivity extends Activity { R.layout.printer_dropdown_item, parent, false); } + convertView.getLayoutParams().width = mDestinationSpinner.getWidth(); + CharSequence title = null; CharSequence subtitle = null; Drawable icon = null; diff --git a/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java b/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java index c888e2c..114c151 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java +++ b/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java @@ -36,6 +36,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.print.PrintManager; @@ -53,6 +54,7 @@ import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; +import android.widget.ImageView; import android.widget.ListView; import android.widget.SearchView; import android.widget.TextView; @@ -357,11 +359,12 @@ public final class SelectPrinterFragment extends ListFragment { public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getActivity().getLayoutInflater().inflate( - R.layout.spinner_dropdown_item, parent, false); + R.layout.printer_dropdown_item, parent, false); } CharSequence title = null; CharSequence subtitle = null; + Drawable icon = null; PrinterInfo printer = (PrinterInfo) getItem(position); title = printer.getName(); @@ -370,6 +373,7 @@ public final class SelectPrinterFragment extends ListFragment { PackageInfo packageInfo = pm.getPackageInfo(printer.getId() .getServiceName().getPackageName(), 0); subtitle = packageInfo.applicationInfo.loadLabel(pm); + icon = packageInfo.applicationInfo.loadIcon(pm); } catch (NameNotFoundException nnfe) { /* ignore */ } @@ -386,6 +390,15 @@ public final class SelectPrinterFragment extends ListFragment { subtitleView.setVisibility(View.GONE); } + + ImageView iconView = (ImageView) convertView.findViewById(R.id.icon); + if (icon != null) { + iconView.setImageDrawable(icon); + iconView.setVisibility(View.VISIBLE); + } else { + iconView.setVisibility(View.GONE); + } + return convertView; } diff --git a/packages/SystemUI/res/drawable-hdpi/search_light.png b/packages/SystemUI/res/drawable-hdpi/search_light.png Binary files differindex 9a8f771..c8b5a2e 100644 --- a/packages/SystemUI/res/drawable-hdpi/search_light.png +++ b/packages/SystemUI/res/drawable-hdpi/search_light.png diff --git a/packages/SystemUI/res/drawable-mdpi/search_light.png b/packages/SystemUI/res/drawable-mdpi/search_light.png Binary files differindex c355b6a..4b5b2a4 100644 --- a/packages/SystemUI/res/drawable-mdpi/search_light.png +++ b/packages/SystemUI/res/drawable-mdpi/search_light.png diff --git a/packages/SystemUI/res/drawable-xhdpi/search_light.png b/packages/SystemUI/res/drawable-xhdpi/search_light.png Binary files differindex 68b70eb..3aa890f 100644 --- a/packages/SystemUI/res/drawable-xhdpi/search_light.png +++ b/packages/SystemUI/res/drawable-xhdpi/search_light.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/search_light.png b/packages/SystemUI/res/drawable-xxhdpi/search_light.png Binary files differindex faa97f8..74ad3c8 100644 --- a/packages/SystemUI/res/drawable-xxhdpi/search_light.png +++ b/packages/SystemUI/res/drawable-xxhdpi/search_light.png diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 3f13f3a..f005f5f 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -3987,8 +3987,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { return timeOutMs; } - // Start off with notification off - setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); + // Start off with mobile notification off + setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); CheckMp checkMp = new CheckMp(mContext, this); CheckMp.CallBack cb = new CheckMp.CallBack() { @@ -4013,7 +4013,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { } if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (redirected), url=" + url); - setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), + setProvNotificationVisible(true, + ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (redirected), no url"); @@ -4024,7 +4025,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { String url = getMobileProvisioningUrl(); if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), url=" + url); - setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), + setProvNotificationVisible(true, + ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url"); @@ -4426,7 +4428,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { private void handleMobileProvisioningAction(String url) { // Notication mark notification as not visible - setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); + setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); // If provisioning network handle as a special case, // otherwise launch browser with the intent directly. @@ -4512,14 +4514,14 @@ public class ConnectivityService extends IConnectivityManager.Stub { notification.setLatestEventInfo(mContext, title, details, notification.contentIntent); try { - notificationManager.notify(NOTIFICATION_ID, 1, notification); + notificationManager.notify(NOTIFICATION_ID, networkType, notification); } catch (NullPointerException npe) { loge("setNotificaitionVisible: visible notificationManager npe=" + npe); npe.printStackTrace(); } } else { try { - notificationManager.cancel(NOTIFICATION_ID, 1); + notificationManager.cancel(NOTIFICATION_ID, networkType); } catch (NullPointerException npe) { loge("setNotificaitionVisible: cancel notificationManager npe=" + npe); npe.printStackTrace(); diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index ef50df7..0e0f156 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -515,8 +515,9 @@ class ServerThread { ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity); networkStats.bindConnectivityManager(connectivity); networkPolicy.bindConnectivityManager(connectivity); - wifi.checkAndStartWifi(); + wifiP2p.connectivityServiceReady(); + wifi.checkAndStartWifi(); } catch (Throwable e) { reportWtf("starting Connectivity Service", e); } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7d8b64f..ea0d220 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1400,4 +1400,22 @@ public class TelephonyManager { } catch (NullPointerException ex) { } } + + /** + * Returns the MMS user agent. + */ + public String getMmsUserAgent() { + if (mContext == null) return null; + return mContext.getResources().getString( + com.android.internal.R.string.config_mms_user_agent); + } + + /** + * Returns the MMS user agent profile URL. + */ + public String getMmsUAProfUrl() { + if (mContext == null) return null; + return mContext.getResources().getString( + com.android.internal.R.string.config_mms_user_agent_profile_url); + } } |