FileDocCategorySizeDatePackage
HistoryHandler.javaAPI DocAndroid 5.1 API1824Thu Mar 12 22:22:48 GMT 2015com.android.ex.camera2.portability

HistoryHandler

public class HistoryHandler extends android.os.Handler

Fields Summary
private static final int
MAX_HISTORY_SIZE
final LinkedList
mMsgHistory
Constructors Summary
HistoryHandler(android.os.Looper looper)


      
        super(looper);
        mMsgHistory = new LinkedList<Integer>();
        // We add a -1 at the beginning to mark the very beginning of the
        // history.
        mMsgHistory.offerLast(-1);
    
Methods Summary
java.lang.StringgenerateHistoryString(int cameraId)

        String info = new String("HIST");
        info += "_ID" + cameraId;
        for (Integer msg : mMsgHistory) {
            info = info + '_" + msg.toString();
        }
        info += "_HEND";
        return info;
    
java.lang.IntegergetCurrentMessage()

        return mMsgHistory.peekLast();
    
public voidhandleMessage(android.os.Message msg)
Subclasses' implementations should call this one before doing their work.

        mMsgHistory.offerLast(msg.what);
        while (mMsgHistory.size() > MAX_HISTORY_SIZE) {
            mMsgHistory.pollFirst();
        }