diff options
4 files changed, 14 insertions, 6 deletions
diff --git a/docs/html/training/notify-user/display-progress.jd b/docs/html/training/notify-user/display-progress.jd index 2b2b3ae..c00576c 100644 --- a/docs/html/training/notify-user/display-progress.jd +++ b/docs/html/training/notify-user/display-progress.jd @@ -80,6 +80,7 @@ previous.link=expanded.html setProgress(0, 0, false)}. For example: </p> <pre> +int id = 1; ... mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); @@ -100,7 +101,7 @@ new Thread( // state mBuilder.setProgress(100, incr, false); // Displays the progress bar for the first time. - mNotifyManager.notify(0, mBuilder.build()); + mNotifyManager.notify(id, mBuilder.build()); // Sleeps the thread, simulating an operation // that takes time try { @@ -114,7 +115,7 @@ new Thread( mBuilder.setContentText("Download complete") // Removes the progress bar .setProgress(0,0,false); - mNotifyManager.notify(ID, mBuilder.build()); + mNotifyManager.notify(id, mBuilder.build()); } } // Starts the thread by calling the run() method in its Runnable @@ -157,7 +158,7 @@ new Thread( // percentage, and "determinate" state mBuilder.setProgress(100, incr, false); // Issues the notification -mNotifyManager.notify(0, mBuilder.build()); +mNotifyManager.notify(id, mBuilder.build()); </pre> <p> Replace the lines you've found with the following lines. Notice that the third parameter @@ -169,7 +170,7 @@ mNotifyManager.notify(0, mBuilder.build()); // Sets an activity indicator for an operation of indeterminate length mBuilder.setProgress(0, 0, true); // Issues the notification -mNotifyManager.notify(0, mBuilder.build()); +mNotifyManager.notify(id, mBuilder.build()); </pre> <p> The resulting indicator is shown in figure 2: diff --git a/docs/html/training/notify-user/navigation.jd b/docs/html/training/notify-user/navigation.jd index ac4689a..fc95013 100644 --- a/docs/html/training/notify-user/navigation.jd +++ b/docs/html/training/notify-user/navigation.jd @@ -95,6 +95,7 @@ next.link=managing.html {@link android.app.Activity}. For example: </p> <pre> +int id = 1; ... Intent resultIntent = new Intent(this, ResultActivity.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 08d6ca6..b3247ff 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -1297,7 +1297,7 @@ static void nativeVibrate(JNIEnv* env, size_t patternSize = env->GetArrayLength(patternObj); if (patternSize > MAX_VIBRATE_PATTERN_SIZE) { - ALOGI("Skipped requested vibration because the pattern size is %d " + ALOGI("Skipped requested vibration because the pattern size is %zu " "which is more than the maximum supported size of %d.", patternSize, MAX_VIBRATE_PATTERN_SIZE); return; // limit to reasonable size diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp index 3ee2b16..dbf5439 100644 --- a/services/core/jni/com_android_server_power_PowerManagerService.cpp +++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp @@ -190,8 +190,14 @@ static void nativeSetAutoSuspend(JNIEnv *env, jclass clazz, jboolean enable) { } static void nativeSendPowerHint(JNIEnv *env, jclass clazz, jint hintId, jint data) { + int data_param = data; + if (gPowerModule && gPowerModule->powerHint) { - gPowerModule->powerHint(gPowerModule, (power_hint_t)hintId, (void *)data); + if(data) + gPowerModule->powerHint(gPowerModule, (power_hint_t)hintId, &data_param); + else { + gPowerModule->powerHint(gPowerModule, (power_hint_t)hintId, NULL); + } } } |