diff options
19 files changed, 229 insertions, 28 deletions
| diff --git a/api/current.xml b/api/current.xml index acea195b7b4f..4841d014e2eb 100644 --- a/api/current.xml +++ b/api/current.xml @@ -15714,6 +15714,28 @@   visibility="public"  >  </field> +<field name="Theme_Holo_Light_NoActionBar" + type="int" + transient="false" + volatile="false" + value="16974064" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="Theme_Holo_Light_NoActionBar_Fullscreen" + type="int" + transient="false" + volatile="false" + value="16974065" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field>  <field name="Theme_Holo_Light_Panel"   type="int"   transient="false" @@ -114476,6 +114498,28 @@   visibility="public"  >  </field> +<field name="TYPE_BLUETOOTH" + type="int" + transient="false" + volatile="false" + value="7" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_ETHERNET" + type="int" + transient="false" + volatile="false" + value="9" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field>  <field name="TYPE_MOBILE"   type="int"   transient="false" @@ -184515,6 +184559,17 @@   visibility="public"  >  </field> +<field name="NETWORK_TYPE_HSPAP" + type="int" + transient="false" + volatile="false" + value="15" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field>  <field name="NETWORK_TYPE_HSUPA"   type="int"   transient="false" @@ -267731,7 +267786,7 @@   deprecated="not deprecated"   visibility="public"  > -<parameter name="arg0" type="T"> +<parameter name="t" type="T">  </parameter>  </method>  </interface> diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index b541ec30c021..eaf919191911 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -165,14 +165,12 @@ public class ConnectivityManager      /**       * The Default Mobile data connection.  When active, all data traffic -     * will use this connection by default.  Should not coexist with other -     * default connections. +     * will use this connection by default.       */      public static final int TYPE_MOBILE      = 0;      /**       * The Default WIFI data connection.  When active, all data traffic -     * will use this connection by default.  Should not coexist with other -     * default connections. +     * will use this connection by default.       */      public static final int TYPE_WIFI        = 1;      /** @@ -208,21 +206,23 @@ public class ConnectivityManager      public static final int TYPE_MOBILE_HIPRI = 5;      /**       * The Default WiMAX data connection.  When active, all data traffic -     * will use this connection by default.  Should not coexist with other -     * default connections. +     * will use this connection by default.       */      public static final int TYPE_WIMAX       = 6;      /** -     * Bluetooth data connection. This is used for Bluetooth reverse tethering. -     * @hide +     * The Default Bluetooth data connection. When active, all data traffic +     * will use this connection by default.       */      public static final int TYPE_BLUETOOTH   = 7;      /** {@hide} */      public static final int TYPE_DUMMY       = 8; -    /** {@hide} */ +    /** +     * The Default Ethernet data connection.  When active, all data traffic +     * will use this connection by default. +     */      public static final int TYPE_ETHERNET    = 9;      /**       * Over the air Adminstration. diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 85884b19a22a..47b5c607ba19 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1657,4 +1657,8 @@    <public type="attr" name="requiresSmallestWidthDp" id="0x01010364" />    <public type="attr" name="compatibleWidthLimitDp" />    <public type="attr" name="largestWidthLimitDp" /> + +  <public type="style" name="Theme.Holo.Light.NoActionBar" /> +  <public type="style" name="Theme.Holo.Light.NoActionBar.Fullscreen" /> +  </resources> diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.pngBinary files differ new file mode 100644 index 000000000000..e2584e3a2f9a --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.pngBinary files differ new file mode 100644 index 000000000000..58b85102d9b3 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.pngBinary files differ new file mode 100644 index 000000000000..2795c345f62e --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.pngBinary files differ new file mode 100644 index 000000000000..bbed6a6467d6 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png diff --git a/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml b/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml new file mode 100644 index 000000000000..977e00205e6f --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + +     Licensed under the Apache License, Version 2.0 (the "License"); +     you may not use this file except in compliance with the License. +     You may obtain a copy of the License at + +          http://www.apache.org/licenses/LICENSE-2.0 + +     Unless required by applicable law or agreed to in writing, software +     distributed under the License is distributed on an "AS IS" BASIS, +     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +     See the License for the specific language governing permissions and +     limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> +    <item android:state_pressed="true" android:drawable="@drawable/ic_sysbar_zoom_pressed" /> +    <item android:drawable="@drawable/ic_sysbar_zoom_default" /> +</selector> + diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar.xml b/packages/SystemUI/res/layout-sw600dp/status_bar.xml index d9f3f2324499..707a8cb56f73 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar.xml @@ -75,6 +75,13 @@                      systemui:keyCode="82"                      android:visibility="invisible"                      /> +                <com.android.systemui.statusbar.policy.CompatModeButton +                    android:id="@+id/compat_button" +                    android:layout_width="80dip" +                    android:layout_height="match_parent" +                    android:src="@drawable/ic_sysbar_zoom" +                    android:visibility="invisible" +                    />              </LinearLayout>              <!-- fake space bar zone --> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java new file mode 100644 index 000000000000..9b44f7893cde --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + *      http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.policy; + +import android.app.ActivityManager; +import android.content.Context; +import android.content.res.TypedArray; +import android.os.RemoteException; +import android.util.AttributeSet; +import android.util.Slog; +import android.view.View; +import android.widget.ImageView; + +import com.android.systemui.R; + +public class CompatModeButton extends ImageView implements View.OnClickListener { +    private static final String TAG = "StatusBar.CompatModeButton"; + +    private ActivityManager mAM; + +    public CompatModeButton(Context context, AttributeSet attrs) { +        this(context, attrs, 0); +    } + +    public CompatModeButton(Context context, AttributeSet attrs, int defStyle) { +        super(context, attrs); + +        setClickable(true); + +        mAM = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + +        setOnClickListener(this); + +        refresh(); +    } + +    @Override +    public void onClick(View v) { +        mAM.setFrontActivityScreenCompatMode(ActivityManager.COMPAT_MODE_TOGGLE); +    } + +    public void refresh() { +        setVisibility( +                (mAM.getFrontActivityScreenCompatMode() == ActivityManager.COMPAT_MODE_NEVER) +                ? View.GONE +                : View.VISIBLE +            ); +    } +} 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 70a78df493e4..3175a99fb482 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -446,12 +446,14 @@ public class NetworkController extends BroadcastReceiver {      }      boolean isCdmaEri() { -        final int iconIndex = mServiceState.getCdmaEriIconIndex(); -        if (iconIndex != EriInfo.ROAMING_INDICATOR_OFF) { -            final int iconMode = mServiceState.getCdmaEriIconMode(); -            if (iconMode == EriInfo.ROAMING_ICON_MODE_NORMAL -                    || iconMode == EriInfo.ROAMING_ICON_MODE_FLASH) { -                return true; +        if (mServiceState != null) { +            final int iconIndex = mServiceState.getCdmaEriIconIndex(); +            if (iconIndex != EriInfo.ROAMING_INDICATOR_OFF) { +                final int iconMode = mServiceState.getCdmaEriIconMode(); +                if (iconMode == EriInfo.ROAMING_ICON_MODE_NORMAL +                        || iconMode == EriInfo.ROAMING_ICON_MODE_FLASH) { +                    return true; +                }              }          }          return false; @@ -854,7 +856,7 @@ public class NetworkController extends BroadcastReceiver {          pw.print("  mDataActivity=");          pw.println(mDataActivity);          pw.print("  mServiceState="); -        pw.println(mServiceState.toString()); +        pw.println(mServiceState);          pw.print("  mNetworkName=");          pw.println(mNetworkName);          pw.print("  mNetworkNameDefault="); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 1b73e2962737..4e1077091e9d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -69,6 +69,7 @@ import com.android.systemui.R;  import com.android.systemui.statusbar.*;  import com.android.systemui.statusbar.policy.BatteryController;  import com.android.systemui.statusbar.policy.BluetoothController; +import com.android.systemui.statusbar.policy.CompatModeButton;  import com.android.systemui.statusbar.policy.LocationController;  import com.android.systemui.statusbar.policy.NetworkController;  import com.android.systemui.statusbar.policy.Prefs; @@ -962,6 +963,10 @@ public class TabletStatusBar extends StatusBar implements          // See above re: lights-out policy for legacy apps.          if (visible) setLightsOn(true); + +        // XXX: HACK: not sure if this is the best way to catch a new activity that might require a +        // change in compatibility features, but it's a start. +        ((CompatModeButton) mBarContents.findViewById(R.id.compat_button)).refresh();      }      public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index c503fb840bf2..1a333ba6d0d5 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -1286,7 +1286,7 @@ public final class ActivityManagerService extends ActivityManagerNative                          mCompatModeDialog.dismiss();                          mCompatModeDialog = null;                      } -                    if (ar != null) { +                    if (ar != null && false) {                          if (mCompatModePackages.getPackageAskCompatModeLocked(                                  ar.packageName)) {                              int mode = mCompatModePackages.computeCompatModeLocked( diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9a312a7369fe..a7b58576924c 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1389,6 +1389,14 @@ status_t SurfaceFlinger::destroySurface(const wp<LayerBaseClient>& layer)      if (l != NULL) {          Mutex::Autolock _l(mStateLock);          err = removeLayer_l(l); +        if (err == NAME_NOT_FOUND) { +            // The surface wasn't in the current list, which means it was +            // removed already, which means it is in the purgatory, +            // and need to be removed from there. +            ssize_t idx = mLayerPurgatory.remove(l); +            LOGE_IF(idx < 0, +                    "layer=%p is not in the purgatory list", l.get()); +        }          LOGE_IF(err<0 && err != NAME_NOT_FOUND,                  "error removing layer=%p (%s)", l.get(), strerror(-err));      } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7aa9a2589d68..36e02029c776 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -430,8 +430,7 @@ public class TelephonyManager {      public static final int NETWORK_TYPE_LTE = 13;      /** Current network is eHRPD */      public static final int NETWORK_TYPE_EHRPD = 14; -    /** Current network is HSPA+ -     * @hide */ +    /** Current network is HSPA+ */      public static final int NETWORK_TYPE_HSPAP = 15;      /** @@ -454,6 +453,7 @@ public class TelephonyManager {       * @see #NETWORK_TYPE_IDEN       * @see #NETWORK_TYPE_LTE       * @see #NETWORK_TYPE_EHRPD +     * @see #NETWORK_TYPE_HSPAP       */      public int getNetworkType() {          try{ @@ -510,6 +510,8 @@ public class TelephonyManager {                  return "CDMA - eHRPD";              case NETWORK_TYPE_IDEN:                  return "iDEN"; +            case NETWORK_TYPE_HSPAP: +                return "HSPA+";              default:                  return "UNKNOWN";          } diff --git a/telephony/java/com/android/internal/telephony/BaseCommands.java b/telephony/java/com/android/internal/telephony/BaseCommands.java index e1d8c85c4562..13afbb7914aa 100644 --- a/telephony/java/com/android/internal/telephony/BaseCommands.java +++ b/telephony/java/com/android/internal/telephony/BaseCommands.java @@ -97,8 +97,10 @@ public abstract class BaseCommands implements CommandsInterface {      protected Registrant mRestrictedStateRegistrant;      protected Registrant mGsmBroadcastSmsRegistrant; -    // Network Mode received from PhoneFactory -    protected int mNetworkMode; +    // Preferred network type received from PhoneFactory. +    // This is used when establishing a connection to the +    // vendor ril so it starts up in the correct mode. +    protected int mPreferredNetworkType;      // CDMA subscription received from PhoneFactory      protected int mCdmaSubscription;      // Type of Phone, GSM or CDMA. Set by CDMAPhone or GSMPhone. diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index f9f641c0827c..40a396e58da3 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -612,14 +612,14 @@ public final class RIL extends BaseCommands implements CommandsInterface {      //***** Constructors -    public RIL(Context context, int networkMode, int cdmaSubscription) { +    public RIL(Context context, int preferredNetworkType, int cdmaSubscription) {          super(context);          if (RILJ_LOGD) { -            riljLog("RIL(context, networkMode=" + networkMode + +            riljLog("RIL(context, preferredNetworkType=" + preferredNetworkType +                      " cdmaSubscription=" + cdmaSubscription + ")");          }          mCdmaSubscription  = cdmaSubscription; -        mNetworkMode = networkMode; +        mPreferredNetworkType = preferredNetworkType;          mPhoneType = RILConstants.NO_PHONE;          PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); @@ -1814,6 +1814,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {          rr.mp.writeInt(1);          rr.mp.writeInt(networkType); +        mPreferredNetworkType = networkType; +          if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)                  + " : " + networkType); @@ -2223,7 +2225,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {              case RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM: ret =  responseInts(p); break;              case RIL_REQUEST_EXPLICIT_CALL_TRANSFER: ret =  responseVoid(p); break;              case RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE: ret =  responseVoid(p); break; -            case RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE: ret =  responseInts(p); break; +            case RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE: ret =  responseGetPreferredNetworkType(p); break;              case RIL_REQUEST_GET_NEIGHBORING_CELL_IDS: ret = responseCellList(p); break;              case RIL_REQUEST_SET_LOCATION_UPDATES: ret =  responseVoid(p); break;              case RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE: ret =  responseVoid(p); break; @@ -2738,7 +2740,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {                  // Initial conditions                  setRadioPower(false, null); -                setPreferredNetworkType(mNetworkMode, null); +                setPreferredNetworkType(mPreferredNetworkType, null);                  setCdmaSubscriptionSource(mCdmaSubscription, null);                  notifyRegistrantsRilConnectionChanged(((int[])ret)[0]);                  break; @@ -3162,6 +3164,18 @@ public final class RIL extends BaseCommands implements CommandsInterface {         return response;      } +    private Object responseGetPreferredNetworkType(Parcel p) { +       int [] response = (int[]) responseInts(p); + +       if (response.length >= 1) { +           // Since this is the response for getPreferredNetworkType +           // we'll assume that it should be the value we want the +           // vendor ril to take if we reestablish a connection to it. +           mPreferredNetworkType = response[0]; +       } +       return response; +    } +      private Object responseGmsBroadcastConfig(Parcel p) {          int num;          ArrayList<SmsBroadcastConfigInfo> response; diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 7f9fc31b5fed..d83b968538d2 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -478,6 +478,21 @@ class WifiConfigStore {          }      } +    /** +     * clear IP configuration for a given network id +     */ +    static void clearIpConfiguration(int netId) { +        synchronized (sConfiguredNetworks) { +            WifiConfiguration config = sConfiguredNetworks.get(netId); +            if (config != null && config.linkProperties != null) { +                // Clear everything except proxy +                ProxyProperties proxy = config.linkProperties.getHttpProxy(); +                config.linkProperties.clear(); +                config.linkProperties.setHttpProxy(proxy); +            } +        } +    } +      /**       * Fetch the proxy properties for a given network id diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index e03680fcf787..3cbf72600714 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1440,10 +1440,13 @@ public class WifiStateMachine extends StateMachine {          /* Clear network properties */          mLinkProperties.clear(); +        /* Clear IP settings if the network used DHCP */ +        if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) { +            WifiConfigStore.clearIpConfiguration(mLastNetworkId); +        }          mLastBssid= null;          mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID; -      }      void handlePreDhcpSetup() { |