title: java.lang.Thread.setPriority vs android.os.Process.setThreadPriority
body: <p><code>java.lang.Thread.setPriority</code> and <code>android.os.Process.setThreadPriority</code></p>
  
  <p>How are they different?</p>
  
  <p>First, in the <code>java.lang.Thread</code> class,</p>
  
  <pre><code>java.lang.Thread.setPriority(int priority)
  </code></pre>
  
  <p><code>priority</code> can have a value from <code>Thread.MIN_PRIORITY</code> ( = 1, Lowest) to <code>Thread.MAX_PRIORITY</code> ( = 10, Highest).</p>
  
  <p>There are related constants in the java.lang.Thread class.</p>
  
  <pre><code>public static final int MIN_PRIORITY = 1;
  public static final int NORM_PRIORITY = 5;
  public static final int MAX_PRIORITY = 10;
  </code></pre>
  
  <p>Second, in the <code>android.os.Process</code> class,</p>
  
  <pre><code>android.os.Process.setThreadPriority(int priority)
  </code></pre>
  
  <p><code>priority</code> can have a value from -20 (Highest) to 19 (Lowest).</p>
  
  <p>There are related constants in the android.os.Process class.</p>
  
  <pre><code>public static final int THREAD_PRIORITY_AUDIO = -16;
  public static final int THREAD_PRIORITY_BACKGROUND = 10;
  public static final int THREAD_PRIORITY_DEFAULT = 0;
  public static final int THREAD_PRIORITY_DISPLAY = -4;
  public static final int THREAD_PRIORITY_FOREGROUND = -2;
  public static final int THREAD_PRIORITY_LESS_FAVORABLE = 1;
  public static final int THREAD_PRIORITY_LOWEST = 19;
  public static final int THREAD_PRIORITY_MORE_FAVORABLE = -1;
  public static final int THREAD_PRIORITY_URGENT_AUDIO = -19;
  public static final int THREAD_PRIORITY_URGENT_DISPLAY = -8;
  </code></pre>
  
  <p>I found that the priority values are different, but I don't know why. I don't know how they work differently.</p>