Merge "Remove unused variables and functions, don't warn about unused parameters"
diff --git a/cmds/bootanimation/AudioPlayer.cpp b/cmds/bootanimation/AudioPlayer.cpp
index ec86afb..81fe5f8 100644
--- a/cmds/bootanimation/AudioPlayer.cpp
+++ b/cmds/bootanimation/AudioPlayer.cpp
@@ -193,7 +193,7 @@
return false;
}
-void AudioPlayer::playFile(struct FileMap* fileMap) {
+void AudioPlayer::playFile(FileMap* fileMap) {
// stop any currently playing sound
requestExitAndWait();
diff --git a/cmds/bootanimation/AudioPlayer.h b/cmds/bootanimation/AudioPlayer.h
index 7e82a07..1def0ae 100644
--- a/cmds/bootanimation/AudioPlayer.h
+++ b/cmds/bootanimation/AudioPlayer.h
@@ -18,6 +18,7 @@
#define _BOOTANIMATION_AUDIOPLAYER_H
#include <utils/Thread.h>
+#include <utils/FileMap.h>
namespace android {
@@ -28,7 +29,7 @@
virtual ~AudioPlayer();
bool init(const char* config);
- void playFile(struct FileMap* fileMap);
+ void playFile(FileMap* fileMap);
private:
virtual bool threadLoop();
@@ -39,7 +40,7 @@
int mPeriodSize;
int mPeriodCount;
- struct FileMap* mCurrentFile;
+ FileMap* mCurrentFile;
};
} // namespace android
diff --git a/core/java/android/text/format/DateFormat.java b/core/java/android/text/format/DateFormat.java
index d48f551..d515e21 100755
--- a/core/java/android/text/format/DateFormat.java
+++ b/core/java/android/text/format/DateFormat.java
@@ -221,68 +221,13 @@
/**
* Returns a {@link java.text.DateFormat} object that can format the date
- * in short form (such as 12/31/1999) according
- * to the current locale and the user's date-order preference.
+ * in short form according to the current locale.
+ *
* @param context the application context
* @return the {@link java.text.DateFormat} object that properly formats the date.
*/
public static java.text.DateFormat getDateFormat(Context context) {
- String value = Settings.System.getString(context.getContentResolver(),
- Settings.System.DATE_FORMAT);
-
- return getDateFormatForSetting(context, value);
- }
-
- /**
- * Returns a {@link java.text.DateFormat} object to format the date
- * as if the date format setting were set to <code>value</code>,
- * including null to use the locale's default format.
- * @param context the application context
- * @param value the date format setting string to interpret for
- * the current locale
- * @hide
- */
- public static java.text.DateFormat getDateFormatForSetting(Context context,
- String value) {
- String format = getDateFormatStringForSetting(context, value);
- return new java.text.SimpleDateFormat(format);
- }
-
- private static String getDateFormatStringForSetting(Context context, String value) {
- if (value != null) {
- int month = value.indexOf('M');
- int day = value.indexOf('d');
- int year = value.indexOf('y');
-
- if (month >= 0 && day >= 0 && year >= 0) {
- String template = context.getString(R.string.numeric_date_template);
- if (year < month && year < day) {
- if (month < day) {
- value = String.format(template, "yyyy", "MM", "dd");
- } else {
- value = String.format(template, "yyyy", "dd", "MM");
- }
- } else if (month < day) {
- if (day < year) {
- value = String.format(template, "MM", "dd", "yyyy");
- } else { // unlikely
- value = String.format(template, "MM", "yyyy", "dd");
- }
- } else { // day < month
- if (month < year) {
- value = String.format(template, "dd", "MM", "yyyy");
- } else { // unlikely
- value = String.format(template, "dd", "yyyy", "MM");
- }
- }
-
- return value;
- }
- }
-
- // The setting is not set; use the locale's default.
- LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale);
- return d.shortDateFormat4;
+ return java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT);
}
/**
@@ -315,14 +260,16 @@
* order returned here.
*/
public static char[] getDateFormatOrder(Context context) {
- return ICU.getDateFormatOrder(getDateFormatString(context));
+ return ICU.getDateFormatOrder(getDateFormatString());
}
- private static String getDateFormatString(Context context) {
- String value = Settings.System.getString(context.getContentResolver(),
- Settings.System.DATE_FORMAT);
+ private static String getDateFormatString() {
+ java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT);
+ if (df instanceof SimpleDateFormat) {
+ return ((SimpleDateFormat) df).toPattern();
+ }
- return getDateFormatStringForSetting(context, value);
+ throw new AssertionError("!(df instanceof SimpleDateFormat)");
}
/**
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index 45d1403..86cd52f 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -149,7 +149,7 @@
format = getTimeFormat();
break;
case SHOW_MONTH_DAY_YEAR:
- format = getDateFormat();
+ format = DateFormat.getDateInstance(DateFormat.SHORT);
break;
default:
throw new RuntimeException("unknown display value: " + display);
@@ -189,21 +189,6 @@
return android.text.format.DateFormat.getTimeFormat(getContext());
}
- private DateFormat getDateFormat() {
- String format = Settings.System.getString(getContext().getContentResolver(),
- Settings.System.DATE_FORMAT);
- if (format == null || "".equals(format)) {
- return DateFormat.getDateInstance(DateFormat.SHORT);
- } else {
- try {
- return new SimpleDateFormat(format);
- } catch (IllegalArgumentException e) {
- // If we tried to use a bad format string, fall back to a default.
- return DateFormat.getDateInstance(DateFormat.SHORT);
- }
- }
- }
-
private void registerReceivers() {
Context context = getContext();
@@ -213,15 +198,11 @@
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
context.registerReceiver(mBroadcastReceiver, filter);
-
- Uri uri = Settings.System.getUriFor(Settings.System.DATE_FORMAT);
- context.getContentResolver().registerContentObserver(uri, true, mContentObserver);
}
private void unregisterReceivers() {
Context context = getContext();
context.unregisterReceiver(mBroadcastReceiver);
- context.getContentResolver().unregisterContentObserver(mContentObserver);
}
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@@ -241,12 +222,4 @@
update();
}
};
-
- private ContentObserver mContentObserver = new ContentObserver(new Handler()) {
- @Override
- public void onChange(boolean selfChange) {
- mLastFormat = null;
- update();
- }
- };
}
diff --git a/media/jni/android_media_MediaExtractor.h b/media/jni/android_media_MediaExtractor.h
index e5a0c16e..9f62506 100644
--- a/media/jni/android_media_MediaExtractor.h
+++ b/media/jni/android_media_MediaExtractor.h
@@ -30,7 +30,7 @@
namespace android {
struct IMediaHTTPService;
-struct MetaData;
+class MetaData;
struct NuMediaExtractor;
struct JMediaExtractor : public RefBase {
diff --git a/media/jni/android_media_MediaHTTPConnection.h b/media/jni/android_media_MediaHTTPConnection.h
index 62ff678..f87f1eb 100644
--- a/media/jni/android_media_MediaHTTPConnection.h
+++ b/media/jni/android_media_MediaHTTPConnection.h
@@ -24,8 +24,8 @@
namespace android {
-struct IMemory;
-struct MemoryDealer;
+class IMemory;
+class MemoryDealer;
struct JMediaHTTPConnection : public RefBase {
enum {
diff --git a/services/core/jni/com_android_server_UsbDeviceManager.cpp b/services/core/jni/com_android_server_UsbDeviceManager.cpp
index 8d1a338..a1bff9d 100644
--- a/services/core/jni/com_android_server_UsbDeviceManager.cpp
+++ b/services/core/jni/com_android_server_UsbDeviceManager.cpp
@@ -41,20 +41,12 @@
jmethodID mConstructor;
} gParcelFileDescriptorOffsets;
-static void checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) {
- if (env->ExceptionCheck()) {
- ALOGE("An exception was thrown by callback '%s'.", methodName);
- LOGE_EX(env);
- env->ExceptionClear();
- }
-}
-
static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strArray, int index)
{
char buffer[256];
buffer[0] = 0;
- int length = ioctl(fd, cmd, buffer);
+ ioctl(fd, cmd, buffer);
if (buffer[0]) {
jstring obj = env->NewStringUTF(buffer);
env->SetObjectArrayElement(strArray, index, obj);
diff --git a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
index f943d16..11388d8 100644
--- a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
+++ b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
@@ -137,6 +137,7 @@
int register_android_server_InputApplicationHandle(JNIEnv* env) {
int res = jniRegisterNativeMethods(env, "com/android/server/input/InputApplicationHandle",
gInputApplicationHandleMethods, NELEM(gInputApplicationHandleMethods));
+ (void) res; // Faked use when LOG_NDEBUG.
LOG_FATAL_IF(res < 0, "Unable to register native methods.");
jclass clazz;
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 5d73af8..7c5980a 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -1416,6 +1416,7 @@
int register_android_server_InputManager(JNIEnv* env) {
int res = jniRegisterNativeMethods(env, "com/android/server/input/InputManagerService",
gInputManagerMethods, NELEM(gInputManagerMethods));
+ (void) res; // Faked use when LOG_NDEBUG.
LOG_FATAL_IF(res < 0, "Unable to register native methods.");
// Callbacks
diff --git a/services/core/jni/com_android_server_input_InputWindowHandle.cpp b/services/core/jni/com_android_server_input_InputWindowHandle.cpp
index 03bf7eb..5e15db5 100644
--- a/services/core/jni/com_android_server_input_InputWindowHandle.cpp
+++ b/services/core/jni/com_android_server_input_InputWindowHandle.cpp
@@ -230,6 +230,7 @@
int register_android_server_InputWindowHandle(JNIEnv* env) {
int res = jniRegisterNativeMethods(env, "com/android/server/input/InputWindowHandle",
gInputWindowHandleMethods, NELEM(gInputWindowHandleMethods));
+ (void) res; // Faked use when LOG_NDEBUG.
LOG_FATAL_IF(res < 0, "Unable to register native methods.");
jclass clazz;
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
index db642dd..6dcdd9d 100644
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
@@ -189,6 +189,7 @@
int register_android_server_PowerManagerService(JNIEnv* env) {
int res = jniRegisterNativeMethods(env, "com/android/server/power/PowerManagerService",
gPowerManagerServiceMethods, NELEM(gPowerManagerServiceMethods));
+ (void) res; // Faked use when LOG_NDEBUG.
LOG_FATAL_IF(res < 0, "Unable to register native methods.");
// Callbacks