Merge branch 'master' into honeycomb-release

* master:
  Fixes a regression in launching certain settings activities.
  Fix bug #3248308 (On account set up, turn on sync for all apps by default; delay sync until after user selects Finish)
  Revert: Add checkbox to enable PTP USB mode.
  Fix 3148496: Update LockScreen layouts on large device
  Remove skip button from datetime settings
  Fix an NPE for monkey stability.
This commit is contained in:
The Android Automerger
2010-12-16 07:39:04 -08:00
20 changed files with 333 additions and 300 deletions

View File

@@ -248,6 +248,22 @@
android:value="com.android.settings.Settings$WirelessSettingsActivity" />
</activity>
<!-- Keep compatibility with old shortcuts. -->
<activity-alias android:name=".TetherSettings"
android:label="@string/tether_settings_title_all"
android:clearTaskOnLaunch="true"
android:exported="true"
android:targetActivity="Settings$TetherSettingsActivity">
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.TetherSettings" />
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
android:resource="@id/wireless_settings" />
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
android:resource="@string/wireless_networks_settings_title" />
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
android:value="com.android.settings.Settings$WirelessSettingsActivity" />
</activity-alias>
<activity android:name="Settings$VpnSettingsActivity"
android:theme="@android:style/Theme.Holo"
android:label="@string/vpn_settings_activity_title"
@@ -689,23 +705,13 @@
</intent-filter>
</activity>
<activity android:name="ChooseLockPattern"
android:label="@string/lockpattern_change_lock_pattern_label"
android:exported="false">
</activity>
<activity android:name="ChooseLockPattern" android:exported="false"/>
<activity android:name="ChooseLockPassword"
android:label="@string/lockpattern_change_lock_pin_label"
android:exported="false">
</activity>
<activity android:name="ChooseLockPassword" android:exported="false"/>
<activity android:name="ChooseLockPatternTutorial"
android:label="@string/lockpattern_change_lock_pattern_label">
</activity>
<activity android:name="ChooseLockPatternTutorial"/>
<activity android:name="ChooseLockPatternExample"
android:label="@string/lockpattern_change_lock_pattern_label">
</activity>
<activity android:name="ChooseLockPatternExample"/>
<!-- Runs in the phone process since it needs access to the Phone object -->
<activity android:name=".deviceinfo.Status"
@@ -781,6 +787,7 @@
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
<action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -794,6 +801,26 @@
android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
</activity>
<activity-alias android:name="DevelopmentSettings"
android:clearTaskOnLaunch="true"
android:exported="true"
android:label="@string/development_settings_title"
android:targetActivity="Settings$DevelopmentSettingsActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
<action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.DevelopmentSettings" />
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
android:resource="@id/application_settings" />
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
android:resource="@string/applications_settings_header" />
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
</activity-alias>
<!-- Bluetooth stuff -->

View File

@@ -16,15 +16,16 @@
** limitations under the License.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_horizontal">
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="72dip"
android:orientation="horizontal">
<!-- "Enter PIN(Password) to unlock" -->
@@ -61,12 +62,31 @@
/>
</LinearLayout>
<!-- Spacer between password entry and keyboard -->
<View
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<!-- confirm / restart buttons -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<!-- left / top button: skip, or re-try -->
<Button android:id="@+id/cancel_button"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpassword_cancel_label"/>
<!-- right / bottom button: confirm or ok -->
<Button android:id="@+id/next_button"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpassword_continue_label"/>
</LinearLayout>
<!-- Alphanumeric keyboard -->
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
@@ -77,33 +97,4 @@
android:visibility="gone"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
<Button android:id="@+id/cancel_button"
android:layout_height="wrap_content"
android:layout_width="140dip"
android:ellipsize="marquee"
android:singleLine="true"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/next_button"
android:text="@string/lockpassword_cancel_label"
/>
<Button android:id="@+id/next_button"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/lockpassword_continue_label"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@@ -21,62 +21,69 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- left side: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<!-- right side: pattern and messages -->
<LinearLayout
android:orientation="vertical"
<RelativeLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1.0">
android:layout_weight="1">
<!-- left side: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip"
android:layout_height="354dip"
android:layout_gravity="center_horizontal"
android:layout_marginTop="72dip"
android:layout_marginLeft="111dip"
aspect="square"/>
<!-- right side: instructions and buttons -->
<!-- header message -->
<TextView android:id="@+id/headerText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:gravity="left"/>
android:layout_width="542dip"
android:layout_height="78dip"
android:layout_marginTop="88dip"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/lockPattern"
android:layout_marginLeft="100dip"
android:textSize="22sp"/>
<!-- footer message -->
<TextView android:id="@+id/footerText"
android:layout_width="wrap_content"
android:layout_width="542dip"
android:layout_height="wrap_content"
android:layout_below="@id/headerText"
android:layout_marginTop="16dip"
android:layout_toRightOf="@id/lockPattern"
android:layout_marginLeft="100dip"
android:textSize="22sp"
android:layout_marginTop="40dip"
android:visibility="gone"/>
<!-- confirm / restart buttons -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
<!-- right / bottom button: confirm or ok -->
<Button android:id="@+id/footerRightButton"
android:layout_height="wrap_content"
android:layout_width="140dip"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_confirm_button_text"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<!-- left / top button: skip, or re-try -->
<Button android:id="@+id/footerLeftButton"
android:layout_height="wrap_content"
android:layout_width="140dip"
android:layout_toLeftOf="@id/footerRightButton"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_restart_button_text"/>
</RelativeLayout>
<!-- right / bottom button: confirm or ok -->
<Button android:id="@+id/footerRightButton"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_confirm_button_text"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -17,16 +17,16 @@
*/
-->
<!-- This is the same layout as choose_lock_password. TODO: find out why merge fails -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<!-- This is the same layout as choose_lock_password. TODO: find out why merge tag fails -->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_horizontal">
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="72dip"
android:orientation="horizontal">
<!-- "Enter PIN(Password) to unlock" -->
@@ -63,12 +63,31 @@
/>
</LinearLayout>
<!-- Spacer between password entry and keyboard -->
<View
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<!-- confirm / restart buttons -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<!-- left / top button: skip, or re-try -->
<Button android:id="@+id/cancel_button"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpassword_cancel_label"/>
<!-- right / bottom button: confirm or ok -->
<Button android:id="@+id/next_button"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpassword_continue_label"/>
</LinearLayout>
<!-- Alphanumeric keyboard -->
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
@@ -79,30 +98,4 @@
android:visibility="gone"
/>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:visibility="visible">
<Button android:id="@+id/cancel_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_toLeftOf="@id/next_button"
android:text="@string/lockpassword_cancel_label"
/>
<Button android:id="@+id/next_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/ic_btn_next"
android:drawablePadding="10dip"
android:text="@string/lockpassword_continue_label"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@@ -21,33 +21,42 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- left side: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- right side: instructions and buttons -->
<LinearLayout
android:orientation="vertical"
<RelativeLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1.0">
android:layout_weight="1">
<!-- left side: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip"
android:layout_height="354dip"
android:layout_gravity="center_horizontal"
android:layout_marginTop="72dip"
android:layout_marginLeft="111dip"
aspect="square"/>
<!-- right side: instructions and buttons -->
<!-- header message -->
<TextView android:id="@+id/headerText"
android:layout_width="match_parent"
android:layout_width="542dip"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_marginTop="88dip"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/lockPattern"
android:layout_marginLeft="100dip"
android:textSize="22sp"/>
<!-- footer message -->
<TextView android:id="@+id/footerText"
android:layout_width="match_parent"
android:layout_width="542dip"
android:layout_height="wrap_content"
android:layout_marginTop="40dip"
android:gravity="left"
android:layout_below="@id/headerText"
android:layout_marginTop="16dip"
android:layout_toRightOf="@id/lockPattern"
android:layout_marginLeft="100dip"
android:textSize="22sp"/>
</LinearLayout>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -20,7 +20,6 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@android:color/background_dark"
android:gravity="center_horizontal">
<!-- header text ('Enter Pin') -->
@@ -72,6 +71,7 @@
android:background="#00000000"
android:layout_marginBottom="30dip"
android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
android:visibility="gone"
/>
<RelativeLayout
@@ -91,8 +91,6 @@
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/ic_btn_next"
android:drawablePadding="10dip"
android:text="@string/lockpassword_continue_label"
/>

View File

@@ -14,78 +14,69 @@
limitations under the License.
-->
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
android:gravity="center_horizontal">
<!-- takes up all space above button bar at bottom -->
<LinearLayout
android:orientation="vertical"
<!-- top: instructions and buttons -->
<!-- header message -->
<TextView android:id="@+id/headerText"
android:layout_width="542dip"
android:layout_height="78dip"
android:layout_marginTop="96dip"
android:textSize="22sp"/>
<!-- footer message -->
<TextView android:id="@+id/footerText"
android:layout_width="542dip"
android:layout_height="78dip"
android:layout_marginTop="16dip"
android:textSize="22sp"
android:visibility="gone"/>
<!-- bottom: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip"
android:layout_height="354dip"
android:layout_marginTop="80dip"
aspect="square"/>
<View
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
android:layout_weight="1"/>
<TextView android:id="@+id/headerText"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center"
android:textSize="18sp"/>
<View
android:background="@*android:drawable/code_lock_top"
android:layout_width="match_parent"
android:layout_height="2dip" />
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- bottom line looks bad when button bar is their too, omit in this case -->
<!--View
android:background="@*android:drawable/code_lock_bottom"
android:layout_width="match_parent"
android:layout_height="8dip" /-->
<TextView android:id="@+id/footerText"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center"
android:textSize="14sp"/>
</LinearLayout>
<LinearLayout style="@android:style/ButtonBar"
android:orientation="horizontal"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/footerLeftButton"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="140dip"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_restart_button_text"/>
android:layout_alignParentRight="true"
android:orientation="horizontal">
<View
android:visibility="invisible"
android:layout_height="0dip"
android:layout_width="1dip"
android:layout_weight="1" />
<!-- left / top button: skip, or re-try -->
<Button android:id="@+id/footerLeftButton"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_restart_button_text"/>
<Button android:id="@+id/footerRightButton"
android:layout_height="wrap_content"
android:layout_width="140dip"
android:ellipsize="marquee"
android:singleLine="true"
android:drawableRight="@drawable/ic_btn_next"
android:drawablePadding="3dip"
android:text="@string/lockpattern_confirm_button_text"/>
<!-- right / bottom button: confirm or ok -->
<Button android:id="@+id/footerRightButton"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/lockpattern_confirm_button_text"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -23,7 +23,6 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@android:color/background_dark"
android:gravity="center_horizontal">
<!-- header text ('Enter Pin') -->
@@ -75,6 +74,7 @@
android:background="#00000000"
android:layout_marginBottom="30dip"
android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
android:visibility="gone"
/>
<RelativeLayout

View File

@@ -17,35 +17,35 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
android:gravity="center_horizontal">
<!-- top: instructions and buttons -->
<!-- header message -->
<TextView android:id="@+id/headerText"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:gravity="center"
android:textSize="18sp"/>
<View
android:background="@*android:drawable/code_lock_top"
android:layout_width="match_parent"
android:layout_height="2dip" />
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:background="@*android:drawable/code_lock_bottom"
android:layout_width="match_parent"
android:layout_height="8dip" />
android:layout_width="542dip"
android:layout_height="78dip"
android:layout_marginTop="96dip"
android:textSize="22sp"/>
<!-- footer message -->
<TextView android:id="@+id/footerText"
android:layout_width="542dip"
android:layout_height="78dip"
android:layout_marginTop="16dip"
android:textSize="22sp"/>
<!-- bottom: lock pattern -->
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip"
android:layout_height="354dip"
android:layout_marginTop="80dip"
aspect="square"/>
<View
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:gravity="center"
android:textSize="14sp"/>
android:layout_weight="1"/>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -127,6 +127,7 @@
</RelativeLayout>
</LinearLayout>
<!-- TODO: remove this button when we are sure it is needless -->
<Button
android:id="@+id/skip_button"
android:layout_width="250dip"
@@ -135,7 +136,8 @@
android:layout_toLeftOf="@+id/next_button"
android:layout_marginRight="20dip"
android:textSize="24dip"
android:text="@string/skip_label"/>
android:text="@string/skip_label"
android:visibility="gone" />
<Button
android:id="@+id/next_button"

View File

@@ -1456,9 +1456,6 @@
<!-- SD card & phone storage settings item title that will result in the phone unmounting the SD card. This will be done before the user phyiscally removes the SD card from the phone. Kind of like the "Safely remove" on some operating systems. -->
<string name="sd_eject_summary" product="default">Unmount the SD card so you can safely remove it</string>
<!-- SD card & phone storage settings item title for toggling PTP mode on and off. When PTP mode is on the device will appear on the USB bus as a PTP camera device instead of an MTP music player. -->
<string name="ptp_mode">Enable PTP mode</string>
<!-- SD card & phone storage settings item summary for toggling PTP mode on and off. When PTP mode is on the device will appear on the USB bus as a PTP camera device instead of an MTP music player. -->
<string name="ptp_mode_summary">Appear on USB as a PTP camera device instead of an MTP device</string>
<!-- SD card & phone storage settings item summary that is displayed when no SD card is inserted. This version of the string can probably never come up on current hardware. [CHAR LIMIT=25] -->
<string name="sd_insert_summary" product="nosdcard">Insert USB storage for mounting</string>

View File

@@ -53,9 +53,6 @@
android:icon="@color/memory_avail"
android:title="@string/memory_available"
android:summary="00"/>
<CheckBoxPreference android:key="ptp_mode_toggle"
android:title="@string/ptp_mode"
android:summary="@string/ptp_mode_summary"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -29,6 +29,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceActivity;
import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextUtils;
@@ -191,6 +192,10 @@ public class ChooseLockPassword extends PreferenceActivity {
mHeaderText = (TextView) view.findViewById(R.id.headerText);
mKeyboardView.requestFocus();
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(mIsAlphaMode ? currentType
: (currentType | InputType.TYPE_CLASS_NUMBER));
Intent intent = getActivity().getIntent();
final boolean confirmCredentials = intent.getBooleanExtra("confirm_credentials", true);
if (savedInstanceState == null) {

View File

@@ -26,6 +26,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceActivity;
import android.text.InputType;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -98,6 +99,11 @@ public class ConfirmLockPassword extends PreferenceActivity {
mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
: PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
mKeyboardView.requestFocus();
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(isAlpha ? currentType
: (currentType | InputType.TYPE_CLASS_NUMBER));
return view;
}

View File

@@ -20,6 +20,7 @@ import android.app.Activity;
import android.app.AlarmManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.provider.Settings;
@@ -91,6 +92,8 @@ public class DateTimeSettingsSetupWizard extends Activity
mAutoTimeZoneButton.setText(autoTimeZoneEnabled ? R.string.zone_auto_summaryOn :
R.string.zone_auto_summaryOff);*/
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
final TimeZone tz = TimeZone.getDefault();
mSelectedTimeZone = tz;
mTimeZoneButton = (Button)findViewById(R.id.time_zone_button);

View File

@@ -261,6 +261,8 @@ public class SoundSettings extends SettingsPreferenceFragment implements
// updateState in fact updates the UI to reflect the system state
private void updateState(boolean force) {
if (getActivity() == null) return;
final int ringerMode = mAudioManager.getRingerMode();
// NB: in the UI we now simply call this "silent mode". A separate

View File

@@ -50,8 +50,6 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@@ -74,17 +72,17 @@ public class AccountSyncSettings extends AccountPreferenceBase {
private TextView mProviderId;
private ImageView mProviderIcon;
private TextView mErrorInfoView;
protected View mRemoveAccountArea;
private java.text.DateFormat mDateFormat;
private java.text.DateFormat mTimeFormat;
private Account mAccount;
// List of all accounts, updated when accounts are added/removed
// We need to re-scan the accounts on sync events, in case sync state changes.
private Account[] mAccounts;
private Button mRemoveAccountButton;
private ArrayList<SyncStateCheckBoxPreference> mCheckBoxes =
new ArrayList<SyncStateCheckBoxPreference>();
private ArrayList<String> mInvisibleAdapters = Lists.newArrayList();
// Tell if we will use the current SyncManager data or just the User input
protected boolean mUseSyncManagerFeedsState = true;
@Override
public Dialog onCreateDialog(final int id) {
@@ -266,7 +264,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
if (preference instanceof SyncStateCheckBoxPreference) {
if (preference instanceof SyncStateCheckBoxPreference && mUseSyncManagerFeedsState) {
SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) preference;
String authority = syncPref.getAuthority();
Account account = syncPref.getAccount();
@@ -347,6 +345,10 @@ public class AccountSyncSettings extends AccountPreferenceBase {
@Override
protected void onSyncStateUpdated() {
if (!isResumed()) return;
setFeedsState(mUseSyncManagerFeedsState);
}
private void setFeedsState(boolean useSyncManager) {
// iterate over all the preferences, setting the state properly for each
Date date = new Date();
List<SyncInfo> currentSyncs = ContentResolver.getCurrentSyncs();
@@ -365,49 +367,53 @@ public class AccountSyncSettings extends AccountPreferenceBase {
String authority = syncPref.getAuthority();
Account account = syncPref.getAccount();
SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority);
boolean authorityIsPending = status == null ? false : status.pending;
boolean initialSync = status == null ? false : status.initialize;
if (useSyncManager) {
SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority);
boolean authorityIsPending = status == null ? false : status.pending;
boolean initialSync = status == null ? false : status.initialize;
boolean activelySyncing = isSyncing(currentSyncs, account, authority);
boolean lastSyncFailed = status != null
&& status.lastFailureTime != 0
&& status.getLastFailureMesgAsInt(0)
!= ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS;
if (!syncEnabled) lastSyncFailed = false;
if (lastSyncFailed && !activelySyncing && !authorityIsPending) {
syncIsFailing = true;
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "Update sync status: " + account + " " + authority +
" active = " + activelySyncing + " pend =" + authorityIsPending);
}
boolean activelySyncing = isSyncing(currentSyncs, account, authority);
boolean lastSyncFailed = status != null
&& status.lastFailureTime != 0
&& status.getLastFailureMesgAsInt(0)
!= ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS;
if (!syncEnabled) lastSyncFailed = false;
if (lastSyncFailed && !activelySyncing && !authorityIsPending) {
syncIsFailing = true;
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "Update sync status: " + account + " " + authority +
" active = " + activelySyncing + " pend =" + authorityIsPending);
}
final long successEndTime = (status == null) ? 0 : status.lastSuccessTime;
if (successEndTime != 0) {
date.setTime(successEndTime);
final String timeString = mDateFormat.format(date) + " "
+ mTimeFormat.format(date);
syncPref.setSummary(timeString);
final long successEndTime = (status == null) ? 0 : status.lastSuccessTime;
if (successEndTime != 0) {
date.setTime(successEndTime);
final String timeString = mDateFormat.format(date) + " "
+ mTimeFormat.format(date);
syncPref.setSummary(timeString);
} else {
syncPref.setSummary("");
}
int syncState = ContentResolver.getIsSyncable(account, authority);
syncPref.setActive(activelySyncing && (syncState >= 0) &&
!initialSync);
syncPref.setPending(authorityIsPending && (syncState >= 0) &&
!initialSync);
syncPref.setFailed(lastSyncFailed);
ConnectivityManager connManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
} else {
syncPref.setSummary("");
syncPref.setChecked(true);
}
int syncState = ContentResolver.getIsSyncable(account, authority);
syncPref.setActive(activelySyncing && (syncState >= 0) &&
!initialSync);
syncPref.setPending(authorityIsPending && (syncState >= 0) &&
!initialSync);
syncPref.setFailed(lastSyncFailed);
ConnectivityManager connManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
}
mErrorInfoView.setVisibility(syncIsFailing ? View.VISIBLE : View.GONE);
getActivity().invalidateOptionsMenu();

View File

@@ -1,11 +1,11 @@
package com.android.settings.accounts;
import android.accounts.Account;
import android.content.ContentResolver;
import android.preference.Preference;
import com.android.settings.R;
import android.app.Activity;
import android.content.ContentResolver;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
@@ -27,6 +27,8 @@ public class AccountSyncSettingsInAddAccount extends AccountSyncSettings
mFinishArea.setVisibility(View.VISIBLE);
mFinishButton = (View) rootView.findViewById(R.id.finish_button);
mFinishButton.setOnClickListener(this);
mUseSyncManagerFeedsState = false;
}
@Override
@@ -37,6 +39,22 @@ public class AccountSyncSettingsInAddAccount extends AccountSyncSettings
}
public void onClick(View v) {
applySyncSettingsToSyncManager();
finish();
}
private void applySyncSettingsToSyncManager() {
for (int i = 0, count = getPreferenceScreen().getPreferenceCount(); i < count; i++) {
Preference pref = getPreferenceScreen().getPreference(i);
if (! (pref instanceof SyncStateCheckBoxPreference)) {
continue;
}
SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) pref;
String authority = syncPref.getAuthority();
Account account = syncPref.getAccount();
ContentResolver.setSyncAutomatically(account, authority, syncPref.isChecked());
}
}
}

View File

@@ -231,6 +231,8 @@ public class ManageAccountsSettings extends AccountPreferenceBase
}
protected void onSyncStateUpdated() {
// Catch any delayed delivery of update messages
if (getActivity() == null) return;
// Set background connection state
final ConnectivityManager connManager = (ConnectivityManager)
getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);

View File

@@ -51,11 +51,9 @@ import android.os.StatFs;
import android.os.storage.IMountService;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.text.format.Formatter;
import android.util.Log;
import android.widget.Toast;
@@ -78,8 +76,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
private static final String MEMORY_SD_GROUP = "memory_sd";
private static final String PTP_MODE_TOGGLE = "ptp_mode_toggle";
private static final String MEMORY_INTERNAL_SIZE = "memory_internal_size";
private static final String MEMORY_INTERNAL_AVAIL = "memory_internal_avail";
@@ -123,8 +119,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
boolean mSdMountToggleAdded = true;
private CheckBoxPreference mPtpModeToggle;
// Access using getMountService()
private IMountService mMountService = null;
@@ -391,16 +385,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
mSdMountPreferenceGroup.removePreference(mSdMountToggle);
}
mPtpModeToggle = (CheckBoxPreference)findPreference(PTP_MODE_TOGGLE);
if (UsbManager.isFunctionSupported(UsbManager.USB_FUNCTION_MTP)) {
mPtpModeToggle.setChecked(Settings.System.getInt(
getContentResolver(),
Settings.System.USE_PTP_INTERFACE, 0) != 0);
} else {
// hide the PTP mode toggle checkbox if MTP is not supported
getPreferenceScreen().removePreference(mPtpModeToggle);
}
mInternalSize = findPreference(MEMORY_INTERNAL_SIZE);
mInternalAvail = findPreference(MEMORY_INTERNAL_AVAIL);
mInternalMediaUsage = findPreference(MEMORY_INTERNAL_MEDIA);
@@ -485,11 +469,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
intent.setClass(getActivity(), com.android.settings.MediaFormat.class);
startActivity(intent);
return true;
} else if (preference == mPtpModeToggle) {
Settings.System.putInt(getContentResolver(),
Settings.System.USE_PTP_INTERFACE,
mPtpModeToggle.isChecked() ? 1 : 0);
return true;
}
return false;