use of android.telephony.TelephonyHistogram in project platform_frameworks_base by android.
the class ClientRequestStats method updateRequestHistograms.
public void updateRequestHistograms(int requestId, int time) {
synchronized (mRequestHistograms) {
TelephonyHistogram entry = mRequestHistograms.get(requestId);
if (entry == null) {
entry = new TelephonyHistogram(TelephonyHistogram.TELEPHONY_CATEGORY_RIL, requestId, REQUEST_HISTOGRAM_BUCKET_COUNT);
mRequestHistograms.put(requestId, entry);
}
entry.addTimeTaken(time);
}
}
use of android.telephony.TelephonyHistogram in project platform_frameworks_base by android.
the class ClientRequestStats method readFromParcel.
public void readFromParcel(Parcel in) {
mCallingPackage = in.readString();
mCompletedRequestsWakelockTime = in.readLong();
mCompletedRequestsCount = in.readLong();
mPendingRequestsWakelockTime = in.readLong();
mPendingRequestsCount = in.readLong();
ArrayList<TelephonyHistogram> requestHistograms = new ArrayList<TelephonyHistogram>();
in.readTypedList(requestHistograms, TelephonyHistogram.CREATOR);
for (TelephonyHistogram h : requestHistograms) {
mRequestHistograms.put(h.getId(), h);
}
}
use of android.telephony.TelephonyHistogram in project platform_frameworks_base by android.
the class ClientRequestStats method getRequestHistograms.
public List<TelephonyHistogram> getRequestHistograms() {
List<TelephonyHistogram> list;
synchronized (mRequestHistograms) {
list = new ArrayList<>(mRequestHistograms.size());
for (int i = 0; i < mRequestHistograms.size(); i++) {
TelephonyHistogram entry = new TelephonyHistogram(mRequestHistograms.valueAt(i));
list.add(entry);
}
}
return list;
}
use of android.telephony.TelephonyHistogram in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyHistogramTest method testTelephonyHistogramConstructor.
@Test
@SmallTest
public void testTelephonyHistogramConstructor() {
assertEquals(TelephonyHistogram.TELEPHONY_CATEGORY_RIL, mHistogram.getCategory());
assertEquals(1, mHistogram.getId());
assertEquals(Integer.MAX_VALUE, mHistogram.getMinTime());
assertEquals(0, mHistogram.getMaxTime());
assertEquals(0, mHistogram.getAverageTime());
assertEquals(0, mHistogram.getSampleCount());
assertEquals(3, mHistogram.getBucketCount());
// Test to verify that an exception is thrown when bucketCount <= 1
mHistogram = null;
try {
mHistogram = new TelephonyHistogram(TelephonyHistogram.TELEPHONY_CATEGORY_RIL, 1, 1);
Assert.fail("TelephonyHistogram should throw exception for bucketCount <= 1");
} catch (IllegalArgumentException ex) {
mHistogram = new TelephonyHistogram(TelephonyHistogram.TELEPHONY_CATEGORY_RIL, 1, 3);
}
}
use of android.telephony.TelephonyHistogram in project android_frameworks_opt_telephony by LineageOS.
the class RIL method addToRilHistogram.
private void addToRilHistogram(RILRequest rr) {
long endTime = SystemClock.elapsedRealtime();
int totalTime = (int) (endTime - rr.mStartTimeMs);
synchronized (mRilTimeHistograms) {
TelephonyHistogram entry = mRilTimeHistograms.get(rr.mRequest);
if (entry == null) {
// We would have total #RIL_HISTOGRAM_BUCKET_COUNT range buckets for RIL commands
entry = new TelephonyHistogram(TelephonyHistogram.TELEPHONY_CATEGORY_RIL, rr.mRequest, RIL_HISTOGRAM_BUCKET_COUNT);
mRilTimeHistograms.put(rr.mRequest, entry);
}
entry.addTimeTaken(totalTime);
}
}
Aggregations