<!-- The content of a dialog showing trimming in progress. [CHAR LIMIT=30] -->
<string name="please_wait">Please wait</string>
- <!-- Text to show with progress bar while stitching a photo sphere. 'Photo sphere' is a product name. [CHAR LIMIT=35]-->
- <string name="rendering_photo_sphere">Rendering photo sphere</string>
-
<!-- title for the dialog showing the error of camera hardware -->
<string name="camera_error_title">Camera error</string>
<!-- Default for camera startup module index -->
<string name="pref_camera_startup_index_default" translatable="false">0</string>
-
- <!-- A message shown to the user, indicating that a media item is being processed. [CHAR LIMIT=25] -->
- <string name="processing">Processing …</string>
+
+ <!-- A message shown to the user, indicating that an HDR+ photo is being processed. [CHAR LIMIT=25] -->
+ <string name="processing_hdr_plus">Processing HDR+ …</string>
</resources>
import com.android.camera.session.ProcessingNotificationManager;
import com.android.camera.util.CameraUtil;
import com.android.camera.util.UsageStatistics;
-import com.android.camera2.R;
/**
* The Camera application class containing important services and functionality
mMediaSaver = new MediaSaverImpl();
mNotificationManager = new ProcessingNotificationManager(this);
mPlaceHolderManager = new PlaceholderManager(context);
- CharSequence defaultProgressMessage = getText(R.string.processing);
-
mSessionManager = new CaptureSessionManagerImpl(mMediaSaver, getContentResolver(),
- mNotificationManager, mPlaceHolderManager, defaultProgressMessage);
+ mNotificationManager, mPlaceHolderManager);
mMemoryManager = MemoryManagerImpl.create(getApplicationContext(), mMediaSaver);
}
private CaptureSessionImpl(String title) {
mTitle = title;
- mProgressMessage = mDefaultProgressMessage;
}
@Override
private final ProcessingNotificationManager mNotificationManager;
private final PlaceholderManager mPlaceholderManager;
private final ContentResolver mContentResolver;
- private final CharSequence mDefaultProgressMessage;
/**
* We use this to fire events to the session listeners from the main thread.
* progress
* @param placeholderManager used to manage placeholders in the filmstrip
* before the final result is ready
- * @param defaultProgressMessage message shown as the current progress
- * status by default
*/
public CaptureSessionManagerImpl(MediaSaver mediaSaver,
ContentResolver contentResolver, ProcessingNotificationManager notificationManager,
- PlaceholderManager placeholderManager, CharSequence defaultProgressMessage) {
+ PlaceholderManager placeholderManager) {
mSessions = new HashMap<String, CaptureSession>();
mMediaSaver = mediaSaver;
mContentResolver = contentResolver;
mNotificationManager = notificationManager;
mPlaceholderManager = placeholderManager;
- mDefaultProgressMessage = defaultProgressMessage;
}
@Override
import android.app.NotificationManager;
import android.content.Context;
import android.os.Build;
+import android.util.SparseArray;
import com.android.camera2.R;
private final Context mContext;
private final NotificationManager mNotificationManager;
- private Notification.Builder mInProgressNotificationBuilder;
+ private final SparseArray<Notification.Builder> mNotificationBuilders =
+ new SparseArray<Notification.Builder>();
/**
* Creates a new {@code ProcessingNotificationManager} with a
* @return whether the update was successful
*/
public boolean setProgress(int progress, int notificationId) {
- if (mInProgressNotificationBuilder == null) {
+ Notification.Builder builder = mNotificationBuilders.get(notificationId);
+ if (builder == null) {
return false;
}
- mInProgressNotificationBuilder.setProgress(100, progress, false);
- mNotificationManager.notify(
- notificationId, buildNotification(mInProgressNotificationBuilder));
+ builder.setProgress(100, progress, false);
+ mNotificationManager.notify(notificationId, buildNotification(builder));
return true;
}
* @return whether the update was successful
*/
public boolean setStatus(CharSequence status, int notificationId) {
- if (mInProgressNotificationBuilder == null) {
+ Notification.Builder builder = mNotificationBuilders.get(notificationId);
+ if (builder == null) {
return false;
}
- mInProgressNotificationBuilder.setContentText(status);
- mNotificationManager.notify(
- notificationId, buildNotification(mInProgressNotificationBuilder));
+ builder.setContentText(status);
+ mNotificationManager.notify(notificationId, buildNotification(builder));
return true;
}
* @return The ID of the notification.
*/
public int notifyStart(CharSequence statusMessage) {
- if (mInProgressNotificationBuilder != null) {
- return -1;
- }
- mInProgressNotificationBuilder = createInProgressNotificationBuilder(statusMessage);
+ Notification.Builder builder = createInProgressNotificationBuilder(statusMessage);
// Increment the global notification id to make sure we have a unique
// id.
int notificationId = sUniqueNotificationId.incrementAndGet();
+ mNotificationBuilders.put(notificationId, builder);
mNotificationManager.notify(
- notificationId, buildNotification(mInProgressNotificationBuilder));
+ notificationId, buildNotification(builder));
return notificationId;
}
* notification.
*/
public void notifyCompletion(int notificationId) {
- if (mInProgressNotificationBuilder == null) {
+ Notification.Builder builder = mNotificationBuilders.get(notificationId);
+ if (builder == null) {
return;
}
mNotificationManager.cancel(notificationId);
- mInProgressNotificationBuilder = null;
+ builder = null;
}
/**
* left intact.
*/
public void cancel(int notificationId) {
- if (mInProgressNotificationBuilder == null) {
+ Notification.Builder builder = mNotificationBuilders.get(notificationId);
+ if (builder == null) {
return;
}
mNotificationManager.cancel(notificationId);
- mInProgressNotificationBuilder = null;
+ builder = null;
}
/**
.setOngoing(true)
.setContentTitle(mContext.getText(R.string.app_name))
.setProgress(100, 0, false)
- .setTicker(statusMessage);
+ .setContentText(statusMessage);
}
@SuppressLint("NewApi")