/framework/java/jd-gui/android/content/ContentProviderProxy.java

https://bitbucket.org/chaos_rom/miui_frameworks · Java · 469 lines · 305 code · 18 blank · 146 comment · 7 complexity · b4851d3f4595019b722c41bb478e0cbc MD5 · raw file

  1. package android.content;
  2. import android.content.res.AssetFileDescriptor;
  3. import android.database.DatabaseUtils;
  4. import android.net.Uri;
  5. import android.os.Bundle;
  6. import android.os.IBinder;
  7. import android.os.ICancellationSignal;
  8. import android.os.ICancellationSignal.Stub;
  9. import android.os.Parcel;
  10. import android.os.ParcelFileDescriptor;
  11. import android.os.Parcelable.Creator;
  12. import android.os.RemoteException;
  13. import java.io.FileNotFoundException;
  14. import java.util.ArrayList;
  15. import java.util.Iterator;
  16. final class ContentProviderProxy
  17. implements IContentProvider
  18. {
  19. private IBinder mRemote;
  20. public ContentProviderProxy(IBinder paramIBinder)
  21. {
  22. this.mRemote = paramIBinder;
  23. }
  24. public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> paramArrayList)
  25. throws RemoteException, OperationApplicationException
  26. {
  27. Parcel localParcel1 = Parcel.obtain();
  28. Parcel localParcel2 = Parcel.obtain();
  29. try
  30. {
  31. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  32. localParcel1.writeInt(paramArrayList.size());
  33. Iterator localIterator = paramArrayList.iterator();
  34. while (localIterator.hasNext())
  35. ((ContentProviderOperation)localIterator.next()).writeToParcel(localParcel1, 0);
  36. }
  37. finally
  38. {
  39. localParcel1.recycle();
  40. localParcel2.recycle();
  41. }
  42. this.mRemote.transact(20, localParcel1, localParcel2, 0);
  43. DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(localParcel2);
  44. ContentProviderResult[] arrayOfContentProviderResult = (ContentProviderResult[])localParcel2.createTypedArray(ContentProviderResult.CREATOR);
  45. localParcel1.recycle();
  46. localParcel2.recycle();
  47. return arrayOfContentProviderResult;
  48. }
  49. public IBinder asBinder()
  50. {
  51. return this.mRemote;
  52. }
  53. public int bulkInsert(Uri paramUri, ContentValues[] paramArrayOfContentValues)
  54. throws RemoteException
  55. {
  56. Parcel localParcel1 = Parcel.obtain();
  57. Parcel localParcel2 = Parcel.obtain();
  58. try
  59. {
  60. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  61. paramUri.writeToParcel(localParcel1, 0);
  62. localParcel1.writeTypedArray(paramArrayOfContentValues, 0);
  63. this.mRemote.transact(13, localParcel1, localParcel2, 0);
  64. DatabaseUtils.readExceptionFromParcel(localParcel2);
  65. int i = localParcel2.readInt();
  66. return i;
  67. }
  68. finally
  69. {
  70. localParcel1.recycle();
  71. localParcel2.recycle();
  72. }
  73. }
  74. public Bundle call(String paramString1, String paramString2, Bundle paramBundle)
  75. throws RemoteException
  76. {
  77. Parcel localParcel1 = Parcel.obtain();
  78. Parcel localParcel2 = Parcel.obtain();
  79. try
  80. {
  81. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  82. localParcel1.writeString(paramString1);
  83. localParcel1.writeString(paramString2);
  84. localParcel1.writeBundle(paramBundle);
  85. this.mRemote.transact(21, localParcel1, localParcel2, 0);
  86. DatabaseUtils.readExceptionFromParcel(localParcel2);
  87. Bundle localBundle = localParcel2.readBundle();
  88. return localBundle;
  89. }
  90. finally
  91. {
  92. localParcel1.recycle();
  93. localParcel2.recycle();
  94. }
  95. }
  96. public ICancellationSignal createCancellationSignal()
  97. throws RemoteException
  98. {
  99. Parcel localParcel1 = Parcel.obtain();
  100. Parcel localParcel2 = Parcel.obtain();
  101. try
  102. {
  103. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  104. this.mRemote.transact(24, localParcel1, localParcel2, 0);
  105. DatabaseUtils.readExceptionFromParcel(localParcel2);
  106. ICancellationSignal localICancellationSignal = ICancellationSignal.Stub.asInterface(localParcel2.readStrongBinder());
  107. return localICancellationSignal;
  108. }
  109. finally
  110. {
  111. localParcel1.recycle();
  112. localParcel2.recycle();
  113. }
  114. }
  115. public int delete(Uri paramUri, String paramString, String[] paramArrayOfString)
  116. throws RemoteException
  117. {
  118. Parcel localParcel1 = Parcel.obtain();
  119. Parcel localParcel2 = Parcel.obtain();
  120. try
  121. {
  122. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  123. paramUri.writeToParcel(localParcel1, 0);
  124. localParcel1.writeString(paramString);
  125. localParcel1.writeStringArray(paramArrayOfString);
  126. this.mRemote.transact(4, localParcel1, localParcel2, 0);
  127. DatabaseUtils.readExceptionFromParcel(localParcel2);
  128. int i = localParcel2.readInt();
  129. return i;
  130. }
  131. finally
  132. {
  133. localParcel1.recycle();
  134. localParcel2.recycle();
  135. }
  136. }
  137. public String[] getStreamTypes(Uri paramUri, String paramString)
  138. throws RemoteException
  139. {
  140. Parcel localParcel1 = Parcel.obtain();
  141. Parcel localParcel2 = Parcel.obtain();
  142. try
  143. {
  144. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  145. paramUri.writeToParcel(localParcel1, 0);
  146. localParcel1.writeString(paramString);
  147. this.mRemote.transact(22, localParcel1, localParcel2, 0);
  148. DatabaseUtils.readExceptionFromParcel(localParcel2);
  149. String[] arrayOfString = localParcel2.createStringArray();
  150. return arrayOfString;
  151. }
  152. finally
  153. {
  154. localParcel1.recycle();
  155. localParcel2.recycle();
  156. }
  157. }
  158. public String getType(Uri paramUri)
  159. throws RemoteException
  160. {
  161. Parcel localParcel1 = Parcel.obtain();
  162. Parcel localParcel2 = Parcel.obtain();
  163. try
  164. {
  165. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  166. paramUri.writeToParcel(localParcel1, 0);
  167. this.mRemote.transact(2, localParcel1, localParcel2, 0);
  168. DatabaseUtils.readExceptionFromParcel(localParcel2);
  169. String str = localParcel2.readString();
  170. return str;
  171. }
  172. finally
  173. {
  174. localParcel1.recycle();
  175. localParcel2.recycle();
  176. }
  177. }
  178. public Uri insert(Uri paramUri, ContentValues paramContentValues)
  179. throws RemoteException
  180. {
  181. Parcel localParcel1 = Parcel.obtain();
  182. Parcel localParcel2 = Parcel.obtain();
  183. try
  184. {
  185. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  186. paramUri.writeToParcel(localParcel1, 0);
  187. paramContentValues.writeToParcel(localParcel1, 0);
  188. this.mRemote.transact(3, localParcel1, localParcel2, 0);
  189. DatabaseUtils.readExceptionFromParcel(localParcel2);
  190. Uri localUri = (Uri)Uri.CREATOR.createFromParcel(localParcel2);
  191. return localUri;
  192. }
  193. finally
  194. {
  195. localParcel1.recycle();
  196. localParcel2.recycle();
  197. }
  198. }
  199. public AssetFileDescriptor openAssetFile(Uri paramUri, String paramString)
  200. throws RemoteException, FileNotFoundException
  201. {
  202. Parcel localParcel1 = Parcel.obtain();
  203. Parcel localParcel2 = Parcel.obtain();
  204. try
  205. {
  206. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  207. paramUri.writeToParcel(localParcel1, 0);
  208. localParcel1.writeString(paramString);
  209. this.mRemote.transact(15, localParcel1, localParcel2, 0);
  210. DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(localParcel2);
  211. if (localParcel2.readInt() != 0)
  212. {
  213. AssetFileDescriptor localAssetFileDescriptor2 = (AssetFileDescriptor)AssetFileDescriptor.CREATOR.createFromParcel(localParcel2);
  214. localAssetFileDescriptor1 = localAssetFileDescriptor2;
  215. return localAssetFileDescriptor1;
  216. }
  217. AssetFileDescriptor localAssetFileDescriptor1 = null;
  218. }
  219. finally
  220. {
  221. localParcel1.recycle();
  222. localParcel2.recycle();
  223. }
  224. }
  225. public ParcelFileDescriptor openFile(Uri paramUri, String paramString)
  226. throws RemoteException, FileNotFoundException
  227. {
  228. Parcel localParcel1 = Parcel.obtain();
  229. Parcel localParcel2 = Parcel.obtain();
  230. try
  231. {
  232. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  233. paramUri.writeToParcel(localParcel1, 0);
  234. localParcel1.writeString(paramString);
  235. this.mRemote.transact(14, localParcel1, localParcel2, 0);
  236. DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(localParcel2);
  237. if (localParcel2.readInt() != 0)
  238. {
  239. ParcelFileDescriptor localParcelFileDescriptor2 = localParcel2.readFileDescriptor();
  240. localParcelFileDescriptor1 = localParcelFileDescriptor2;
  241. return localParcelFileDescriptor1;
  242. }
  243. ParcelFileDescriptor localParcelFileDescriptor1 = null;
  244. }
  245. finally
  246. {
  247. localParcel1.recycle();
  248. localParcel2.recycle();
  249. }
  250. }
  251. public AssetFileDescriptor openTypedAssetFile(Uri paramUri, String paramString, Bundle paramBundle)
  252. throws RemoteException, FileNotFoundException
  253. {
  254. Parcel localParcel1 = Parcel.obtain();
  255. Parcel localParcel2 = Parcel.obtain();
  256. try
  257. {
  258. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  259. paramUri.writeToParcel(localParcel1, 0);
  260. localParcel1.writeString(paramString);
  261. localParcel1.writeBundle(paramBundle);
  262. this.mRemote.transact(23, localParcel1, localParcel2, 0);
  263. DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(localParcel2);
  264. if (localParcel2.readInt() != 0)
  265. {
  266. AssetFileDescriptor localAssetFileDescriptor2 = (AssetFileDescriptor)AssetFileDescriptor.CREATOR.createFromParcel(localParcel2);
  267. localAssetFileDescriptor1 = localAssetFileDescriptor2;
  268. return localAssetFileDescriptor1;
  269. }
  270. AssetFileDescriptor localAssetFileDescriptor1 = null;
  271. }
  272. finally
  273. {
  274. localParcel1.recycle();
  275. localParcel2.recycle();
  276. }
  277. }
  278. // ERROR //
  279. public android.database.Cursor query(Uri paramUri, String[] paramArrayOfString1, String paramString1, String[] paramArrayOfString2, String paramString2, ICancellationSignal paramICancellationSignal)
  280. throws RemoteException
  281. {
  282. // Byte code:
  283. // 0: new 185 android/database/BulkCursorToCursorAdaptor
  284. // 3: dup
  285. // 4: invokespecial 186 android/database/BulkCursorToCursorAdaptor:<init> ()V
  286. // 7: astore 7
  287. // 9: invokestatic 27 android/os/Parcel:obtain ()Landroid/os/Parcel;
  288. // 12: astore 8
  289. // 14: invokestatic 27 android/os/Parcel:obtain ()Landroid/os/Parcel;
  290. // 17: astore 9
  291. // 19: aload 8
  292. // 21: ldc 29
  293. // 23: invokevirtual 33 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
  294. // 26: aload_1
  295. // 27: aload 8
  296. // 29: iconst_0
  297. // 30: invokevirtual 97 android/net/Uri:writeToParcel (Landroid/os/Parcel;I)V
  298. // 33: iconst_0
  299. // 34: istore 13
  300. // 36: aload_2
  301. // 37: ifnull +7 -> 44
  302. // 40: aload_2
  303. // 41: arraylength
  304. // 42: istore 13
  305. // 44: aload 8
  306. // 46: iload 13
  307. // 48: invokevirtual 43 android/os/Parcel:writeInt (I)V
  308. // 51: iconst_0
  309. // 52: istore 14
  310. // 54: iload 14
  311. // 56: iload 13
  312. // 58: if_icmpge +18 -> 76
  313. // 61: aload 8
  314. // 63: aload_2
  315. // 64: iload 14
  316. // 66: aaload
  317. // 67: invokevirtual 112 android/os/Parcel:writeString (Ljava/lang/String;)V
  318. // 70: iinc 14 1
  319. // 73: goto -19 -> 54
  320. // 76: aload 8
  321. // 78: aload_3
  322. // 79: invokevirtual 112 android/os/Parcel:writeString (Ljava/lang/String;)V
  323. // 82: aload 4
  324. // 84: ifnull +196 -> 280
  325. // 87: aload 4
  326. // 89: arraylength
  327. // 90: istore 15
  328. // 92: aload 8
  329. // 94: iload 15
  330. // 96: invokevirtual 43 android/os/Parcel:writeInt (I)V
  331. // 99: iconst_0
  332. // 100: istore 16
  333. // 102: iload 16
  334. // 104: iload 15
  335. // 106: if_icmpge +19 -> 125
  336. // 109: aload 8
  337. // 111: aload 4
  338. // 113: iload 16
  339. // 115: aaload
  340. // 116: invokevirtual 112 android/os/Parcel:writeString (Ljava/lang/String;)V
  341. // 119: iinc 16 1
  342. // 122: goto -20 -> 102
  343. // 125: aload 8
  344. // 127: aload 5
  345. // 129: invokevirtual 112 android/os/Parcel:writeString (Ljava/lang/String;)V
  346. // 132: aload 8
  347. // 134: aload 7
  348. // 136: invokevirtual 190 android/database/BulkCursorToCursorAdaptor:getObserver ()Landroid/database/IContentObserver;
  349. // 139: invokeinterface 194 1 0
  350. // 144: invokevirtual 197 android/os/Parcel:writeStrongBinder (Landroid/os/IBinder;)V
  351. // 147: aload 6
  352. // 149: ifnull +79 -> 228
  353. // 152: aload 6
  354. // 154: invokeinterface 200 1 0
  355. // 159: astore 17
  356. // 161: aload 8
  357. // 163: aload 17
  358. // 165: invokevirtual 197 android/os/Parcel:writeStrongBinder (Landroid/os/IBinder;)V
  359. // 168: aload_0
  360. // 169: getfield 15 android/content/ContentProviderProxy:mRemote Landroid/os/IBinder;
  361. // 172: iconst_1
  362. // 173: aload 8
  363. // 175: aload 9
  364. // 177: iconst_0
  365. // 178: invokeinterface 72 5 0
  366. // 183: pop
  367. // 184: aload 9
  368. // 186: invokestatic 104 android/database/DatabaseUtils:readExceptionFromParcel (Landroid/os/Parcel;)V
  369. // 189: aload 9
  370. // 191: invokevirtual 107 android/os/Parcel:readInt ()I
  371. // 194: ifeq +40 -> 234
  372. // 197: aload 7
  373. // 199: getstatic 203 android/database/BulkCursorDescriptor:CREATOR Landroid/os/Parcelable$Creator;
  374. // 202: aload 9
  375. // 204: invokeinterface 161 2 0
  376. // 209: checkcast 202 android/database/BulkCursorDescriptor
  377. // 212: invokevirtual 207 android/database/BulkCursorToCursorAdaptor:initialize (Landroid/database/BulkCursorDescriptor;)V
  378. // 215: aload 8
  379. // 217: invokevirtual 66 android/os/Parcel:recycle ()V
  380. // 220: aload 9
  381. // 222: invokevirtual 66 android/os/Parcel:recycle ()V
  382. // 225: aload 7
  383. // 227: areturn
  384. // 228: aconst_null
  385. // 229: astore 17
  386. // 231: goto -70 -> 161
  387. // 234: aload 7
  388. // 236: invokevirtual 210 android/database/BulkCursorToCursorAdaptor:close ()V
  389. // 239: aconst_null
  390. // 240: astore 7
  391. // 242: goto -27 -> 215
  392. // 245: astore 12
  393. // 247: aload 7
  394. // 249: invokevirtual 210 android/database/BulkCursorToCursorAdaptor:close ()V
  395. // 252: aload 12
  396. // 254: athrow
  397. // 255: astore 11
  398. // 257: aload 8
  399. // 259: invokevirtual 66 android/os/Parcel:recycle ()V
  400. // 262: aload 9
  401. // 264: invokevirtual 66 android/os/Parcel:recycle ()V
  402. // 267: aload 11
  403. // 269: athrow
  404. // 270: astore 10
  405. // 272: aload 7
  406. // 274: invokevirtual 210 android/database/BulkCursorToCursorAdaptor:close ()V
  407. // 277: aload 10
  408. // 279: athrow
  409. // 280: iconst_0
  410. // 281: istore 15
  411. // 283: goto -191 -> 92
  412. //
  413. // Exception table:
  414. // from to target type
  415. // 19 215 245 android/os/RemoteException
  416. // 234 239 245 android/os/RemoteException
  417. // 19 215 255 finally
  418. // 234 239 255 finally
  419. // 247 255 255 finally
  420. // 272 280 255 finally
  421. // 19 215 270 java/lang/RuntimeException
  422. // 234 239 270 java/lang/RuntimeException
  423. }
  424. public int update(Uri paramUri, ContentValues paramContentValues, String paramString, String[] paramArrayOfString)
  425. throws RemoteException
  426. {
  427. Parcel localParcel1 = Parcel.obtain();
  428. Parcel localParcel2 = Parcel.obtain();
  429. try
  430. {
  431. localParcel1.writeInterfaceToken("android.content.IContentProvider");
  432. paramUri.writeToParcel(localParcel1, 0);
  433. paramContentValues.writeToParcel(localParcel1, 0);
  434. localParcel1.writeString(paramString);
  435. localParcel1.writeStringArray(paramArrayOfString);
  436. this.mRemote.transact(10, localParcel1, localParcel2, 0);
  437. DatabaseUtils.readExceptionFromParcel(localParcel2);
  438. int i = localParcel2.readInt();
  439. return i;
  440. }
  441. finally
  442. {
  443. localParcel1.recycle();
  444. localParcel2.recycle();
  445. }
  446. }
  447. }
  448. /* Location: /home/lithium/miui/chameleon/2.11.16/framework_dex2jar.jar
  449. * Qualified Name: android.content.ContentProviderProxy
  450. * JD-Core Version: 0.6.2
  451. */