Advertisement
manfromnn

RILRequest_ZTE_V790

Aug 15th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.25 KB | None | 0 0
  1. package com.android.internal.telephony;
  2.  
  3. import android.os.AsyncResult;
  4. import android.os.Message;
  5. import android.os.Parcel;
  6. import android.util.Log;
  7.  
  8. class RILRequest
  9. {
  10.   static final String LOG_TAG = "RILJ";
  11.   private static final int MAX_POOL_SIZE = 4;
  12.   static int sNextSerial = 0;
  13.   private static RILRequest sPool = null;
  14.   private static int sPoolSize = 0;
  15.   private static Object sPoolSync;
  16.   static Object sSerialMonitor = new Object();
  17.   RILRequest mNext;
  18.   int mRequest;
  19.   Message mResult;
  20.   int mSerial;
  21.   Parcel mp;
  22.  
  23.   static
  24.   {
  25.     sPoolSync = new Object();
  26.   }
  27.  
  28.   static RILRequest obtain(int paramInt, Message paramMessage)
  29.   {
  30.     RILRequest localRILRequest2;
  31.     synchronized (sPoolSync)
  32.     {
  33.       RILRequest localRILRequest1 = sPool;
  34.       localRILRequest2 = null;
  35.       if (localRILRequest1 != null)
  36.       {
  37.         localRILRequest2 = sPool;
  38.         sPool = localRILRequest2.mNext;
  39.         localRILRequest2.mNext = null;
  40.         sPoolSize = -1 + sPoolSize;
  41.       }
  42.       if (localRILRequest2 == null) {
  43.         localRILRequest2 = new RILRequest();
  44.       }
  45.     }
  46.     synchronized (sSerialMonitor)
  47.     {
  48.       int i = sNextSerial;
  49.       sNextSerial = i + 1;
  50.       localRILRequest2.mSerial = i;
  51.       localRILRequest2.mRequest = paramInt;
  52.       localRILRequest2.mResult = paramMessage;
  53.       localRILRequest2.mp = Parcel.obtain();
  54.       if ((paramMessage != null) && (paramMessage.getTarget() == null))
  55.       {
  56.         throw new NullPointerException("Message target must not be null");
  57.         localObject2 = finally;
  58.         throw localObject2;
  59.       }
  60.     }
  61.     localRILRequest2.mp.writeInt(paramInt);
  62.     localRILRequest2.mp.writeInt(localRILRequest2.mSerial);
  63.     return localRILRequest2;
  64.   }
  65.  
  66.   static void resetSerial()
  67.   {
  68.     synchronized (sSerialMonitor)
  69.     {
  70.       sNextSerial = 0;
  71.       return;
  72.     }
  73.   }
  74.  
  75.   void onError(int paramInt, Object paramObject)
  76.   {
  77.     CommandException localCommandException = CommandException.fromRilErrno(paramInt);
  78.     Log.d("RILJ", serialString() + "< " + RIL.requestToString(this.mRequest) + " error: " + localCommandException);
  79.     if (this.mResult != null)
  80.     {
  81.       AsyncResult.forMessage(this.mResult, paramObject, localCommandException);
  82.       this.mResult.sendToTarget();
  83.     }
  84.     if (this.mp != null)
  85.     {
  86.       this.mp.recycle();
  87.       this.mp = null;
  88.     }
  89.   }
  90.  
  91.   void release()
  92.   {
  93.     synchronized (sPoolSync)
  94.     {
  95.       if (sPoolSize < 4)
  96.       {
  97.         this.mNext = sPool;
  98.         sPool = this;
  99.         sPoolSize = 1 + sPoolSize;
  100.         this.mResult = null;
  101.       }
  102.       return;
  103.     }
  104.   }
  105.  
  106.   String serialString()
  107.   {
  108.     StringBuilder localStringBuilder = new StringBuilder(8);
  109.     String str = Integer.toString(this.mSerial);
  110.     localStringBuilder.append('[');
  111.     int i = 0;
  112.     int j = str.length();
  113.     while (i < 4 - j)
  114.     {
  115.       localStringBuilder.append('0');
  116.       i++;
  117.     }
  118.     localStringBuilder.append(str);
  119.     localStringBuilder.append(']');
  120.     return localStringBuilder.toString();
  121.   }
  122. }
  123.  
  124.  
  125.  
  126. /* Location:           C:\AndroidMultitool\JD-gui\Stock\Framework\framework-dex2jar.jar
  127.  
  128.  * Qualified Name:     com.android.internal.telephony.RILRequest
  129.  
  130.  * JD-Core Version:    0.7.0.1
  131.  
  132.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement