title: queryUsageStats interval duration
body: <p>I'm using UsageStatsManager API to get usage statistics for a certain time interval. All works fine if I use the predefined intervals i.e. INTERVAL_DAILY, INTERVAL_WEEKLY, INTERVAL_MONTHLY, INTERVAL_YEARLY. But if I want to view the data for the past 2 or 3 hours, I am getting today's data for the whole day. I have tried using Calendars and System.currentTimeMillis() but that didn't give me filtered results.</p>
  
  <p>Calendar approach : </p>
  
  <pre><code>Calendar startCalendar = Calendar.getInstance();
  startCalendar.add(Calendar.HOUR_OF_DAY, -2);
  
  Calendar endCalendar = Calendar.getInstance();
  </code></pre>
  
  <p>And pass this to queryUsageStats method like this:</p>
  
  <pre><code>usageList = usm.queryUsageStats(interval, startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis());
  </code></pre>
  
  <p>where interval is INTERVAL_BEST.</p>
  
  <p>System.currentTimeMillis() approach : </p>
  
  <pre><code>long startTime = System.currentTimeMillis() - 7200*1000 // 7200 seconds i.e. 2 hrs
  
  long endTime = System.currentTimeMillis();
  </code></pre>
  
  <p>Pass this to queryUsageStats just like above :</p>
  
  <pre><code>usageList = usm.queryUsageStats(interval, startTime, endTime);
  </code></pre>
  
  <p>where interval is again INTERVAL_BEST.</p>
  
  <p>I'd like to know whether it's possible to get data for this duration i.e. less than a day, as the INTERVAL_BEST hasn't been documented properly to include this information. Any help would be appreciated as I'm stuck on this problem.</p>