diff options
Diffstat (limited to 'packages')
8 files changed, 127 insertions, 40 deletions
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml index aa4e97a..afbceff 100644 --- a/packages/SystemUI/res/values-es/strings.xml +++ b/packages/SystemUI/res/values-es/strings.xml @@ -47,7 +47,7 @@ <string name="status_bar_settings_auto_brightness_label" msgid="511453614962324674">"AUTO"</string> <string name="status_bar_settings_notifications" msgid="397146176280905137">"Notificaciones"</string> <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth anclado"</string> - <string name="status_bar_input_method_settings_configure_input_methods" msgid="3504292471512317827">"Configurar métodos de introducción"</string> + <string name="status_bar_input_method_settings_configure_input_methods" msgid="3504292471512317827">"Configurar métodos de entrada"</string> <string name="status_bar_use_physical_keyboard" msgid="7551903084416057810">"Teclado físico"</string> <string name="usb_device_permission_prompt" msgid="834698001271562057">"¿Permitir que la aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> acceda al dispositivo USB?"</string> <string name="usb_accessory_permission_prompt" msgid="5171775411178865750">"¿Permitir que la aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> acceda al accesorio USB?"</string> @@ -77,7 +77,7 @@ <string name="accessibility_home" msgid="8217216074895377641">"Inicio"</string> <string name="accessibility_menu" msgid="316839303324695949">"Menú"</string> <string name="accessibility_recent" msgid="8571350598987952883">"Aplicaciones recientes"</string> - <string name="accessibility_ime_switch_button" msgid="5032926134740456424">"Botón Cambiar método de introducción"</string> + <string name="accessibility_ime_switch_button" msgid="5032926134740456424">"Botón Cambiar método de entrada"</string> <string name="accessibility_compatibility_zoom_button" msgid="8461115318742350699">"Botón de zoom de compatibilidad"</string> <string name="accessibility_compatibility_zoom_example" msgid="4220687294564945780">"Zoom de pantalla más pequeña a más grande"</string> <string name="accessibility_bluetooth_connected" msgid="2707027633242983370">"Bluetooth conectado"</string> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 6a96c6b..6c40461 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -68,7 +68,7 @@ <dimen name="status_bar_icon_drawing_size">18dip</dimen> <!-- opacity at which Notification icons will be drawn in the status bar --> - <item type="dimen" name="status_bar_icon_drawing_alpha">55%</item> + <item type="dimen" name="status_bar_icon_drawing_alpha">65%</item> <!-- gap on either side of status bar notification icons --> <dimen name="status_bar_icon_padding">0dp</dimen> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 1eb353f..f18e33e 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -117,7 +117,7 @@ </string> <!-- Separator for PLMN and SPN in network name. --> - <string name="status_bar_network_name_separator" translatable="false">"\n"</string> + <string name="status_bar_network_name_separator" translatable="false">|</string> <!-- Network connection string for Bluetooth Reverse Tethering --> <string name="bluetooth_tethered">Bluetooth tethered</string> diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java index 48efbc7..5dd15c3 100644 --- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java +++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java @@ -22,15 +22,13 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; -import android.util.Log; +import android.util.Slog; import android.view.Gravity; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; -import android.widget.ScrollView; -import android.widget.FrameLayout; public class ExpandHelper implements Gefingerpoken, OnClickListener { public interface Callback { @@ -41,7 +39,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } private static final String TAG = "ExpandHelper"; - protected static final boolean DEBUG = true; + protected static final boolean DEBUG = false; private static final long EXPAND_DURATION = 250; private static final long GLOW_DURATION = 150; @@ -95,7 +93,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mView = v; } public void setHeight(float h) { - if (DEBUG) Log.v(TAG, "SetHeight: setting to " + h); + if (DEBUG) Slog.v(TAG, "SetHeight: setting to " + h); ViewGroup.LayoutParams lp = mView.getLayoutParams(); lp.height = (int)h; mView.setLayoutParams(lp); @@ -110,7 +108,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } public int getNaturalHeight(int maximum) { ViewGroup.LayoutParams lp = mView.getLayoutParams(); - if (DEBUG) Log.v(TAG, "Inspecting a child of type: " + mView.getClass().getName()); + if (DEBUG) Slog.v(TAG, "Inspecting a child of type: " + mView.getClass().getName()); int oldHeight = lp.height; lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; mView.setLayoutParams(lp); @@ -176,7 +174,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { - if (DEBUG) Log.v(TAG, "onscalebegin()"); + if (DEBUG) Slog.v(TAG, "onscalebegin()"); float x = detector.getFocusX(); float y = detector.getFocusY(); @@ -194,7 +192,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { // your fingers have to be somewhat close to the bounds of the view in question mInitialTouchFocusY = detector.getFocusY(); mInitialTouchSpan = Math.abs(detector.getCurrentSpan()); - if (DEBUG) Log.d(TAG, "got mInitialTouchSpan: (" + mInitialTouchSpan + ")"); + if (DEBUG) Slog.d(TAG, "got mInitialTouchSpan: (" + mInitialTouchSpan + ")"); mStretching = initScale(v); return mStretching; @@ -202,7 +200,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { @Override public boolean onScale(ScaleGestureDetector detector) { - if (DEBUG) Log.v(TAG, "onscale() on " + mCurrView); + if (DEBUG) Slog.v(TAG, "onscale() on " + mCurrView); // are we scaling or dragging? float span = Math.abs(detector.getCurrentSpan()) - mInitialTouchSpan; @@ -212,28 +210,28 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { drag *= mGravity == Gravity.BOTTOM ? -1f : 1f; float pull = Math.abs(drag) + Math.abs(span) + 1f; float hand = drag * Math.abs(drag) / pull + span * Math.abs(span) / pull; - if (DEBUG) Log.d(TAG, "current span handle is: " + hand); + if (DEBUG) Slog.d(TAG, "current span handle is: " + hand); hand = hand + mOldHeight; float target = hand; - if (DEBUG) Log.d(TAG, "target is: " + target); + if (DEBUG) Slog.d(TAG, "target is: " + target); hand = hand < mSmallSize ? mSmallSize : (hand > mLargeSize ? mLargeSize : hand); hand = hand > mNaturalHeight ? mNaturalHeight : hand; - if (DEBUG) Log.d(TAG, "scale continues: hand =" + hand); + if (DEBUG) Slog.d(TAG, "scale continues: hand =" + hand); mScaler.setHeight(hand); // glow if overscale float stretch = (float) Math.abs((target - hand) / mMaximumStretch); float strength = 1f / (1f + (float) Math.pow(Math.E, -1 * ((8f * stretch) - 5f))); - if (DEBUG) Log.d(TAG, "stretch: " + stretch + " strength: " + strength); + if (DEBUG) Slog.d(TAG, "stretch: " + stretch + " strength: " + strength); setGlow(GLOW_BASE + strength * (1f - GLOW_BASE)); return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { - if (DEBUG) Log.v(TAG, "onscaleend()"); + if (DEBUG) Slog.v(TAG, "onscaleend()"); // I guess we're alone now - if (DEBUG) Log.d(TAG, "scale end"); + if (DEBUG) Slog.d(TAG, "scale end"); finishScale(false); } }); @@ -279,7 +277,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } public boolean onInterceptTouchEvent(MotionEvent ev) { - if (DEBUG) Log.d(TAG, "interceptTouch: act=" + (ev.getAction()) + + if (DEBUG) Slog.d(TAG, "interceptTouch: act=" + (ev.getAction()) + " stretching=" + mStretching); mDetector.onTouchEvent(ev); return mStretching; @@ -287,15 +285,15 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { public boolean onTouchEvent(MotionEvent ev) { final int action = ev.getAction(); - if (DEBUG) Log.d(TAG, "touch: act=" + (action) + " stretching=" + mStretching); + if (DEBUG) Slog.d(TAG, "touch: act=" + (action) + " stretching=" + mStretching); if (mStretching) { - if (DEBUG) Log.d(TAG, "detector ontouch"); + if (DEBUG) Slog.d(TAG, "detector ontouch"); mDetector.onTouchEvent(ev); } switch (action) { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: - if (DEBUG) Log.d(TAG, "cancel"); + if (DEBUG) Slog.d(TAG, "cancel"); mStretching = false; clearView(); break; @@ -304,20 +302,20 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } private boolean initScale(View v) { if (v != null) { - if (DEBUG) Log.d(TAG, "scale begins on view: " + v); + if (DEBUG) Slog.d(TAG, "scale begins on view: " + v); mStretching = true; setView(v); setGlow(GLOW_BASE); mScaler.setView(v); mOldHeight = mScaler.getHeight(); if (mCallback.canChildBeExpanded(v)) { - if (DEBUG) Log.d(TAG, "working on an expandable child"); + if (DEBUG) Slog.d(TAG, "working on an expandable child"); mNaturalHeight = mScaler.getNaturalHeight(mLargeSize); } else { - if (DEBUG) Log.d(TAG, "working on a non-expandable child"); + if (DEBUG) Slog.d(TAG, "working on a non-expandable child"); mNaturalHeight = mOldHeight; } - if (DEBUG) Log.d(TAG, "got mOldHeight: " + mOldHeight + + if (DEBUG) Slog.d(TAG, "got mOldHeight: " + mOldHeight + " mNaturalHeight: " + mNaturalHeight); v.getParent().requestDisallowInterceptTouchEvent(true); } @@ -342,7 +340,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mStretching = false; setGlow(0f); mCallback.setUserExpandedChild(mCurrView, h == mNaturalHeight); - if (DEBUG) Log.d(TAG, "scale was finished on view: " + mCurrView); + if (DEBUG) Slog.d(TAG, "scale was finished on view: " + mCurrView); clearView(); } @@ -362,7 +360,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { String debugLog = "Looking for glows: " + (mCurrViewTopGlow != null ? "found top " : "didn't find top") + (mCurrViewBottomGlow != null ? "found bottom " : "didn't find bottom"); - Log.v(TAG, debugLog); + Slog.v(TAG, debugLog); } } } diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index bec9aa2..0bdf84a 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -790,7 +790,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener if (DEBUG) Log.v(TAG, "Starting activity " + intent); context.startActivity(intent, opts.toBundle()); } - if (!usingDrawingCache) { + if (usingDrawingCache) { holder.thumbnailViewImage.setDrawingCacheEnabled(false); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index baf86f3..3c19ad2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -462,11 +462,12 @@ public class PhoneStatusBar extends BaseStatusBar { signalCluster.setNetworkController(mNetworkController); if (SHOW_CARRIER_LABEL) { - // for wifi-only devices, we show SSID; otherwise, we show PLMN + // for mobile devices, we always show mobile connection info here (SPN/PLMN) + // for other devices, we show whatever network is connected if (mNetworkController.hasMobileDataFeature()) { mNetworkController.addMobileLabelView(mCarrierLabel); } else { - mNetworkController.addWifiLabelView(mCarrierLabel); + mNetworkController.addCombinedLabelView(mCarrierLabel); } } @@ -820,6 +821,23 @@ public class PhoneStatusBar extends BaseStatusBar { R.integer.config_show_search_delay); } + // Q: What kinds of notifications should show during setup? + // A: Almost none! Only things coming from the system (package is "android") that also + // have special "kind" tags marking them as relevant for setup (see below). + private boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) { + if ("android".equals(sbn.pkg)) { + if (sbn.notification.kind != null) { + for (String aKind : sbn.notification.kind) { + // IME switcher, created by InputMethodManagerService + if ("android.system.imeswitcher".equals(aKind)) return true; + // OTA availability & errors, created by SystemUpdateService + if ("android.system.update".equals(aKind)) return true; + } + } + } + return false; + } + private void loadNotificationShade() { if (mPile == null) return; @@ -831,7 +849,7 @@ public class PhoneStatusBar extends BaseStatusBar { // If the device hasn't been through Setup, we only show system notifications for (int i=0; i<N; i++) { Entry ent = mNotificationData.get(N-i-1); - if (provisioned || "android".equals(ent.notification.pkg)) { + if (provisioned || showNotificationEvenIfUnprovisioned(ent.notification)) { toShow.add(ent.row); } } @@ -886,7 +904,7 @@ public class PhoneStatusBar extends BaseStatusBar { for (int i=0; i<N; i++) { Entry ent = mNotificationData.get(N-i-1); if ((provisioned && ent.notification.score >= HIDE_ICONS_BELOW_SCORE) - || "android".equals(ent.notification.pkg)) { + || showNotificationEvenIfUnprovisioned(ent.notification)) { toShow.add(ent.icon); } } @@ -1376,12 +1394,59 @@ public class PhoneStatusBar extends BaseStatusBar { if (!mTracking) return; mTracking = false; - mPile.setLayerType(View.LAYER_TYPE_NONE, null); + setPileLayers(View.LAYER_TYPE_NONE); mVelocityTracker.recycle(); mVelocityTracker = null; mCloseView.setPressed(false); } + /** + * Enables or disables layers on the children of the notifications pile. + * + * When layers are enabled, this method attempts to enable layers for the minimal + * number of children. Only children visible when the notification area is fully + * expanded will receive a layer. The technique used in this method might cause + * more children than necessary to get a layer (at most one extra child with the + * current UI.) + * + * @param layerType {@link View#LAYER_TYPE_NONE} or {@link View#LAYER_TYPE_HARDWARE} + */ + private void setPileLayers(int layerType) { + final int count = mPile.getChildCount(); + + switch (layerType) { + case View.LAYER_TYPE_NONE: + for (int i = 0; i < count; i++) { + mPile.getChildAt(i).setLayerType(layerType, null); + } + break; + case View.LAYER_TYPE_HARDWARE: + final int[] location = new int[2]; + mNotificationPanel.getLocationInWindow(location); + + final int left = location[0]; + final int top = location[1]; + final int right = left + mNotificationPanel.getWidth(); + final int bottom = top + getExpandedViewMaxHeight(); + + final Rect childBounds = new Rect(); + + for (int i = 0; i < count; i++) { + final View view = mPile.getChildAt(i); + view.getLocationInWindow(location); + + childBounds.set(location[0], location[1], + location[0] + view.getWidth(), location[1] + view.getHeight()); + + if (childBounds.intersects(left, top, right, bottom)) { + view.setLayerType(layerType, null); + } + } + + break; + } + } + void incrementAnim(long frameTimeNanos) { final long deltaNanos = Math.max(frameTimeNanos - mAnimLastTimeNanos, 0); final float t = deltaNanos * 0.000000001f; // ns -> s @@ -1421,7 +1486,7 @@ public class PhoneStatusBar extends BaseStatusBar { mCloseView.setPressed(true); mTracking = true; - mPile.setLayerType(View.LAYER_TYPE_HARDWARE, null); + setPileLayers(View.LAYER_TYPE_HARDWARE); mVelocityTracker = VelocityTracker.obtain(); if (opening) { makeExpandedVisible(true); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java index bb0ce16..82d6a99 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java @@ -46,7 +46,7 @@ public class KeyButtonView extends ImageView { private static final String TAG = "StatusBar.KeyButtonView"; final float GLOW_MAX_SCALE_FACTOR = 1.8f; - final float BUTTON_QUIESCENT_ALPHA = 0.6f; + final float BUTTON_QUIESCENT_ALPHA = 0.70f; long mDownTime; int mCode; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index b8f6054..1068267 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -121,8 +121,12 @@ public class NetworkController extends BroadcastReceiver { private int mWimaxSignal = 0; private int mWimaxState = 0; private int mWimaxExtraState = 0; + // data connectivity (regardless of state, can we access the internet?) // state of inet connection - 0 not connected, 100 connected + private boolean mConnected = false; + private int mConnectedNetworkType = ConnectivityManager.TYPE_NONE; + private String mConnectedNetworkTypeName; private int mInetCondition = 0; private static final int INET_CONDITION_THRESHOLD = 50; @@ -868,6 +872,16 @@ public class NetworkController extends BroadcastReceiver { .getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo info = connManager.getActiveNetworkInfo(); + // Are we connected at all, by any interface? + mConnected = info != null && info.isConnected(); + if (mConnected) { + mConnectedNetworkType = info.getType(); + mConnectedNetworkTypeName = info.getTypeName(); + } else { + mConnectedNetworkType = ConnectivityManager.TYPE_NONE; + mConnectedNetworkTypeName = null; + } + int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); if (CHATTY) { @@ -912,12 +926,13 @@ public class NetworkController extends BroadcastReceiver { // - We are connected to mobile data, or // - We are not connected to mobile data, as long as the *reason* packets are not // being routed over that link is that we have better connectivity via wifi. - // If data is disconnected for some other reason but wifi is connected, we show nothing. + // If data is disconnected for some other reason but wifi (or ethernet/bluetooth) + // is connected, we show nothing. // Otherwise (nothing connected) we show "No internet connection". if (mDataConnected) { mobileLabel = mNetworkName; - } else if (mWifiConnected) { + } else if (mConnected) { if (hasService()) { mobileLabel = mNetworkName; } else { @@ -997,6 +1012,12 @@ public class NetworkController extends BroadcastReceiver { R.string.accessibility_bluetooth_tether); } + final boolean ethernetConnected = (mConnectedNetworkType == ConnectivityManager.TYPE_ETHERNET); + if (ethernetConnected) { + // TODO: icons and strings for Ethernet connectivity + combinedLabel = mConnectedNetworkTypeName; + } + if (mAirplaneMode && (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) { // Only display the flight-mode icon if not in "emergency calls only" mode. @@ -1023,7 +1044,7 @@ public class NetworkController extends BroadcastReceiver { combinedSignalIconId = mDataSignalIconId; } } - else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected) { + else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected && !ethernetConnected) { // pretty much totally disconnected combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected); @@ -1224,6 +1245,9 @@ public class NetworkController extends BroadcastReceiver { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("NetworkController state:"); + pw.println(String.format(" %s network type %d (%s)", + mConnected?"CONNECTED":"DISCONNECTED", + mConnectedNetworkType, mConnectedNetworkTypeName)); pw.println(" - telephony ------"); pw.print(" hasService()="); pw.println(hasService()); |