diff options
Diffstat (limited to 'packages')
8 files changed, 65 insertions, 38 deletions
diff --git a/packages/CaptivePortalLogin/AndroidManifest.xml b/packages/CaptivePortalLogin/AndroidManifest.xml index c5fb167..2ec15be 100644 --- a/packages/CaptivePortalLogin/AndroidManifest.xml +++ b/packages/CaptivePortalLogin/AndroidManifest.xml @@ -20,6 +20,7 @@ package="com.android.captiveportallogin" > <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:label="@string/app_name" > <activity diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java index ae52a1e..b3a6e88 100644 --- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java +++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java @@ -20,7 +20,10 @@ import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.net.ConnectivityManager; +import android.net.ConnectivityManager.NetworkCallback; import android.net.Network; +import android.net.NetworkCapabilities; +import android.net.NetworkRequest; import android.os.Bundle; import android.provider.Settings; import android.provider.Settings.Global; @@ -55,6 +58,7 @@ public class CaptivePortalLoginActivity extends Activity { private URL mURL; private int mNetId; + private NetworkCallback mNetworkCallback; @Override protected void onCreate(Bundle savedInstanceState) { @@ -73,7 +77,27 @@ public class CaptivePortalLoginActivity extends Activity { getActionBar().setDisplayShowHomeEnabled(false); mNetId = Integer.parseInt(getIntent().getStringExtra(Intent.EXTRA_TEXT)); - ConnectivityManager.setProcessDefaultNetwork(new Network(mNetId)); + final Network network = new Network(mNetId); + ConnectivityManager.setProcessDefaultNetwork(network); + + // Exit app if Network disappears. + final NetworkCapabilities networkCapabilities = + ConnectivityManager.from(this).getNetworkCapabilities(network); + if (networkCapabilities == null) { + finish(); + return; + } + mNetworkCallback = new NetworkCallback() { + @Override + public void onLost(Network lostNetwork) { + if (network.equals(lostNetwork)) done(false); + } + }; + final NetworkRequest.Builder builder = new NetworkRequest.Builder(); + for (int transportType : networkCapabilities.getTransportTypes()) { + builder.addTransportType(transportType); + } + ConnectivityManager.from(this).registerNetworkCallback(builder.build(), mNetworkCallback); WebView myWebView = (WebView) findViewById(R.id.webview); WebSettings webSettings = myWebView.getSettings(); @@ -84,6 +108,7 @@ public class CaptivePortalLoginActivity extends Activity { } private void done(boolean use_network) { + ConnectivityManager.from(this).unregisterNetworkCallback(mNetworkCallback); Intent intent = new Intent(ACTION_CAPTIVE_PORTAL_LOGGED_IN); intent.putExtra(Intent.EXTRA_TEXT, String.valueOf(mNetId)); intent.putExtra(LOGGED_IN_RESULT, use_network ? "1" : "0"); diff --git a/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java index 05f2962..ad07a7a 100644 --- a/packages/Keyguard/src/com/android/keyguard/CarrierText.java +++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java @@ -233,7 +233,11 @@ public class CarrierText extends TextView { final boolean plmnValid = !TextUtils.isEmpty(plmn); final boolean spnValid = !TextUtils.isEmpty(spn); if (plmnValid && spnValid) { - return new StringBuilder().append(plmn).append(mSeparator).append(spn).toString(); + if (plmn.equals(spn)) { + return plmn; + } else { + return new StringBuilder().append(plmn).append(mSeparator).append(spn).toString(); + } } else if (plmnValid) { return plmn; } else if (spnValid) { diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java index 34bbc2e..954046c 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -95,10 +95,11 @@ public class DozeLog { log("dozing " + dozing); } - public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded) { + public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded, + boolean screenOnFromTouch) { if (!ENABLED) return; log("fling expand=" + expand + " aboveThreshold=" + aboveThreshold + " thresholdNeeded=" - + thresholdNeeded); + + thresholdNeeded + " screenOnFromTouch=" + screenOnFromTouch); } public static void traceEmergencyCall() { diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java index 5caf1ac..8416ad7 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java @@ -112,15 +112,11 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta mTaskStackBounds = new Rect(); } - public void onStart() {} - - public void onBootCompleted() { + public void onStart() { // Initialize some static datastructures TaskStackViewLayoutAlgorithm.initializeCurve(); // Load the header bar layout reloadHeaderBarLayout(); - mBootCompleted = true; - // Try and pre-emptively bind the search widget on startup to ensure that we // have the right thumbnail bounds to animate to. if (Constants.DebugFlags.App.EnableSearchLayout) { @@ -138,6 +134,10 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta } } + public void onBootCompleted() { + mBootCompleted = true; + } + /** Shows the recents */ public void onShowRecents(boolean triggeredFromAltTab, View statusBarView) { mStatusBarView = statusBarView; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index b9efb22..26420e1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1551,7 +1551,8 @@ public class NotificationPanelView extends PanelView implements @Override protected void onEdgeClicked(boolean right) { if ((right && getRightIcon().getVisibility() != View.VISIBLE) - || (!right && getLeftIcon().getVisibility() != View.VISIBLE)) { + || (!right && getLeftIcon().getVisibility() != View.VISIBLE) + || isDozing()) { return; } mHintAnimationRunning = true; @@ -1747,6 +1748,7 @@ public class NotificationPanelView extends PanelView implements updateKeyguardStatusBarVisibility(); } + @Override public boolean isDozing() { return mDozing; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index cacc2df..c612e4c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -337,7 +337,8 @@ public abstract class PanelView extends FrameLayout { boolean expand = flingExpands(vel, vectorVel); onTrackingStopped(expand); DozeLog.traceFling(expand, mTouchAboveFalsingThreshold, - mStatusBar.isFalsingThresholdNeeded()); + mStatusBar.isFalsingThresholdNeeded(), + mStatusBar.isScreenOnComingFromTouch()); fling(vel, expand); mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown; if (mUpdateFlingOnLayout) { @@ -914,7 +915,9 @@ public abstract class PanelView extends FrameLayout { private boolean onMiddleClicked() { switch (mStatusBar.getBarState()) { case StatusBarState.KEYGUARD: - startUnlockHintAnimation(); + if (!isDozing()) { + startUnlockHintAnimation(); + } return true; case StatusBarState.SHADE_LOCKED: mStatusBar.goToKeyguard(); @@ -932,6 +935,8 @@ public abstract class PanelView extends FrameLayout { protected abstract void onEdgeClicked(boolean right); + protected abstract boolean isDozing(); + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println(String.format("[PanelView(%s): expandedHeight=%f maxPanelHeight=%d closing=%s" + " tracking=%s justPeeked=%s peekAnim=%s%s timeAnim=%s%s touchDisabled=%s" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 79d769a..3625997 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -646,19 +646,10 @@ public class NetworkControllerImpl extends BroadcastReceiver mLastSignalLevel = iconLevel = mSignalStrength.getLevel(); } - if (isCdma()) { - if (isCdmaEri()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; - } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; - } + if (isRoaming()) { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; } else { - // Though mPhone is a Manager, this call is not an IPC - if (mPhone.isNetworkRoaming()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; - } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; - } + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; } mPhoneSignalIconId = iconList[iconLevel]; mQSPhoneSignalIconId = @@ -811,14 +802,9 @@ public class NetworkControllerImpl extends BroadcastReceiver } } - if (isCdma()) { - if (isCdmaEri()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; - } - } else if (mPhone.isNetworkRoaming()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; + if (isRoaming()) { + mDataTypeIconId = TelephonyIcons.ROAMING_ICON; + mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; } } @@ -836,6 +822,14 @@ public class NetworkControllerImpl extends BroadcastReceiver return false; } + private boolean isRoaming() { + if (isCdma()) { + return isCdmaEri(); + } else { + return mServiceState != null && mServiceState.getRoaming(); + } + } + private final void updateDataIcon() { int iconId; boolean visible = true; @@ -1233,12 +1227,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mDataTypeIconId = 0; mQSDataTypeIconId = 0; - if (isCdma()) { - if (isCdmaEri()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; - } - } else if (mPhone.isNetworkRoaming()) { + if (isRoaming()) { mDataTypeIconId = TelephonyIcons.ROAMING_ICON; mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; } |