1/* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package org.drrickorang.loopback; 18 19import android.app.Activity; 20import android.os.Bundle; 21import android.util.Log; 22import android.view.View; 23 24import java.util.Arrays; 25 26 27/** 28 * This activity will display a histogram that shows the recorder's buffer period. 29 */ 30 31public class RecorderBufferPeriodActivity extends Activity { 32 private static final String TAG = "RecorderBufferPeriodActivity"; 33 34 35 public void onCreate(Bundle savedInstanceState) { 36 super.onCreate(savedInstanceState); 37 38 View view = getLayoutInflater().inflate(R.layout.recorder_buffer_period_activity, null); 39 setContentView(view); 40 HistogramView histogramView = (HistogramView) findViewById(R.id.viewReadHistogram); 41 Bundle bundle = getIntent().getExtras(); 42 43 // setup the histogram 44 int[] bufferData = bundle.getIntArray("recorderBufferPeriodArray"); 45 int bufferDataMax = bundle.getInt("recorderBufferPeriodMax"); 46 histogramView.setBufferPeriodArray(bufferData); 47 histogramView.setMaxBufferPeriod(bufferDataMax); 48 49 } 50 51 52 private static void log(String msg) { 53 Log.v(TAG, msg); 54 } 55 56} 57