fail fast if privService.getInstalledPackages() isn't working
If `privService.getInstalledPackages()` throws something other than a `RemoteException`, this should fail as fast as possible. Crashing will give users a prompt to send the crash report. using `finally` will just cause weirdness since it might try to execute `compareToPackageManager()` even when it is in the process of crashing.
This commit is contained in:
		
							parent
							
								
									6710b74477
								
							
						
					
					
						commit
						bde60282f1
					
				| @ -196,10 +196,9 @@ public class InstalledAppProviderService extends JobIntentService { | |||||||
|                     try { |                     try { | ||||||
|                         packageInfoList = privService.getInstalledPackages(PackageManager.GET_SIGNATURES); |                         packageInfoList = privService.getInstalledPackages(PackageManager.GET_SIGNATURES); | ||||||
|                     } catch (RemoteException e) { |                     } catch (RemoteException e) { | ||||||
|                         Log.e(TAG, "RemoteException", e); |                         e.printStackTrace(); | ||||||
|                     } finally { |  | ||||||
|                         compareToPackageManager(context, packageInfoList); |  | ||||||
|                     } |                     } | ||||||
|  |                     compareToPackageManager(context, packageInfoList); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @Override |                 @Override | ||||||
| @ -213,9 +212,7 @@ public class InstalledAppProviderService extends JobIntentService { | |||||||
|             context.getApplicationContext().bindService(serviceIntent, mServiceConnection, |             context.getApplicationContext().bindService(serviceIntent, mServiceConnection, | ||||||
|                     Context.BIND_AUTO_CREATE); |                     Context.BIND_AUTO_CREATE); | ||||||
|         } else { |         } else { | ||||||
|             List<PackageInfo> packageInfoList = context.getPackageManager() |             compareToPackageManager(context, null); | ||||||
|                     .getInstalledPackages(PackageManager.GET_SIGNATURES); |  | ||||||
|             compareToPackageManager(context, packageInfoList); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Hans-Christoph Steiner
						Hans-Christoph Steiner