Merge "Settings for TextToSpeech now uses the results returned by the engine's CheckVoiceData activity to determine which languages are available and whether or not to make "Install Data" clickable."
diff --git a/res/drawable-hdpi/password_field_default.9.png b/res/drawable-hdpi/password_field_default.9.png
new file mode 100644
index 0000000..2c424f0
--- /dev/null
+++ b/res/drawable-hdpi/password_field_default.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_settings.png b/res/drawable-mdpi/ic_launcher_settings.png
old mode 100755
new mode 100644
index 16db056..a8cddf3
--- a/res/drawable-mdpi/ic_launcher_settings.png
+++ b/res/drawable-mdpi/ic_launcher_settings.png
Binary files differ
diff --git a/res/drawable-mdpi/icon.png b/res/drawable-mdpi/icon.png
old mode 100755
new mode 100644
index 16db056..a8cddf3
--- a/res/drawable-mdpi/icon.png
+++ b/res/drawable-mdpi/icon.png
Binary files differ
diff --git a/res/drawable-mdpi/password_field_default.9.png b/res/drawable-mdpi/password_field_default.9.png
new file mode 100644
index 0000000..3193275
--- /dev/null
+++ b/res/drawable-mdpi/password_field_default.9.png
Binary files differ
diff --git a/res/layout-land/choose_lock_password.xml b/res/layout-land/choose_lock_password.xml
new file mode 100644
index 0000000..eba936a
--- /dev/null
+++ b/res/layout-land/choose_lock_password.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 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.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:background="@android:color/background_dark"
+ android:gravity="center_horizontal">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <!-- "Enter PIN(Password) to unlock" -->
+ <TextView android:id="@+id/headerText"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ android:layout_marginRight="6dip"
+ android:layout_marginLeft="6dip"
+ android:layout_marginTop="10dip"
+ android:layout_marginBottom="10dip"
+ android:gravity="left"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ />
+
+ <!-- Password entry field -->
+ <EditText android:id="@+id/password_entry"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:textStyle="bold"
+ android:inputType="textPassword"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:textSize="24sp"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:background="@drawable/password_field_default"
+ android:textColor="#ffffffff"
+ />
+ </LinearLayout>
+
+ <!-- Spacer between password entry and keyboard -->
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1" />
+
+ <!-- Alphanumeric keyboard -->
+ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ android:layout_alignParentBottom="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#00000000"
+ android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+ />
+
+ <RelativeLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="@android:drawable/bottom_bar">
+
+ <Button android:id="@+id/cancel_button"
+ android:layout_width="150dip"
+ android:layout_height="wrap_content"
+ android:layout_margin="5dip"
+ android:layout_alignParentLeft="true"
+ android:text="@string/password_cancel_button_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/password_ok_button_label"
+ />
+
+ </RelativeLayout>
+
+</LinearLayout>
diff --git a/res/layout-land/choose_lock_pin.xml b/res/layout-land/choose_lock_pin.xml
deleted file mode 100644
index cdc75d3..0000000
--- a/res/layout-land/choose_lock_pin.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- TODO: think about moving to frameworks/base/res -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="horizontal"
- android:background="@android:color/background_dark">
-
- <LinearLayout android:id="@+id/topDisplayGroup"
- android:layout_width="0dip"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- password entry -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="6dip"
- android:layout_marginLeft="6dip"
- android:gravity="center_vertical"
- android:background="@android:drawable/edit_text">
-
- <!-- displays dots as user enters pin -->
- <TextView android:id="@+id/pinDisplay"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textStyle="bold"
- android:inputType="textPassword"
- />
-
- <ImageButton android:id="@+id/backspace"
- android:src="@android:drawable/ic_input_delete"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="-3dip"
- android:layout_marginBottom="-3dip"
- />
- </LinearLayout>
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceLarge"/>
-
- </LinearLayout>
-
- <include
- android:id="@+id/keyPad"
- layout="@layout/twelve_key_entry"
- android:layout_width="0dip"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:layout_below="@id/topDisplayGroup"
- android:layout_marginTop="10dip"
- />
-
-</LinearLayout>
diff --git a/res/layout-land/confirm_lock_password.xml b/res/layout-land/confirm_lock_password.xml
new file mode 100644
index 0000000..3a27b9d
--- /dev/null
+++ b/res/layout-land/confirm_lock_password.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 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.
+*/
+-->
+
+<!-- This is basically the same layout now, but will likely change -->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include
+ layout="@layout/choose_lock_password"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ />
+</merge>
diff --git a/res/layout-land/confirm_lock_pin.xml b/res/layout-land/confirm_lock_pin.xml
deleted file mode 100644
index beff4a1..0000000
--- a/res/layout-land/confirm_lock_pin.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- TODO: think about moving to frameworks/base/res -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:background="@android:color/background_dark"
- android:gravity="center_horizontal">
-
- <LinearLayout android:id="@+id/topDisplayGroup"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceLarge"/>
-
- <!-- password entry -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="6dip"
- android:layout_marginLeft="6dip"
- android:gravity="center_vertical"
- android:background="@android:drawable/edit_text">
-
- <!-- displays dots as user enters pin -->
- <TextView android:id="@+id/pinDisplay"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textStyle="bold"
- android:inputType="textPassword"
- />
-
- <ImageButton android:id="@+id/backspace"
- android:src="@android:drawable/ic_input_delete"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="-3dip"
- android:layout_marginBottom="-3dip"
- />
- </LinearLayout>
-
- </LinearLayout>
-
- <include
- android:id="@+id/keyPad"
- layout="@layout/twelve_key_entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/topDisplayGroup"
- android:layout_marginTop="10dip"
- />
-
-</LinearLayout>
diff --git a/res/layout/choose_lock_password.xml b/res/layout/choose_lock_password.xml
index 213f9a4..ffef021 100644
--- a/res/layout/choose_lock_password.xml
+++ b/res/layout/choose_lock_password.xml
@@ -16,9 +16,6 @@
** limitations under the License.
*/
-->
-
-<!-- TODO: think about moving to frameworks/base/res -->
-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -26,55 +23,80 @@
android:background="@android:color/background_dark"
android:gravity="center_horizontal">
- <LinearLayout android:id="@+id/topDisplayGroup"
+ <!-- header text ('Enter Pin') -->
+ <TextView android:id="@+id/headerText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:gravity="center"
+ android:lines="2"
+ android:textAppearance="?android:attr/textAppearanceLarge"/>
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceLarge"/>
-
- <!-- password entry -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="6dip"
- android:layout_marginLeft="6dip"
- android:gravity="center_vertical"
- android:background="@android:drawable/edit_text">
-
- <!-- displays dots as user enters pin -->
- <TextView android:id="@+id/pinDisplay"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textStyle="bold"
- android:inputType="textPassword"
- />
-
- <ImageButton android:id="@+id/backspace"
- android:src="@android:drawable/ic_input_delete"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="-3dip"
- android:layout_marginBottom="-3dip"
- />
- </LinearLayout>
-
- </LinearLayout>
-
+ <!-- spacer above text entry field -->
<View
+ android:id="@+id/spacerBottom"
android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
+ android:layout_height="1dip"
+ android:layout_marginTop="6dip"
+ android:background="@android:drawable/divider_horizontal_dark"
/>
+ <!-- Password entry field -->
+ <EditText android:id="@+id/password_entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textStyle="bold"
+ android:inputType="textPassword"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:textSize="32sp"
+ android:layout_marginTop="15dip"
+ android:layout_marginLeft="30dip"
+ android:layout_marginRight="30dip"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:background="@drawable/password_field_default"
+ android:textColor="#ffffffff"
+ />
+
+ <!-- Spacer between password entry and keyboard -->
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1" />
+
+ <!-- Alphanumeric keyboard -->
+ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+ android:layout_alignParentBottom="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#00000000"
+ android:layout_marginBottom="30dip"
+ android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+ />
+
+ <RelativeLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="@android:drawable/bottom_bar">
+
+ <Button android:id="@+id/cancel_button"
+ android:layout_width="150dip"
+ android:layout_height="wrap_content"
+ android:layout_margin="5dip"
+ android:layout_alignParentLeft="true"
+ android:text="@string/password_cancel_button_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/password_ok_button_label"
+ />
+
+ </RelativeLayout>
+
</LinearLayout>
diff --git a/res/layout/choose_lock_pin.xml b/res/layout/choose_lock_pin.xml
deleted file mode 100644
index beff4a1..0000000
--- a/res/layout/choose_lock_pin.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- TODO: think about moving to frameworks/base/res -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:background="@android:color/background_dark"
- android:gravity="center_horizontal">
-
- <LinearLayout android:id="@+id/topDisplayGroup"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceLarge"/>
-
- <!-- password entry -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="6dip"
- android:layout_marginLeft="6dip"
- android:gravity="center_vertical"
- android:background="@android:drawable/edit_text">
-
- <!-- displays dots as user enters pin -->
- <TextView android:id="@+id/pinDisplay"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textStyle="bold"
- android:inputType="textPassword"
- />
-
- <ImageButton android:id="@+id/backspace"
- android:src="@android:drawable/ic_input_delete"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="-3dip"
- android:layout_marginBottom="-3dip"
- />
- </LinearLayout>
-
- </LinearLayout>
-
- <include
- android:id="@+id/keyPad"
- layout="@layout/twelve_key_entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/topDisplayGroup"
- android:layout_marginTop="10dip"
- />
-
-</LinearLayout>
diff --git a/res/layout/confirm_lock_password.xml b/res/layout/confirm_lock_password.xml
new file mode 100644
index 0000000..3a27b9d
--- /dev/null
+++ b/res/layout/confirm_lock_password.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 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.
+*/
+-->
+
+<!-- This is basically the same layout now, but will likely change -->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <include
+ layout="@layout/choose_lock_password"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ />
+</merge>
diff --git a/res/layout/confirm_lock_pin.xml b/res/layout/confirm_lock_pin.xml
deleted file mode 100644
index beff4a1..0000000
--- a/res/layout/confirm_lock_pin.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- TODO: think about moving to frameworks/base/res -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:background="@android:color/background_dark"
- android:gravity="center_horizontal">
-
- <LinearLayout android:id="@+id/topDisplayGroup"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceLarge"/>
-
- <!-- password entry -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="6dip"
- android:layout_marginLeft="6dip"
- android:gravity="center_vertical"
- android:background="@android:drawable/edit_text">
-
- <!-- displays dots as user enters pin -->
- <TextView android:id="@+id/pinDisplay"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textStyle="bold"
- android:inputType="textPassword"
- />
-
- <ImageButton android:id="@+id/backspace"
- android:src="@android:drawable/ic_input_delete"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="-3dip"
- android:layout_marginBottom="-3dip"
- />
- </LinearLayout>
-
- </LinearLayout>
-
- <include
- android:id="@+id/keyPad"
- layout="@layout/twelve_key_entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/topDisplayGroup"
- android:layout_marginTop="10dip"
- />
-
-</LinearLayout>
diff --git a/res/layout/installed_app_details.xml b/res/layout/installed_app_details.xml
index 8da1d76..423e3c1 100644
--- a/res/layout/installed_app_details.xml
+++ b/res/layout/installed_app_details.xml
@@ -72,7 +72,10 @@
android:paddingRight="6dip"
android:scaleType="fitCenter" />
</RelativeLayout>
-
+ <!-- Force stop and uninstall buttons -->
+ <include
+ layout="@layout/two_buttons_panel"
+ android:id="@+id/control_buttons_panel"/>
<TextView
style="?android:attr/listSeparatorTextViewStyle"
@@ -193,37 +196,11 @@
android:maxLines="1" />
</LinearLayout>
- <!-- Manage space, Clear data/Uninstall buttons -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="bottom"
- android:orientation="horizontal">
- <Button
- android:id="@+id/manage_space_button"
- android:text="@string/manage_space_text"
- android:visibility="invisible"
- android:layout_width="150dip"
- android:paddingLeft="6dip"
- android:layout_gravity="left"
- android:layout_weight="0.4"
- android:layout_height="wrap_content"/>
- <!-- Spacer -->
- <View
- android:id="@+id/buttons_spacer_left"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="0.2"
- android:visibility="gone" />
-
- <Button
- android:id="@+id/uninstall_button"
- android:layout_width="150dip"
- android:paddingRight="6dip"
- android:layout_gravity="right"
- android:layout_weight="0.4"
- android:layout_height="wrap_content"/>
- </LinearLayout>
+ <!-- Clear data and install location buttons -->
+ <include
+ layout="@layout/two_buttons_panel"
+ android:id="@+id/data_buttons_panel"/>
+
</LinearLayout>
<!-- Clear cache section -->
@@ -307,25 +284,6 @@
android:layout_height="wrap_content" />
</RelativeLayout>
- <!-- Other controls section -->
- <TextView
- style="?android:attr/listSeparatorTextViewStyle"
- android:text="@string/controls_label" />
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical">
- <Button android:id="@+id/force_stop_button"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:paddingTop="6dip"
- android:layout_width="150dip"
- android:text="@string/force_stop"
- android:layout_height="wrap_content" />
- </RelativeLayout>
-
<!-- Permissions section -->
<LinearLayout
android:id="@+id/permissions_section"
diff --git a/res/layout/two_buttons_panel.xml b/res/layout/two_buttons_panel.xml
new file mode 100755
index 0000000..d76855c
--- /dev/null
+++ b/res/layout/two_buttons_panel.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!--
+ Defines a panel with two buttons and a spacer in between.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="bottom"
+ android:paddingTop="4dip"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:orientation="horizontal">
+ <Button
+ android:id="@+id/left_button"
+ android:layout_width="150dip"
+ android:paddingLeft="6dip"
+ android:layout_gravity="left"
+ android:layout_weight="0.4"
+ android:layout_height="wrap_content"/>
+ <!-- Spacer -->
+ <View
+ android:id="@+id/buttons_spacer_left"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_weight="0.2" />
+ <Button
+ android:id="@+id/right_button"
+ android:layout_width="150dip"
+ android:paddingRight="6dip"
+ android:layout_gravity="right"
+ android:text="@string/cancel"
+ android:layout_weight="0.4"
+ android:layout_height="wrap_content"/>
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d145841..39198ef 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -534,6 +534,10 @@
<string name="manage_device_admin">Select device administrators</string>
<!-- Summary of preference to manage device policies -->
<string name="manage_device_admin_summary">Add or remove device administrators</string>
+ <!-- Label for ChoosePassword/PIN OK button -->
+ <string name="password_ok_button_label">OK</string>
+ <!-- Label for ChoosePassword/PIN OK button -->
+ <string name="password_cancel_button_label">Cancel</string>
<!-- Bluetooth settings -->
<!-- Bluetooth settings check box title on Main Settings screen -->
@@ -966,7 +970,7 @@
<string name="dock_not_found_title">Dock not found</string>
<!-- Dock not found dialog text -->
<string name="dock_not_found_text">The phone must be docked to configure dock audio</string>
-
+
<!-- Acounts & Sync settings screen setting option name to go into the screen for data sync settings-->
<string name="sync_settings">Accounts & sync</string>
<!-- Main Settings screen setting option summary text for the itme to go into the screen with data sync settings-->
@@ -1125,7 +1129,7 @@
<!-- 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">Unmount the SD card for safe removal</string>
-
+
<!-- SD card & phone storage settings item summary that is displayed when no SD card is inserted -->
<string name="sd_insert_summary">Insert an SD card for mounting</string>
<!-- SD card & phone storage settings item title that will result in the phone mounting the SD card. -->
@@ -1302,17 +1306,6 @@
<string name="assisted_gps_enabled">Use server to assist GPS (uncheck to reduce network usage)</string>
<!-- Security & location settings screen, setting summary when Assisted GPS check box is clear -->
<string name="assisted_gps_disabled">Use server to assist GPS (uncheck to improve GPS performance)</string>
- <!-- Setting title for allow sending location to google -->
- <string name="use_location_title">Use My Location</string>
- <!-- Setting summary for allowing Google to use location information for improved search results. -->
- <string name="use_location_summary">Use My Location for Google search results and other Google services</string>
- <!-- Message of dialog to user requesting use of location information -->
- <string name="use_location_warning_message">Do you want to allow Google to use location for improved search results and other services?</string>
- <!-- Agree -->
- <string name="agree">Agree</string>
- <!-- Disagree -->
- <string name="disagree">Disagree</string>
-
<!-- About --> <skip />
<!-- Main settings screen, setting title for the user to go into the About phone screen -->
@@ -1559,6 +1552,16 @@
<string name="empty_list_msg">You do not have any third-party applications installed.</string>
<!-- Manage applications, version string displayed in app snippet -->
<string name="version_text">version <xliff:g id="version_num">%1$s</xliff:g></string>
+ <!-- Manage applications, text for Move button -->
+ <string name="move_app">Move</string>
+ <!-- Manage applications, text for Move button to move app to internal storage -->
+ <string name="move_app_to_internal">Move to flash</string>
+ <!-- Manage applications, text for Move button to move app to sdcard -->
+ <string name="move_app_to_sdcard">Move to sdcard</string>
+ <!-- Manage applications, title for dialog when killing persistent apps-->
+ <string name="force_stop_dlg_title">Force Stop</string>
+ <!-- Manage applications, text for dialog when killing persistent apps-->
+ <string name="force_stop_dlg_text">This application will be restarted right way. Are you sure you want to force stop?</string>
<!-- Services settings screen, setting option name for the user to go to the screen to view running services -->
<string name="runningservices_settings_title">Running services</string>
@@ -2007,7 +2010,7 @@
<string name="voice_search_settings_title">Voice search</string>
<!-- Title of keyboard settings list item within voice input/output settings -->
<string name="keyboard_settings_title">Android keyboard</string>
-
+
<!-- Text-To-Speech (TTS) settings --><skip />
<!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings related to the text-to-speech functionality -->
<string name="tts_settings">Text-to-speech</string>
@@ -2270,8 +2273,6 @@
<string name="privacy_settings">Privacy</string>
<!-- Privacy settings activity title -->
<string name="privacy_settings_title">Privacy settings</string>
- <!-- Location settings section title -->
- <string name="location_section_title">Location</string>
<!-- Backup section title -->
<string name="backup_section_title">Backup and Restore</string>
<!-- Personal data section title -->
@@ -2316,7 +2317,7 @@
<string name="device_admin_status">This administrator is active and allows
the application <xliff:g id="app_name">%1$s</xliff:g> to perform the
following operations:</string>
-
+
<!-- Name to assign to a Network Access Point that was saved without a name -->
<string name="untitled_apn">Untitled</string>
</resources>
diff --git a/res/xml/privacy_settings.xml b/res/xml/privacy_settings.xml
index 9a440cc..cb145d5 100644
--- a/res/xml/privacy_settings.xml
+++ b/res/xml/privacy_settings.xml
@@ -16,16 +16,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <PreferenceCategory android:key="location_category"
- android:title="@string/location_section_title">
- <!-- Share location with Google -->
- <CheckBoxPreference
- android:key="use_location"
- android:title="@string/use_location_title"
- android:persistent="false"
- android:summary="@string/use_location_summary"/>
- </PreferenceCategory>
-
<PreferenceCategory android:key="backup_category"
android:title="@string/backup_section_title">
<!-- Backup settings -->
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 6f9cefd..ed4150a 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -20,26 +20,30 @@
import java.util.regex.Pattern;
import com.android.internal.widget.LockPatternUtils;
+import com.android.internal.widget.PasswordEntryKeyboardHelper;
+import com.android.internal.widget.PasswordEntryKeyboardView;
import com.android.settings.ChooseLockPattern.LeftButtonMode;
import com.android.settings.ChooseLockPattern.RightButtonMode;
import com.android.settings.ChooseLockPattern.Stage;
import android.app.Activity;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.graphics.PixelFormat;
+import android.inputmethodservice.KeyboardView;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
+import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class ChooseLockPassword extends Activity implements OnClickListener {
- private final int digitIds[] = new int[] { R.id.zero, R.id.one, R.id.two, R.id.three,
- R.id.four, R.id.five, R.id.six, R.id.seven, R.id.eight, R.id.nine };
- private TextView mPasswordTextView;
+ private TextView mPasswordEntry;
private int mPasswordMinLength = 4;
private int mPasswordMaxLength = 8;
private LockPatternUtils mLockPatternUtils;
@@ -48,6 +52,8 @@
private com.android.settings.ChooseLockPassword.Stage mUiStage = Stage.Introduction;
private TextView mHeaderText;
private String mFirstPin;
+ private KeyboardView mKeyboardView;
+ private PasswordEntryKeyboardHelper mKeyboardHelper;
public static final String PASSWORD_MIN_KEY = "lockscreen.password_min";
public static final String PASSWORD_MAX_KEY = "lockscreen.password_max";
private static Handler mHandler = new Handler();
@@ -79,7 +85,7 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLockPatternUtils = new LockPatternUtils(this);
- mRequestedMode = getIntent().getIntExtra("password_mode", mRequestedMode);
+ mRequestedMode = getIntent().getIntExtra(LockPatternUtils.PASSWORD_TYPE_KEY, mRequestedMode);
mPasswordMinLength = getIntent().getIntExtra("password_min_length", mPasswordMinLength);
mPasswordMaxLength = getIntent().getIntExtra("password_max_length", mPasswordMaxLength);
int minMode = mLockPatternUtils.getRequestedPasswordMode();
@@ -99,25 +105,38 @@
}
private void initViews() {
- switch(mRequestedMode) {
- case LockPatternUtils.MODE_PIN:
- case LockPatternUtils.MODE_PASSWORD:
- case LockPatternUtils.MODE_PATTERN:
- setContentView(R.layout.choose_lock_pin);
- // TODO: alphanumeric layout
- // setContentView(R.layout.choose_lock_password);
- for (int i = 0; i < digitIds.length; i++) {
- Button button = (Button) findViewById(digitIds[i]);
- button.setOnClickListener(this);
- button.setText(Integer.toString(i));
- }
- break;
- }
- findViewById(R.id.ok).setOnClickListener(this);
- findViewById(R.id.cancel).setOnClickListener(this);
- findViewById(R.id.backspace).setOnClickListener(this);
- mPasswordTextView = (TextView) findViewById(R.id.pinDisplay);
+ setContentView(R.layout.choose_lock_password);
+ // Disable IME on our window since we provide our own keyboard
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
+ WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
+
+ findViewById(R.id.cancel_button).setOnClickListener(this);
+ findViewById(R.id.next_button).setOnClickListener(this);
+
+ mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
+ mPasswordEntry = (TextView) findViewById(R.id.password_entry);
+
+ final boolean isAlpha = LockPatternUtils.MODE_PASSWORD == mRequestedMode;
+ mKeyboardHelper = new PasswordEntryKeyboardHelper(this, mKeyboardView, mPasswordEntry);
+ mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
+ : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
+
mHeaderText = (TextView) findViewById(R.id.headerText);
+ mKeyboardView.requestFocus();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mKeyboardView.requestFocus();
+ }
+
+ @Override
+ protected void onResume() {
+ // TODO Auto-generated method stub
+ super.onResume();
+ updateStage(mUiStage);
+ mKeyboardView.requestFocus();
}
@Override
@@ -136,7 +155,7 @@
protected void updateStage(Stage stage) {
mHeaderText.setText(stage.headerMessage);
- mPasswordTextView.setText("");
+ mPasswordEntry.setText("");
mUiStage = stage;
}
@@ -172,9 +191,9 @@
public void onClick(View v) {
switch (v.getId()) {
- case R.id.ok:
+ case R.id.next_button:
{
- final String pin = mPasswordTextView.getText().toString();
+ final String pin = mPasswordEntry.getText().toString();
if (TextUtils.isEmpty(pin)) {
break;
}
@@ -203,35 +222,15 @@
}
break;
- case R.id.backspace:
- {
- final Editable digits = mPasswordTextView.getEditableText();
- final int len = digits.length();
- if (len > 0) {
- digits.delete(len-1, len);
- }
- }
- break;
-
- case R.id.cancel:
+ case R.id.cancel_button:
finish();
break;
-
- default:
- // Digits
- for (int i = 0; i < digitIds.length; i++) {
- if (v.getId() == digitIds[i]) {
- mPasswordTextView.append(Integer.toString(i));
- return;
- }
- }
- break;
}
}
private void showError(String msg, final Stage next) {
mHeaderText.setText(msg);
- mPasswordTextView.setText("");
+ mPasswordEntry.setText("");
mHandler.postDelayed(new Runnable() {
public void run() {
updateStage(next);
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index 5308f88..78d6ff1 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -17,24 +17,27 @@
package com.android.settings;
import com.android.internal.widget.LockPatternUtils;
+import com.android.internal.widget.PasswordEntryKeyboardHelper;
+import com.android.internal.widget.PasswordEntryKeyboardView;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.view.View;
+import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class ConfirmLockPassword extends Activity implements OnClickListener {
private static final long ERROR_MESSAGE_TIMEOUT = 3000;
- private final int digitIds[] = new int[] { R.id.zero, R.id.one, R.id.two, R.id.three,
- R.id.four, R.id.five, R.id.six, R.id.seven, R.id.eight, R.id.nine };
- private TextView mPasswordTextView;
+ private TextView mPasswordEntry;
private LockPatternUtils mLockPatternUtils;
private TextView mHeaderText;
private Handler mHandler = new Handler();
+ private PasswordEntryKeyboardHelper mKeyboardHelper;
+ private PasswordEntryKeyboardView mKeyboardView;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -45,27 +48,43 @@
private void initViews() {
int mode = mLockPatternUtils.getPasswordMode();
- if (LockPatternUtils.MODE_PIN == mode || LockPatternUtils.MODE_PASSWORD == mode) {
- setContentView(R.layout.confirm_lock_pin);
- for (int i = 0; i < digitIds.length; i++) {
- Button button = (Button) findViewById(digitIds[i]);
- button.setOnClickListener(this);
- button.setText(Integer.toString(i));
- }
- findViewById(R.id.ok).setOnClickListener(this);
- findViewById(R.id.cancel).setOnClickListener(this);
- }
- findViewById(R.id.backspace).setOnClickListener(this);
- mPasswordTextView = (TextView) findViewById(R.id.pinDisplay);
+ setContentView(R.layout.confirm_lock_password);
+ // Disable IME on our window since we provide our own keyboard
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
+ WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
+
+ findViewById(R.id.cancel_button).setOnClickListener(this);
+ findViewById(R.id.next_button).setOnClickListener(this);
+ mPasswordEntry = (TextView) findViewById(R.id.password_entry);
+ mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
mHeaderText = (TextView) findViewById(R.id.headerText);
mHeaderText.setText(R.string.lockpassword_confirm_your_password_header);
+ final boolean isAlpha =
+ LockPatternUtils.MODE_PASSWORD == mLockPatternUtils.getPasswordMode();
+ mKeyboardHelper = new PasswordEntryKeyboardHelper(this, mKeyboardView, mPasswordEntry);
+ mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
+ : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
+ mKeyboardView.requestFocus();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mKeyboardView.requestFocus();
+ }
+
+ @Override
+ protected void onResume() {
+ // TODO Auto-generated method stub
+ super.onResume();
+ mKeyboardView.requestFocus();
}
public void onClick(View v) {
switch (v.getId()) {
- case R.id.ok:
+ case R.id.next_button:
{
- final String pin = mPasswordTextView.getText().toString();
+ final String pin = mPasswordEntry.getText().toString();
if (mLockPatternUtils.checkPassword(pin)) {
setResult(RESULT_OK);
finish();
@@ -75,36 +94,16 @@
}
break;
- case R.id.backspace:
- {
- final Editable digits = mPasswordTextView.getEditableText();
- final int len = digits.length();
- if (len > 0) {
- digits.delete(len-1, len);
- }
- }
- break;
-
- case R.id.cancel:
+ case R.id.cancel_button:
setResult(RESULT_CANCELED);
finish();
break;
-
- default:
- // Digits
- for (int i = 0; i < digitIds.length; i++) {
- if (v.getId() == digitIds[i]) {
- mPasswordTextView.append(Integer.toString(i));
- return;
- }
- }
- break;
}
}
private void showError(int msg) {
mHeaderText.setText(msg);
- mPasswordTextView.setText(null);
+ mPasswordEntry.setText(null);
mHandler.postDelayed(new Runnable() {
public void run() {
mHeaderText.setText(R.string.lockpassword_confirm_your_password_header);
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 28a5829..72a0741 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -27,7 +27,6 @@
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.Bundle;
-import android.os.IMountService;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.preference.CheckBoxPreference;
diff --git a/src/com/android/settings/InstalledAppDetails.java b/src/com/android/settings/InstalledAppDetails.java
index eeecf46..1358133 100644
--- a/src/com/android/settings/InstalledAppDetails.java
+++ b/src/com/android/settings/InstalledAppDetails.java
@@ -23,6 +23,7 @@
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.app.Dialog;
+import android.app.ActivityManager.RunningAppProcessInfo;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -62,11 +63,12 @@
* For non-system applications, there is no option to clear data. Instead there is an option to
* uninstall the application.
*/
-public class InstalledAppDetails extends Activity implements View.OnClickListener, DialogInterface.OnClickListener {
+public class InstalledAppDetails extends Activity implements View.OnClickListener {
private static final String TAG="InstalledAppDetails";
private static final int _UNKNOWN_APP=R.string.unknown;
private ApplicationInfo mAppInfo;
- private Button mAppButton;
+ private Button mUninstallButton;
+ private boolean mUpdatedSysApp = false;
private Button mActivitiesButton;
private boolean localLOGV = false;
private TextView mAppVersion;
@@ -76,14 +78,14 @@
private PkgSizeObserver mSizeObserver;
private ClearUserDataObserver mClearDataObserver;
// Views related to cache info
- private View mCachePanel;
private TextView mCacheSize;
private Button mClearCacheButton;
private ClearCacheObserver mClearCacheObserver;
private Button mForceStopButton;
+ private Button mClearDataButton;
+ private Button mMoveAppButton;
PackageStats mSizeInfo;
- private Button mManageSpaceButton;
private PackageManager mPm;
//internal constants used in Handler
@@ -101,7 +103,6 @@
// Resource strings
private CharSequence mInvalidSizeStr;
private CharSequence mComputingStr;
- private CharSequence mAppButtonText;
// Dialog identifiers used in showDialog
private static final int DLG_BASE = 0;
@@ -109,15 +110,7 @@
private static final int DLG_FACTORY_RESET = DLG_BASE + 2;
private static final int DLG_APP_NOT_FOUND = DLG_BASE + 3;
private static final int DLG_CANNOT_CLEAR_DATA = DLG_BASE + 4;
-
- // Possible btn states
- private enum AppButtonStates {
- CLEAR_DATA,
- UNINSTALL,
- FACTORY_RESET,
- NONE
- }
- private AppButtonStates mAppButtonState;
+ private static final int DLG_FORCE_STOP = DLG_BASE + 5;
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
@@ -147,7 +140,6 @@
}
class PkgSizeObserver extends IPackageStatsObserver.Stub {
- public int idx;
public void onGetStatsCompleted(PackageStats pStats, boolean succeeded) {
Message msg = mHandler.obtainMessage(GET_PKG_SIZE);
Bundle data = new Bundle();
@@ -173,6 +165,69 @@
return Formatter.formatFileSize(this, size);
}
+ private void initDataButtons() {
+ if (mAppInfo.manageSpaceActivityName != null) {
+ mClearDataButton.setText(R.string.manage_space_text);
+ } else {
+ mClearDataButton.setText(R.string.clear_user_data_text);
+ }
+ mClearDataButton.setOnClickListener(this);
+ String pkgName = mAppInfo.packageName;
+ boolean dataOnly = false;
+ ApplicationInfo info1 = null;
+ ApplicationInfo info2 = null;
+
+ try {
+ info1 = mPm.getApplicationInfo(pkgName, 0);
+ } catch (NameNotFoundException e) {
+ }
+ dataOnly = (info1 == null) && (mAppInfo != null);
+ if (dataOnly) {
+ mMoveAppButton.setText(R.string.move_app);
+ } else if ((mAppInfo.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0) {
+ mMoveAppButton.setText(R.string.move_app_to_internal);
+ } else {
+ mMoveAppButton.setText(R.string.move_app_to_sdcard);
+ }
+ }
+
+ private void initControlButtons() {
+ mUpdatedSysApp = (mAppInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
+ boolean enabled = true;
+ if (mUpdatedSysApp) {
+ mUninstallButton.setText(R.string.app_factory_reset);
+ } else if ((mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0){
+ mUninstallButton.setText(R.string.uninstall_text);
+ } else {
+ // Disable uninstall for system apps
+ enabled = false;
+ }
+ mUninstallButton.setEnabled(enabled);
+ if (enabled) {
+ // Register listener
+ mUninstallButton.setOnClickListener(this);
+ }
+ ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
+ List<RunningAppProcessInfo> rList = am.getRunningAppProcesses();
+ boolean running = false;
+ if (rList != null) {
+ for (RunningAppProcessInfo info : rList) {
+ if (info.pkgList != null) {
+ for (String rpkg : info.pkgList) {
+ if (rpkg.equals(mAppInfo.packageName)) {
+ running = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ mForceStopButton.setEnabled(running);
+ if (running) {
+ mForceStopButton.setOnClickListener(this);
+ }
+ }
+
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle icicle) {
@@ -205,21 +260,23 @@
mAppSize.setText(appSizeStr);
mDataSize = (TextView)findViewById(R.id.data_size_text);
mDataSize.setText(dataSizeStr);
- // Get AppButton
- mAppButton = ((Button)findViewById(R.id.uninstall_button));
- // Get ManageSpaceButton
- mManageSpaceButton = (Button)findViewById(R.id.manage_space_button);
- if(mAppInfo.manageSpaceActivityName != null) {
- mManageSpaceButton.setVisibility(View.VISIBLE);
- mManageSpaceButton.setOnClickListener(this);
- }
+ // Get Control button panel
+ View btnPanel = findViewById(R.id.control_buttons_panel);
+ mForceStopButton = (Button) btnPanel.findViewById(R.id.left_button);
+ mForceStopButton.setText(R.string.force_stop);
+ mUninstallButton = (Button)btnPanel.findViewById(R.id.right_button);
+ initControlButtons();
+ // Initialize clear data and move install location buttons
+ View data_buttons_panel = findViewById(R.id.data_buttons_panel);
+ mClearDataButton = (Button) data_buttons_panel.findViewById(R.id.left_button);
+ mMoveAppButton = (Button) data_buttons_panel.findViewById(R.id.right_button);
+ // Disable move for now
+ mMoveAppButton.setEnabled(false);
// Cache section
- mCachePanel = findViewById(R.id.cache_panel);
mCacheSize = (TextView) findViewById(R.id.cache_size_text);
mCacheSize.setText(mComputingStr);
mClearCacheButton = (Button) findViewById(R.id.clear_cache_button);
- mForceStopButton = (Button) findViewById(R.id.force_stop_button);
- mForceStopButton.setOnClickListener(this);
+
// Get list of preferred activities
mActivitiesButton = (Button)findViewById(R.id.clear_activities_button);
List<ComponentName> prefActList = new ArrayList<ComponentName>();
@@ -253,9 +310,10 @@
private void refreshAppAttributes(PackageInfo pkgInfo) {
setAppLabelAndIcon();
+ initControlButtons();
+ initDataButtons();
// Version number of application
setAppVersion(pkgInfo);
- setAppBtnState();
// Refresh size info
if (mAppInfo != null && mAppInfo.packageName != null) {
mPm.getPackageSizeInfo(mAppInfo.packageName, mSizeObserver);
@@ -286,38 +344,9 @@
}
}
- // Utility method to set button state
- private void setAppBtnState() {
- boolean visible = true;
- if ((mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
- if ((mAppInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
- mAppButtonState = AppButtonStates.FACTORY_RESET;
- mAppButtonText = getText(R.string.app_factory_reset);
- } else {
- if ((mAppInfo.flags & ApplicationInfo.FLAG_ALLOW_CLEAR_USER_DATA) == 0) {
- // Hide button if diableClearUserData is set
- mAppButtonState = AppButtonStates.NONE;
- visible = false;
- } else {
- mAppButtonState = AppButtonStates.CLEAR_DATA;
- mAppButtonText = getText(R.string.clear_user_data_text);
- }
- }
- } else {
- mAppButtonState = AppButtonStates.UNINSTALL;
- mAppButtonText = getText(R.string.uninstall_text);
- }
- if(visible) {
- mAppButton.setText(mAppButtonText);
- mAppButton.setVisibility(View.VISIBLE);
- } else {
- mAppButton.setVisibility(View.GONE);
- }
- }
-
@Override
- public void onStart() {
- super.onStart();
+ public void onResume() {
+ super.onResume();
PackageInfo pkgInfo;
// Get application info again to refresh changed properties of application
try {
@@ -332,13 +361,12 @@
}
refreshAppAttributes(pkgInfo);
}
-
+
private void setIntentAndFinish(boolean finish, boolean appChanged) {
if(localLOGV) Log.i(TAG, "appChanged="+appChanged);
Intent intent = new Intent();
intent.putExtra(ManageApplications.APP_CHG, appChanged);
setResult(ManageApplications.RESULT_OK, intent);
- mAppButton.setEnabled(false);
if(finish) {
finish();
}
@@ -383,18 +411,11 @@
mSizeInfo = newPs;
}
}
-
- long data = mSizeInfo.dataSize;
- // Disable button if data is 0
- if(mAppButtonState != AppButtonStates.NONE){
- mAppButton.setText(mAppButtonText);
- if((mAppButtonState == AppButtonStates.CLEAR_DATA) && (data == 0)) {
- mAppButton.setEnabled(false);
- } else {
- mAppButton.setEnabled(true);
- mAppButton.setOnClickListener(this);
- }
+ // If data size is zero disable clear data button
+ if (newPs.dataSize == 0) {
+ mClearDataButton.setEnabled(false);
}
+ long data = mSizeInfo.dataSize;
refreshCacheInfo(newPs.cacheSize);
}
@@ -415,12 +436,12 @@
private void processClearMsg(Message msg) {
int result = msg.arg1;
String packageName = mAppInfo.packageName;
+ mClearDataButton.setText(R.string.clear_user_data_text);
if(result == OP_SUCCESSFUL) {
- Log.i(TAG, "Cleared user data for system package:"+packageName);
+ Log.i(TAG, "Cleared user data for package : "+packageName);
mPm.getPackageSizeInfo(packageName, mSizeObserver);
} else {
- mAppButton.setText(R.string.clear_user_data_text);
- mAppButton.setEnabled(true);
+ mClearDataButton.setEnabled(true);
}
}
@@ -428,11 +449,11 @@
* Private method to initiate clearing user data when the user clicks the clear data
* button for a system package
*/
- private void initiateClearUserDataForSysPkg() {
- mAppButton.setEnabled(false);
- //invoke uninstall or clear user data based on sysPackage
+ private void initiateClearUserData() {
+ mClearDataButton.setEnabled(false);
+ // Invoke uninstall or clear user data based on sysPackage
String packageName = mAppInfo.packageName;
- Log.i(TAG, "Clearing user data for system package");
+ Log.i(TAG, "Clearing user data for package : " + packageName);
if(mClearDataObserver == null) {
mClearDataObserver = new ClearUserDataObserver();
}
@@ -443,7 +464,7 @@
Log.i(TAG, "Couldnt clear application user data for package:"+packageName);
showDialogInner(DLG_CANNOT_CLEAR_DATA);
} else {
- mAppButton.setText(R.string.recompute_size);
+ mClearDataButton.setText(R.string.recompute_size);
}
}
@@ -453,23 +474,35 @@
}
@Override
- public Dialog onCreateDialog(int id) {
+ public Dialog onCreateDialog(int id, Bundle args) {
switch (id) {
case DLG_CLEAR_DATA:
return new AlertDialog.Builder(this)
.setTitle(getString(R.string.clear_data_dlg_title))
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(getString(R.string.clear_data_dlg_text))
- .setPositiveButton(R.string.dlg_ok, this)
- .setNegativeButton(R.string.dlg_cancel, this)
+ .setPositiveButton(R.string.dlg_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Clear user data here
+ initiateClearUserData();
+ }
+ })
+ .setNegativeButton(R.string.dlg_cancel, null)
.create();
case DLG_FACTORY_RESET:
return new AlertDialog.Builder(this)
.setTitle(getString(R.string.app_factory_reset_dlg_title))
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(getString(R.string.app_factory_reset_dlg_text))
- .setPositiveButton(R.string.dlg_ok, this)
- .setNegativeButton(R.string.dlg_cancel, this)
+ .setPositiveButton(R.string.dlg_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Clear user data here
+ uninstallPkg(mAppInfo.packageName);
+ }
+ })
+ .setNegativeButton(R.string.dlg_cancel, null)
.create();
case DLG_APP_NOT_FOUND:
return new AlertDialog.Builder(this)
@@ -492,11 +525,26 @@
.setNeutralButton(R.string.dlg_ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
+ mClearDataButton.setEnabled(false);
//force to recompute changed value
setIntentAndFinish(false, false);
}
})
.create();
+ case DLG_FORCE_STOP:
+ return new AlertDialog.Builder(this)
+ .setTitle(getString(R.string.force_stop_dlg_title))
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setMessage(getString(R.string.force_stop_dlg_text))
+ .setPositiveButton(R.string.dlg_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Force stop
+ forceStopPackage(mAppInfo.packageName);
+ }
+ })
+ .setNegativeButton(R.string.dlg_cancel, null)
+ .create();
}
return null;
}
@@ -509,27 +557,35 @@
setIntentAndFinish(true, true);
}
+ private void forceStopPackage(String pkgName) {
+ ActivityManager am = (ActivityManager)getSystemService(
+ Context.ACTIVITY_SERVICE);
+ am.forceStopPackage(pkgName);
+ }
+
/*
* Method implementing functionality of buttons clicked
* @see android.view.View.OnClickListener#onClick(android.view.View)
*/
public void onClick(View v) {
String packageName = mAppInfo.packageName;
- if(v == mAppButton) {
- if (mAppButtonState == AppButtonStates.CLEAR_DATA) {
- showDialogInner(DLG_CLEAR_DATA);
- } else if (mAppButtonState == AppButtonStates.FACTORY_RESET) {
+ if(v == mUninstallButton) {
+ if (mUpdatedSysApp) {
showDialogInner(DLG_FACTORY_RESET);
- } else if (mAppButtonState == AppButtonStates.UNINSTALL) {
+ } else {
uninstallPkg(packageName);
}
} else if(v == mActivitiesButton) {
mPm.clearPackagePreferredActivities(packageName);
mActivitiesButton.setEnabled(false);
- } else if(v == mManageSpaceButton) {
- Intent intent = new Intent(Intent.ACTION_DEFAULT);
- intent.setClassName(mAppInfo.packageName, mAppInfo.manageSpaceActivityName);
- startActivityForResult(intent, -1);
+ } else if(v == mClearDataButton) {
+ if (mAppInfo.manageSpaceActivityName != null) {
+ Intent intent = new Intent(Intent.ACTION_DEFAULT);
+ intent.setClassName(mAppInfo.packageName, mAppInfo.manageSpaceActivityName);
+ startActivityForResult(intent, -1);
+ } else {
+ showDialogInner(DLG_CLEAR_DATA);
+ }
} else if (v == mClearCacheButton) {
// Lazy initialization of observer
if (mClearCacheObserver == null) {
@@ -537,23 +593,14 @@
}
mPm.deleteApplicationCacheFiles(packageName, mClearCacheObserver);
} else if (v == mForceStopButton) {
- ActivityManager am = (ActivityManager)getSystemService(
- Context.ACTIVITY_SERVICE);
- am.forceStopPackage(packageName);
- }
- }
-
- public void onClick(DialogInterface dialog, int which) {
- if(which == AlertDialog.BUTTON_POSITIVE) {
- if (mAppButtonState == AppButtonStates.CLEAR_DATA) {
- // Invoke uninstall or clear user data based on sysPackage
- initiateClearUserDataForSysPkg();
- } else if (mAppButtonState == AppButtonStates.FACTORY_RESET) {
- // Initiate package installer to delete package
- uninstallPkg(mAppInfo.packageName);
- }
- } else {
- //cancel do nothing just retain existing screen
+ // TODO Once framework supports a pre-broadcast to
+ // actually find out if an application will be restarted right
+ // after its killed, there is no way we can determine if
+ // a force stop will really kill the app. So just ignore
+ // the dialog for now and force stop the package. Please note
+ // that the button cannot be enabled or disabled since
+ // we do not have this info for now.
+ forceStopPackage(mAppInfo.packageName);
}
}
}
diff --git a/src/com/android/settings/MediaFormat.java b/src/com/android/settings/MediaFormat.java
index 40ae0d7..71d2766 100644
--- a/src/com/android/settings/MediaFormat.java
+++ b/src/com/android/settings/MediaFormat.java
@@ -23,7 +23,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.os.IMountService;
+import android.os.storage.IMountService;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.Environment;
diff --git a/src/com/android/settings/PrivacySettings.java b/src/com/android/settings/PrivacySettings.java
index a92f09b..c9f3523 100644
--- a/src/com/android/settings/PrivacySettings.java
+++ b/src/com/android/settings/PrivacySettings.java
@@ -39,26 +39,17 @@
* Gesture lock pattern settings.
*/
public class PrivacySettings extends PreferenceActivity implements
- DialogInterface.OnDismissListener, DialogInterface.OnClickListener {
-
- private static final String PREFS_NAME = "location_prefs";
- private static final String PREFS_USE_LOCATION = "use_location";
+ DialogInterface.OnClickListener {
// Vendor specific
private static final String GSETTINGS_PROVIDER = "com.google.settings";
- private static final String LOCATION_CATEGORY = "location_category";
private static final String BACKUP_CATEGORY = "backup_category";
- private static final String USE_LOCATION = "use_location";
private static final String BACKUP_SETTINGS = "backup_settings";
private static final String AUTO_RESTORE = "auto_restore";
- private static final String KEY_DONE_USE_LOCATION = "doneLocation";
- private CheckBoxPreference mUseLocation;
private CheckBoxPreference mBackup;
private CheckBoxPreference mAutoRestore;
- private boolean mOkClicked;
private Dialog mConfirmDialog;
- private static final int DIALOG_USE_LOCATION = 1;
private static final int DIALOG_ERASE_BACKUP = 2;
private int mDialogType;
@@ -68,23 +59,14 @@
addPreferencesFromResource(R.xml.privacy_settings);
final PreferenceScreen screen = getPreferenceScreen();
- mUseLocation = (CheckBoxPreference) screen.findPreference(USE_LOCATION);
mBackup = (CheckBoxPreference) screen.findPreference(BACKUP_SETTINGS);
mAutoRestore = (CheckBoxPreference) screen.findPreference(AUTO_RESTORE);
// Vendor specific
if (getPackageManager().resolveContentProvider(GSETTINGS_PROVIDER, 0) == null) {
- screen.removePreference(findPreference(LOCATION_CATEGORY));
screen.removePreference(findPreference(BACKUP_CATEGORY));
}
updateToggles();
-
- boolean doneUseLocation = savedInstanceState == null
- ? false : savedInstanceState.getBoolean(KEY_DONE_USE_LOCATION, true);
- if (!doneUseLocation && (getIntent().getBooleanExtra("SHOW_USE_LOCATION", false)
- || savedInstanceState != null)) {
- showUseLocationDialog(true);
- }
}
@Override
@@ -98,25 +80,9 @@
}
@Override
- public void onSaveInstanceState(Bundle icicle) {
- if (mConfirmDialog != null && mConfirmDialog.isShowing()
- && mDialogType == DIALOG_USE_LOCATION) {
- icicle.putBoolean(KEY_DONE_USE_LOCATION, false);
- }
- super.onSaveInstanceState(icicle);
- }
-
- @Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
Preference preference) {
- if (preference == mUseLocation) {
- //normally called on the toggle click
- if (mUseLocation.isChecked()) {
- showUseLocationDialog(false);
- } else {
- updateUseLocation();
- }
- } else if (preference == mBackup) {
+ if (preference == mBackup) {
if (!mBackup.isChecked()) {
showEraseBackupDialog();
} else {
@@ -139,34 +105,7 @@
return false;
}
- private void showUseLocationDialog(boolean force) {
- // Show a warning to the user that location data will be shared
- mOkClicked = false;
- if (force) {
- mUseLocation.setChecked(true);
- }
-
- if (hasAgreedToUseLocation()) {
- updateUseLocation();
- return;
- }
-
- mDialogType = DIALOG_USE_LOCATION;
- CharSequence msg = getResources().getText(R.string.use_location_warning_message);
- mConfirmDialog = new AlertDialog.Builder(this).setMessage(msg)
- .setTitle(R.string.use_location_title)
- .setIcon(android.R.drawable.ic_dialog_alert)
- .setPositiveButton(R.string.agree, this)
- .setNegativeButton(R.string.disagree, this)
- .show();
- ((TextView)mConfirmDialog.findViewById(android.R.id.message))
- .setMovementMethod(LinkMovementMethod.getInstance());
- mConfirmDialog.setOnDismissListener(this);
- }
-
private void showEraseBackupDialog() {
- // Show a warning to the user that location data will be shared
- mOkClicked = false;
mBackup.setChecked(true);
mDialogType = DIALOG_ERASE_BACKUP;
@@ -177,7 +116,6 @@
.setPositiveButton(android.R.string.ok, this)
.setNegativeButton(android.R.string.cancel, this)
.show();
- mConfirmDialog.setOnDismissListener(this);
}
/*
@@ -185,8 +123,6 @@
*/
private void updateToggles() {
ContentResolver res = getContentResolver();
- mUseLocation.setChecked(Settings.Secure.getInt(res,
- Settings.Secure.USE_LOCATION_FOR_SERVICES, 2) == 1);
final boolean backupEnabled = Settings.Secure.getInt(res,
Settings.Secure.BACKUP_ENABLED, 0) == 1;
@@ -197,67 +133,21 @@
mAutoRestore.setEnabled(backupEnabled);
}
- private void updateUseLocation() {
- boolean use = mUseLocation.isChecked();
- Settings.Secure.putInt(getContentResolver(),
- Settings.Secure.USE_LOCATION_FOR_SERVICES, use ? 1 : 0);
- }
-
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
//updateProviders();
- mOkClicked = true;
- if (mDialogType == DIALOG_USE_LOCATION) {
- setAgreedToUseLocation(true);
- } else if (mDialogType == DIALOG_ERASE_BACKUP) {
+ if (mDialogType == DIALOG_ERASE_BACKUP) {
setBackupEnabled(false);
}
} else {
- if (mDialogType == DIALOG_USE_LOCATION) {
- // Reset the toggle
- mUseLocation.setChecked(false);
- } else if (mDialogType == DIALOG_ERASE_BACKUP) {
+ if (mDialogType == DIALOG_ERASE_BACKUP) {
mBackup.setChecked(true);
mAutoRestore.setEnabled(true);
}
}
- updateUseLocation();
mDialogType = 0;
}
- public void onDismiss(DialogInterface dialog) {
- // Assuming that onClick gets called first
- if (!mOkClicked) {
- if (mDialogType == DIALOG_USE_LOCATION) {
- mUseLocation.setChecked(false);
- }
- }
- }
-
- /**
- * Checks if the user has agreed to the dialog in the past.
- */
- private boolean hasAgreedToUseLocation() {
- SharedPreferences sp = getSharedPreferences(PREFS_NAME, 0);
- if (sp == null) {
- return false;
- }
- return sp.getBoolean(PREFS_USE_LOCATION, false);
- }
-
- /**
- * Notes that the user has agreed to the dialog and won't need to be prompted in the
- * future.
- */
- private void setAgreedToUseLocation(boolean agreed) {
- if (agreed) {
- SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
- SharedPreferences.Editor editor = settings.edit();
- editor.putBoolean(PREFS_USE_LOCATION, true);
- editor.commit();
- }
- }
-
/**
* Informs the BackupManager of a change in backup state - if backup is disabled,
* the data on the server will be erased.
diff --git a/src/com/android/settings/SdCardSettings.java b/src/com/android/settings/SdCardSettings.java
index 4a83843..2ff5d8a 100644
--- a/src/com/android/settings/SdCardSettings.java
+++ b/src/com/android/settings/SdCardSettings.java
@@ -24,9 +24,10 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.Environment;
-import android.os.IMountService;
import android.os.ServiceManager;
import android.os.StatFs;
+import android.os.storage.StorageManager;
+import android.os.storage.IMountService;
import android.text.format.Formatter;
import android.view.View;
import android.view.View.OnClickListener;
@@ -45,6 +46,7 @@
setContentView(R.layout.sdcard_settings_screen);
+ mStorageManager = (StorageManager) getSystemService(Context.STORAGE_SERVICE);
mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount"));
mRemovedLayout = findViewById(R.id.removed);
@@ -105,10 +107,7 @@
private void update() {
try {
- String path = Environment.getExternalStorageDirectory().getPath();
- mMassStorage.setChecked(
- mMountService.getVolumeShared(
- Environment.getExternalStorageDirectory().getPath(), "ums"));
+ mMassStorage.setChecked(mStorageManager.isUsbMassStorageEnabled());
} catch (Exception ex) {
}
@@ -158,11 +157,9 @@
public void onClick(View v) {
try {
if (mMassStorage.isChecked()) {
- mMountService.shareVolume(
- Environment.getExternalStorageDirectory().getPath(), "ums");
+ mStorageManager.enableUsbMassStorage();
} else {
- mMountService.unshareVolume(
- Environment.getExternalStorageDirectory().getPath(), "ums");
+ mStorageManager.disableUsbMassStorage();
}
} catch (Exception ex) {
}
@@ -194,7 +191,8 @@
}
};
- private IMountService mMountService;
+ private StorageManager mStorageManager;
+ private IMountService mMountService;
private CheckBox mMassStorage;
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index b8ea18c..1ef137d 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -77,9 +77,6 @@
private static final String PROPERTY_EFS_ENABLED = "persist.security.efs.enabled";
private static final String PROPERTY_EFS_TRANSITION = "persist.security.efs.trans";
- private static final String PREFS_NAME = "location_prefs";
- private static final String PREFS_USE_LOCATION = "use_location";
-
private CheckBoxPreference mVisiblePattern;
private CheckBoxPreference mTactileFeedback;
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java
index fb78a80..52947ac 100644
--- a/src/com/android/settings/SoundSettings.java
+++ b/src/com/android/settings/SoundSettings.java
@@ -25,7 +25,6 @@
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.Bundle;
-import android.os.IMountService;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.preference.CheckBoxPreference;
@@ -59,8 +58,6 @@
private CheckBoxPreference mSilent;
- private IMountService mMountService = null;
-
/*
* If we are currently in one of the silent modes (the ringer mode is set to either
* "silent mode" or "vibrate mode"), then toggling the "Phone vibrate"
@@ -95,8 +92,6 @@
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
- mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount"));
-
addPreferencesFromResource(R.xml.sound_settings);
if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) {
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
index 7e22375..04eebb1 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -25,11 +25,11 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Environment;
-import android.os.IMountService;
+import android.os.storage.IMountService;
import android.os.ServiceManager;
import android.os.StatFs;
-import android.storage.StorageManager;
-import android.storage.StorageEventListener;
+import android.os.storage.StorageManager;
+import android.os.storage.StorageEventListener;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
@@ -95,19 +95,9 @@
}
StorageEventListener mStorageListener = new StorageEventListener() {
- public void onShareAvailabilityChanged(String method, boolean available) {
- }
- public void onMediaInserted(String label, String path, int major, int minor) {
- updateMemoryStatus();
- }
-
- public void onMediaRemoved(String label, String path, int major, int minor, boolean clean) {
- updateMemoryStatus();
- }
-
- public void onVolumeStateChanged(
- String label, String path, String oldState, String newState) {
+ @Override
+ public void onStorageStateChanged(String path, String oldState, String newState) {
updateMemoryStatus();
}
};
@@ -166,9 +156,8 @@
Log.e(TAG, "Mount service is null, can't unmount");
}
} catch (RemoteException ex) {
- // Failed for some reason, try to update UI to actual state
- updateMemoryStatus();
}
+ updateMemoryStatus();
}
private void mount() {
@@ -180,9 +169,8 @@
Log.e(TAG, "Mount service is null, can't mount");
}
} catch (RemoteException ex) {
- // Failed for some reason, try to update UI to actual state
- updateMemoryStatus();
}
+ updateMemoryStatus();
}
private void updateMemoryStatus() {