summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/Settings.java48
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/com/android/internal/view/WindowManagerPolicyThread.java22
-rw-r--r--core/res/res/values/strings.xml6
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java1
-rw-r--r--services/java/com/android/server/ConnectivityService.java2
-rw-r--r--services/java/com/android/server/PackageManagerService.java4
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java20
8 files changed, 89 insertions, 15 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4995cac..873e1a6f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1034,6 +1034,24 @@ public final class Settings {
public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
/**
+ * END_BUTTON_BEHAVIOR value for "go home".
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
+
+ /**
+ * END_BUTTON_BEHAVIOR value for "go to sleep".
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
+
+ /**
+ * END_BUTTON_BEHAVIOR default value.
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
+
+ /**
* Whether Airplane Mode is on.
*/
public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
@@ -3191,6 +3209,36 @@ public final class Settings {
public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
/**
+ * What happens when the user presses the Power button while in-call
+ * and the screen is on.<br/>
+ * <b>Values:</b><br/>
+ * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
+ * 2 - The Power button hangs up the current call.<br/>
+ *
+ * @hide
+ */
+ public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR default value.
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
+ INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
+
+ /**
* @hide
*/
public static final String[] SETTINGS_TO_BACKUP = {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index e8bb736..54c805f 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4356,6 +4356,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
mPendingCheckForTap = new CheckForTap();
}
mPrivateFlags |= PREPRESSED;
+ mHasPerformedLongPress = false;
postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout());
break;
diff --git a/core/java/com/android/internal/view/WindowManagerPolicyThread.java b/core/java/com/android/internal/view/WindowManagerPolicyThread.java
index 6078683..c8c38bb 100644
--- a/core/java/com/android/internal/view/WindowManagerPolicyThread.java
+++ b/core/java/com/android/internal/view/WindowManagerPolicyThread.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2010 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.internal.view;
import android.os.Looper;
@@ -9,16 +25,16 @@ import android.os.Looper;
public class WindowManagerPolicyThread {
static Thread mThread;
static Looper mLooper;
-
+
public static void set(Thread thread, Looper looper) {
mThread = thread;
mLooper = looper;
}
-
+
public static Thread getThread() {
return mThread;
}
-
+
public static Looper getLooper() {
return mLooper;
}
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 3fb9607..584fe25 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2078,11 +2078,11 @@
<string name="usb_storage_stop_error_message">There was a problem turning off USB storage. Check to make sure you have unmounted the USB host, then try again.</string>
<!-- USB_STORAGE_KILL_STORAGE_USERS dialog -->
- <string name="dlg_confirm_kill_storage_users_title">Enable Mass Storage</string>
+ <string name="dlg_confirm_kill_storage_users_title">Turn on USB storage</string>
<!-- USB_STORAGE_KILL_STORAGE_USERS dialog message text -->
- <string name="dlg_confirm_kill_storage_users_text">Some processes accessing data on sdcard will be killed. Do you want to continue?</string>
+ <string name="dlg_confirm_kill_storage_users_text">If you turn on USB storage, some applications you are using will stop and may be unavailable until you turn off USB storage.</string>
<!-- USB_STORAGE_ERROR dialog dialog-->
- <string name="dlg_error_title">UMS operation failed</string>
+ <string name="dlg_error_title">USB operation failed</string>
<!-- USB_STORAGE_ERROR dialog ok button-->
<string name="dlg_ok">OK</string>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index ba66dc5..fb39ac0 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -902,6 +902,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
vibrate = AudioService.getValueForVibrateSetting(vibrate,
AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
loadSetting(stmt, Settings.System.VIBRATE_ON, vibrate);
+ stmt.close();
}
private void loadSettings(SQLiteDatabase db) {
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index fa06244..fc20d96 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -320,7 +320,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
}
- mTethering = new Tethering(mContext);
+ mTethering = new Tethering(mContext, mHandler.getLooper());
mTetheringConfigValid = (((mNetTrackers[ConnectivityManager.TYPE_MOBILE_DUN] != null) ||
!mTethering.isDunRequired()) &&
(mTethering.getTetherableUsbRegexs().length != 0 ||
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 63afabc..ed8e22b 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -7707,7 +7707,11 @@ class PackageManagerService extends IPackageManager.Stub {
resourcePath, vc, pkgFlags);
if (DEBUG_UPGRADE) Log.v(TAG, "Package " + name
+ " is adopting original package " + origPackage.name);
+ // Note that we will retain the new package's signature so
+ // that we can keep its data.
+ PackageSignatures s = p.signatures;
p.copyFrom(origPackage);
+ p.signatures = s;
p.sharedUser = origPackage.sharedUser;
p.userId = origPackage.userId;
p.origPackage = origPackage;
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index ebd3314..25f123c 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -36,6 +36,7 @@ import android.os.Binder;
import android.os.Environment;
import android.os.IBinder;
import android.os.INetworkManagementService;
+import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -73,6 +74,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
private String[] mTetherableWifiRegexs;
private String[] mUpstreamIfaceRegexs;
+ private Looper mLooper; // given to us at construction time..
+
private HashMap<String, TetherInterfaceSM> mIfaces; // all tethered/tetherable ifaces
private BroadcastReceiver mStateReceiver;
@@ -101,9 +104,10 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
private boolean mUsbMassStorageOff; // track the status of USB Mass Storage
private boolean mUsbConnected; // track the status of USB connection
- public Tethering(Context context) {
+ public Tethering(Context context, Looper looper) {
Log.d(TAG, "Tethering starting");
mContext = context;
+ mLooper = looper;
// register for notifications from NetworkManagement Service
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
@@ -116,7 +120,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
mIfaces = new HashMap<String, TetherInterfaceSM>();
- mTetherMasterSM = new TetherMasterSM("TetherMaster");
+ mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper);
mTetherMasterSM.start();
// TODO - remove this hack after real USB connections are detected.
@@ -175,7 +179,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
TetherInterfaceSM sm = mIfaces.get(iface);
if (link) {
if (sm == null) {
- sm = new TetherInterfaceSM(iface, usb);
+ sm = new TetherInterfaceSM(iface, mLooper, usb);
mIfaces.put(iface, sm);
sm.start();
}
@@ -225,7 +229,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
Log.e(TAG, "active iface (" + iface + ") reported as added, ignoring");
return;
}
- sm = new TetherInterfaceSM(iface, usb);
+ sm = new TetherInterfaceSM(iface, mLooper, usb);
mIfaces.put(iface, sm);
sm.start();
}
@@ -639,8 +643,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
String mIfaceName;
boolean mUsb;
- TetherInterfaceSM(String name, boolean usb) {
- super(name);
+ TetherInterfaceSM(String name, Looper looper, boolean usb) {
+ super(name, looper);
mIfaceName = name;
mUsb = usb;
setLastError(ConnectivityManager.TETHER_ERROR_NO_ERROR);
@@ -1023,8 +1027,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
private static final int CELL_DISABLE_DUN_TIMEOUT_MS = 3000;
private static final int CELL_DUN_RENEW_MS = 40000;
- TetherMasterSM(String name) {
- super(name);
+ TetherMasterSM(String name, Looper looper) {
+ super(name, looper);
//Add states
mInitialState = new InitialState();