summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/CustomLocale/Android.mk11
-rw-r--r--apps/CustomLocale/AndroidManifest.xml37
-rw-r--r--apps/CustomLocale/res/drawable/icon.pngbin3133 -> 0 bytes
-rw-r--r--apps/CustomLocale/res/layout/list_item.xml35
-rw-r--r--apps/CustomLocale/res/layout/main.xml62
-rw-r--r--apps/CustomLocale/res/layout/new_locale.xml49
-rw-r--r--apps/CustomLocale/res/values-fr/strings.xml25
-rw-r--r--apps/CustomLocale/res/values/colors.xml18
-rw-r--r--apps/CustomLocale/res/values/strings.xml26
-rw-r--r--apps/CustomLocale/res/values/styles.xml25
-rw-r--r--apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java326
-rw-r--r--apps/CustomLocale/src/com/android/customlocale/NewLocaleDialog.java93
-rw-r--r--apps/SdkSetup/Android.mk2
-rw-r--r--apps/SpareParts/res/values/strings.xml13
-rw-r--r--apps/SpareParts/res/xml/spare_parts.xml29
-rw-r--r--apps/SpareParts/src/com/android/spare_parts/SpareParts.java56
16 files changed, 3 insertions, 804 deletions
diff --git a/apps/CustomLocale/Android.mk b/apps/CustomLocale/Android.mk
deleted file mode 100644
index 275207f29..000000000
--- a/apps/CustomLocale/Android.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := user
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := CustomLocale
-LOCAL_CERTIFICATE := platform
-
-include $(BUILD_PACKAGE)
diff --git a/apps/CustomLocale/AndroidManifest.xml b/apps/CustomLocale/AndroidManifest.xml
deleted file mode 100644
index 9dfa89630..000000000
--- a/apps/CustomLocale/AndroidManifest.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-<manifest
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:versionCode="1"
- android:versionName="1.0" package="com.android.customlocale">
- <application
- android:icon="@drawable/icon"
- android:label="@string/app_name">
- <activity
- android:label="@string/app_name" android:name="CustomLocaleActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity
- android:name="NewLocaleDialog"
- android:theme="@android:style/Theme.Dialog" />
- </application>
- <uses-sdk android:minSdkVersion="3" />
- <uses-permission android:name="android.permission.WRITE_SETTINGS" />
- <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
-</manifest>
diff --git a/apps/CustomLocale/res/drawable/icon.png b/apps/CustomLocale/res/drawable/icon.png
deleted file mode 100644
index cb40a1988..000000000
--- a/apps/CustomLocale/res/drawable/icon.png
+++ /dev/null
Binary files differ
diff --git a/apps/CustomLocale/res/layout/list_item.xml b/apps/CustomLocale/res/layout/list_item.xml
deleted file mode 100644
index 8c59f92c7..000000000
--- a/apps/CustomLocale/res/layout/list_item.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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="wrap_content"
- android:padding="5dip">
- <TextView
- android:id="@+id/locale_code"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:textAppearanceLarge"
- android:layout_weight="1"
- android:text="@string/locale_default" />
- <TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/locale_name"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:textAppearance"
- android:layout_weight="1" />
-</LinearLayout> \ No newline at end of file
diff --git a/apps/CustomLocale/res/layout/main.xml b/apps/CustomLocale/res/layout/main.xml
deleted file mode 100644
index b1eaa51ba..000000000
--- a/apps/CustomLocale/res/layout/main.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:text="@string/header_current_locale"
- android:textAppearance="@style/TextAppearance.header"
- android:gravity="center_horizontal"
- android:background="@color/header_background" />
- <TextView
- android:id="@+id/current_locale"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:padding="5dip" />
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:text="@string/header_locale_list"
- android:textAppearance="@style/TextAppearance.header"
- android:gravity="center_horizontal"
- android:background="@color/header_background" />
- <ListView
- android:id="@id/android:list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1"
- android:padding="8dip" />
- <TextView
- android:id="@id/android:empty"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="@string/no_data_label" />
- <Button
- android:id="@+id/new_locale"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
- android:text="@string/add_new_locale_button" />
-</LinearLayout>
diff --git a/apps/CustomLocale/res/layout/new_locale.xml b/apps/CustomLocale/res/layout/new_locale.xml
deleted file mode 100644
index d0d9d6c38..000000000
--- a/apps/CustomLocale/res/layout/new_locale.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="8dip"
- android:paddingRight="8dip">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/new_locale_label" />
- <EditText
- android:id="@+id/value"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:hint="@string/locale_default" android:inputType="text"/>
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <Button
- android:id="@+id/add"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/add_button" android:layout_gravity="center_vertical"/>
- <Button
- android:id="@+id/add_and_select"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/add_select_button" android:layout_gravity="center_vertical"/>
- </LinearLayout>
-</LinearLayout> \ No newline at end of file
diff --git a/apps/CustomLocale/res/values-fr/strings.xml b/apps/CustomLocale/res/values-fr/strings.xml
deleted file mode 100644
index 8852a9aaa..000000000
--- a/apps/CustomLocale/res/values-fr/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-<resources>
- <string name="app_name">Locales Personalisées</string>
- <string name="add_new_locale_button">Ajouter une nouvelle locale</string>
- <string name="new_locale_label">Code de la nouvelle locale:</string>
- <string name="add_button">Ajouter</string>
- <string name="no_data_label">Aucune locale</string>
- <string name="header_current_locale">Locale courrante</string>
- <string name="header_locale_list">Liste des locales</string>
- <string name="add_select_button">Ajouter et sélectionner</string>
-</resources>
diff --git a/apps/CustomLocale/res/values/colors.xml b/apps/CustomLocale/res/values/colors.xml
deleted file mode 100644
index b9b5ad26f..000000000
--- a/apps/CustomLocale/res/values/colors.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-<resources>
- <color name="header_background">#888</color>
-</resources>
diff --git a/apps/CustomLocale/res/values/strings.xml b/apps/CustomLocale/res/values/strings.xml
deleted file mode 100644
index 313fb87e4..000000000
--- a/apps/CustomLocale/res/values/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-<resources>
- <string name="app_name">Custom Locale</string>
- <string name="locale_default">ex_EX</string>
- <string name="add_new_locale_button">Add New Locale</string>
- <string name="new_locale_label">New locale code:</string>
- <string name="add_button">Add</string>
- <string name="no_data_label">No data</string>
- <string name="header_current_locale">Current Locale</string>
- <string name="header_locale_list">Locale List</string>
- <string name="add_select_button">Add and Select</string>
-</resources>
diff --git a/apps/CustomLocale/res/values/styles.xml b/apps/CustomLocale/res/values/styles.xml
deleted file mode 100644
index 8ccc11cdf..000000000
--- a/apps/CustomLocale/res/values/styles.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-<resources>
- <style name="TextAppearance"
- parent="android:TextAppearance" />
-
- <style name="TextAppearance.header">
- <item name="android:textSize">14sp</item>
- <item name="android:textStyle">bold</item>
- </style>
-
-</resources>
diff --git a/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java b/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java
deleted file mode 100644
index 768f9105f..000000000
--- a/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.customlocale;
-
-
-import android.app.ActivityManagerNative;
-import android.app.IActivityManager;
-import android.app.ListActivity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.res.Configuration;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.util.Log;
-import android.view.ContextMenu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ContextMenu.ContextMenuInfo;
-import android.widget.Button;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.SimpleAdapter;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.widget.AdapterView.AdapterContextMenuInfo;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * Displays the list of system locales as well as maintain a custom list of user
- * locales. The user can select a locale and apply it or it can create or remove
- * a custom locale.
- */
-public class CustomLocaleActivity extends ListActivity {
-
- private static final String CUSTOM_LOCALES_SEP = " ";
- private static final String CUSTOM_LOCALES = "custom_locales";
- private static final String KEY_CUSTOM = "custom";
- private static final String KEY_NAME = "name";
- private static final String KEY_CODE = "code";
-
- private static final String TAG = "LocaleSetup";
- private static final boolean DEBUG = true;
-
- /** Request code returned when the NewLocaleDialog activity finishes. */
- private static final int UPDATE_LIST = 42;
- /** Menu item id for applying a locale */
- private static final int MENU_APPLY = 43;
- /** Menu item id for removing a custom locale */
- private static final int MENU_REMOVE = 44;
-
- /** List view displaying system and custom locales. */
- private ListView mListView;
- /** Textview used to display current locale */
- private TextView mCurrentLocaleTextView;
- /** Private shared preferences of this activity. */
- private SharedPreferences mPrefs;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- mPrefs = getPreferences(MODE_PRIVATE);
-
- Button newLocaleButton = (Button) findViewById(R.id.new_locale);
-
- newLocaleButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- Intent i = new Intent(CustomLocaleActivity.this, NewLocaleDialog.class);
- startActivityForResult(i, UPDATE_LIST);
- }
- });
-
- mListView = (ListView) findViewById(android.R.id.list);
- mListView.setFocusable(true);
- mListView.setFocusableInTouchMode(true);
- mListView.requestFocus();
- registerForContextMenu(mListView);
- setupLocaleList();
-
- mCurrentLocaleTextView = (TextView) findViewById(R.id.current_locale);
- displayCurrentLocale();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
-
- if (requestCode == UPDATE_LIST && resultCode == RESULT_OK && data != null) {
- String locale = data.getExtras().getString(NewLocaleDialog.INTENT_EXTRA_LOCALE);
- if (locale != null && locale.length() > 0) {
- // Get current custom locale list
- String customLocales = mPrefs.getString(CUSTOM_LOCALES, null);
-
- // Update
- if (customLocales == null) {
- customLocales = locale;
- } else {
- customLocales += CUSTOM_LOCALES_SEP + locale;
- }
-
- // Save prefs
- if (DEBUG) {
- Log.d(TAG, "add/customLocales: " + customLocales);
- }
- mPrefs.edit().putString(CUSTOM_LOCALES, customLocales).commit();
-
- Toast.makeText(this, "Added custom locale: " + locale, Toast.LENGTH_SHORT).show();
-
- // Update list view
- setupLocaleList();
-
- // Find the item to select it in the list view
- ListAdapter a = mListView.getAdapter();
- for (int i = 0; i < a.getCount(); i++) {
- Object o = a.getItem(i);
- if (o instanceof Map<?, ?>) {
- String code = ((Map<String, String>) o).get(KEY_CODE);
- if (code != null && code.equals(locale)) {
- mListView.setSelection(i);
- break;
- }
- }
- }
-
- if (data.getExtras().getBoolean(NewLocaleDialog.INTENT_EXTRA_SELECT)) {
- selectLocale(locale);
- }
- }
- }
- }
-
- private void setupLocaleList() {
- if (DEBUG) {
- Log.d(TAG, "Update locate list");
- }
-
- ArrayList<Map<String, String>> data = new ArrayList<Map<String, String>>();
-
- // Insert all system locales
- String[] locales = getAssets().getLocales();
- for (String locale : locales) {
- Locale loc = new Locale(locale);
-
- Map<String, String> map = new HashMap<String, String>(1);
- map.put(KEY_CODE, locale);
- map.put(KEY_NAME, loc.getDisplayName());
- data.add(map);
- }
- locales = null;
-
- // Insert all custom locales
- String customLocales = mPrefs.getString(CUSTOM_LOCALES, "");
- if (DEBUG) {
- Log.d(TAG, "customLocales: " + customLocales);
- }
- for (String locale : customLocales.split(CUSTOM_LOCALES_SEP)) {
- if (locale != null && locale.length() > 0) {
- Locale loc = new Locale(locale);
-
- Map<String, String> map = new HashMap<String, String>(1);
- map.put(KEY_CODE, locale);
- map.put(KEY_NAME, loc.getDisplayName() + " [Custom]");
- // the presence of the "custom" key marks it as custom.
- map.put(KEY_CUSTOM, "");
- data.add(map);
- }
- }
-
- // Sort all locales by code
- Collections.sort(data, new Comparator<Map<String, String>>() {
- public int compare(Map<String, String> lhs, Map<String, String> rhs) {
- return lhs.get(KEY_CODE).compareTo(rhs.get(KEY_CODE));
- }
- });
-
- // Update the list view adapter
- mListView.setAdapter(new SimpleAdapter(this, data, R.layout.list_item, new String[] {
- KEY_CODE, KEY_NAME}, new int[] {R.id.locale_code, R.id.locale_name}));
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
- super.onCreateContextMenu(menu, v, menuInfo);
-
- if (menuInfo instanceof AdapterContextMenuInfo) {
- int position = ((AdapterContextMenuInfo) menuInfo).position;
- Object o = mListView.getItemAtPosition(position);
- if (o instanceof Map<?, ?>) {
- String locale = ((Map<String, String>) o).get(KEY_CODE);
- String custom = ((Map<String, String>) o).get(KEY_CUSTOM);
-
- if (custom == null) {
- menu.setHeaderTitle("System Locale");
- menu.add(0, MENU_APPLY, 0, "Apply");
- } else {
- menu.setHeaderTitle("Custom Locale");
- menu.add(0, MENU_APPLY, 0, "Apply");
- menu.add(0, MENU_REMOVE, 0, "Remove");
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean onContextItemSelected(MenuItem item) {
-
- String pendingLocale = null;
- boolean is_custom = false;
-
- ContextMenuInfo menuInfo = item.getMenuInfo();
- if (menuInfo instanceof AdapterContextMenuInfo) {
- int position = ((AdapterContextMenuInfo) menuInfo).position;
- Object o = mListView.getItemAtPosition(position);
- if (o instanceof Map<?, ?>) {
- pendingLocale = ((Map<String, String>) o).get(KEY_CODE);
- is_custom = ((Map<String, String>) o).get(KEY_CUSTOM) != null;
- }
- }
-
- if (pendingLocale == null) {
- // should never happen
- return super.onContextItemSelected(item);
- }
-
- if (item.getItemId() == MENU_REMOVE) {
- // Get current custom locale list
- String customLocales = mPrefs.getString(CUSTOM_LOCALES, "");
-
- if (DEBUG) {
- Log.d(TAG, "Remove " + pendingLocale + " from custom locales: " + customLocales);
- }
-
- // Update
- StringBuilder sb = new StringBuilder();
- for (String locale : customLocales.split(CUSTOM_LOCALES_SEP)) {
- if (locale != null && locale.length() > 0 && !locale.equals(pendingLocale)) {
- if (sb.length() > 0) {
- sb.append(CUSTOM_LOCALES_SEP);
- }
- sb.append(locale);
- }
- }
- String newLocales = sb.toString();
- if (!newLocales.equals(customLocales)) {
- // Save prefs
- mPrefs.edit().putString(CUSTOM_LOCALES, customLocales).commit();
-
- Toast.makeText(this, "Removed custom locale: " + pendingLocale, Toast.LENGTH_SHORT)
- .show();
- }
-
- } else if (item.getItemId() == MENU_APPLY) {
- selectLocale(pendingLocale);
- }
-
- return super.onContextItemSelected(item);
- }
-
- private void selectLocale(String locale) {
- if (DEBUG) {
- Log.d(TAG, "Select locale " + locale);
- }
-
- try {
- IActivityManager am = ActivityManagerNative.getDefault();
- Configuration config = am.getConfiguration();
-
- Locale loc = new Locale(locale);
- config.locale = loc;
-
- // indicate this isn't some passing default - the user wants this
- // remembered
- config.userSetLocale = true;
-
- am.updateConfiguration(config);
-
- Toast.makeText(this, "Select locale: " + locale, Toast.LENGTH_SHORT).show();
- } catch (RemoteException e) {
- if (DEBUG) {
- Log.e(TAG, "Select locale failed", e);
- }
- }
- }
-
- private void displayCurrentLocale() {
- try {
- IActivityManager am = ActivityManagerNative.getDefault();
- Configuration config = am.getConfiguration();
-
- if (config.locale != null) {
- String text = String.format("%s - %s",
- config.locale.toString(),
- config.locale.getDisplayName());
- mCurrentLocaleTextView.setText(text);
- }
- } catch (RemoteException e) {
- if (DEBUG) {
- Log.e(TAG, "get current locale failed", e);
- }
- }
- }
-}
diff --git a/apps/CustomLocale/src/com/android/customlocale/NewLocaleDialog.java b/apps/CustomLocale/src/com/android/customlocale/NewLocaleDialog.java
deleted file mode 100644
index 3626f7398..000000000
--- a/apps/CustomLocale/src/com/android/customlocale/NewLocaleDialog.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.customlocale;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-
-/**
- * Dialog to ask the user for a new locale. <p/> Returns the locale code (e.g.
- * "en_US") via an intent with a "locale" extra string and a "select" extra
- * boolean.
- */
-public class NewLocaleDialog extends Activity
- implements View.OnClickListener, View.OnKeyListener {
-
- public static final String INTENT_EXTRA_LOCALE = "locale";
- public static final String INTENT_EXTRA_SELECT = "select";
-
- private static final String TAG = "NewLocale";
- private static final boolean DEBUG = true;
- private Button mButtonAdd;
- private Button mButtonAddSelect;
- private EditText mEditText;
- private boolean mWasEmpty;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.new_locale);
-
- mEditText = (EditText) findViewById(R.id.value);
- mWasEmpty = true;
-
- mButtonAdd = (Button) findViewById(R.id.add);
- mButtonAdd.setOnClickListener(this);
- mButtonAdd.setEnabled(false);
-
- mButtonAddSelect = (Button) findViewById(R.id.add_and_select);
- mButtonAddSelect.setOnClickListener(this);
- mButtonAddSelect.setEnabled(false);
-
- mEditText.setOnKeyListener(this);
- }
-
- public void onClick(View v) {
- String locale = mEditText.getText().toString();
- boolean select = v == mButtonAddSelect;
-
- if (DEBUG) {
- Log.d(TAG, "New Locale: " + locale + (select ? " + select" : ""));
- }
-
- Intent data = new Intent(NewLocaleDialog.this, NewLocaleDialog.class);
- data.putExtra(INTENT_EXTRA_LOCALE, locale);
- data.putExtra(INTENT_EXTRA_SELECT, select);
- setResult(RESULT_OK, data);
-
- finish();
- }
-
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- boolean isEmpty = TextUtils.isEmpty(mEditText.getText());
- if (isEmpty != mWasEmpty) {
- mWasEmpty = isEmpty;
-
- mButtonAdd.setEnabled(!isEmpty);
- mButtonAddSelect.setEnabled(!isEmpty);
- }
- return false;
- }
-}
diff --git a/apps/SdkSetup/Android.mk b/apps/SdkSetup/Android.mk
index 538c2cb58..b89baaf8f 100644
--- a/apps/SdkSetup/Android.mk
+++ b/apps/SdkSetup/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := user
+LOCAL_MODULE_TAGS := foo
LOCAL_SRC_FILES := $(call all-subdir-java-files)
diff --git a/apps/SpareParts/res/values/strings.xml b/apps/SpareParts/res/values/strings.xml
index 21c2df994..42234c1c3 100644
--- a/apps/SpareParts/res/values/strings.xml
+++ b/apps/SpareParts/res/values/strings.xml
@@ -20,17 +20,6 @@
<resources>
<string name="app_label">Spare Parts</string>
- <string name="device_info_title">Device info</string>
-
- <string name="title_battery_history">Battery history</string>
- <string name="summary_battery_history">Summary of how battery has been used</string>
-
- <string name="title_battery_information">Battery information</string>
- <string name="summary_battery_information">Current battery status information</string>
-
- <string name="title_usage_statistics">Usage statistics</string>
- <string name="summary_usage_statistics">Summary of application usage</string>
-
<string name="general_title">General</string>
<string name="title_window_animations">Window animations</string>
@@ -59,7 +48,7 @@
<string name="title_accelerometer">Display rotation</string>
<string name="summary_on_accelerometer">Display rotates from orientation</string>
- <string name="summary_off_accelerometer">Display rotates from orientation</string>
+ <string name="summary_off_accelerometer">Display rotates when lid is open</string>
<string name="applications_title">Applications</string>
diff --git a/apps/SpareParts/res/xml/spare_parts.xml b/apps/SpareParts/res/xml/spare_parts.xml
index 5141e2234..87525c9d0 100644
--- a/apps/SpareParts/res/xml/spare_parts.xml
+++ b/apps/SpareParts/res/xml/spare_parts.xml
@@ -19,35 +19,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
- android:title="@string/device_info_title">
-
- <PreferenceScreen android:key="battery_history_settings"
- android:title="@string/title_battery_history"
- android:summary="@string/summary_battery_history">
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.settings"
- android:targetClass="com.android.settings.battery_history.BatteryHistory" />
- </PreferenceScreen>
-
- <PreferenceScreen android:key="battery_information_settings"
- android:title="@string/title_battery_information"
- android:summary="@string/summary_battery_information">
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.settings"
- android:targetClass="com.android.settings.BatteryInfo" />
- </PreferenceScreen>
-
- <PreferenceScreen android:key="usage_statistics_settings"
- android:title="@string/title_usage_statistics"
- android:summary="@string/summary_usage_statistics">
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.settings"
- android:targetClass="com.android.settings.UsageStats" />
- </PreferenceScreen>
-
- </PreferenceCategory>
-
- <PreferenceCategory
android:title="@string/general_title">
<ListPreference
diff --git a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
index 4852ec207..0f2347e15 100644
--- a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
+++ b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
@@ -19,11 +19,7 @@ package com.android.spare_parts;
import android.app.ActivityManagerNative;
import android.content.Context;
-import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.os.RemoteException;
@@ -32,7 +28,6 @@ import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
-import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
@@ -40,17 +35,11 @@ import android.os.Bundle;
import android.util.Log;
import android.view.IWindowManager;
-import java.util.List;
-
public class SpareParts extends PreferenceActivity
implements Preference.OnPreferenceChangeListener,
SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = "SpareParts";
- private static final String BATTERY_HISTORY_PREF = "battery_history_settings";
- private static final String BATTERY_INFORMATION_PREF = "battery_information_settings";
- private static final String USAGE_STATISTICS_PREF = "usage_statistics_settings";
-
private static final String WINDOW_ANIMATIONS_PREF = "window_animations";
private static final String TRANSITION_ANIMATIONS_PREF = "transition_animations";
private static final String FANCY_IME_ANIMATIONS_PREF = "fancy_ime_animations";
@@ -73,41 +62,6 @@ public class SpareParts extends PreferenceActivity
private IWindowManager mWindowManager;
- public static boolean updatePreferenceToSpecificActivityOrRemove(Context context,
- PreferenceGroup parentPreferenceGroup, String preferenceKey, int flags) {
-
- Preference preference = parentPreferenceGroup.findPreference(preferenceKey);
- if (preference == null) {
- return false;
- }
-
- Intent intent = preference.getIntent();
- if (intent != null) {
- // Find the activity that is in the system image
- PackageManager pm = context.getPackageManager();
- List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
- int listSize = list.size();
- for (int i = 0; i < listSize; i++) {
- ResolveInfo resolveInfo = list.get(i);
- if ((resolveInfo.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM)
- != 0) {
-
- // Replace the intent with this specific activity
- preference.setIntent(new Intent().setClassName(
- resolveInfo.activityInfo.packageName,
- resolveInfo.activityInfo.name));
-
- return true;
- }
- }
- }
-
- // Did not find a matching activity, so remove the preference
- parentPreferenceGroup.removePreference(preference);
-
- return true;
- }
-
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -130,15 +84,7 @@ public class SpareParts extends PreferenceActivity
mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
- final PreferenceGroup parentPreference = getPreferenceScreen();
- updatePreferenceToSpecificActivityOrRemove(this, parentPreference,
- BATTERY_HISTORY_PREF, 0);
- updatePreferenceToSpecificActivityOrRemove(this, parentPreference,
- BATTERY_INFORMATION_PREF, 0);
- updatePreferenceToSpecificActivityOrRemove(this, parentPreference,
- USAGE_STATISTICS_PREF, 0);
-
- parentPreference.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
+ getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
private void updateToggles() {