From 69ef2b22ff6c5dcce78423ef502d14f841b04fed Mon Sep 17 00:00:00 2001 From: Paul Westbrook Date: Thu, 11 Apr 2013 00:15:06 -0700 Subject: [PATCH] Fix TempDirectory initialization The proxy for local services were not intializing the TempDirectory. Also, move the TempDirectory initialization out of the try/catch block. Otherwise if Device.getDeviceId threw an exception, the temp directory wouldn't be initialized Bug: 8531456 Change-Id: Iea34e0b03203d6c6fe6e5d1ae9902d081bd90c27 --- .../emailcommon/service/EmailServiceProxy.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java index c7c77b897..e1b0efec3 100644 --- a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java +++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java @@ -81,6 +81,7 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService { public EmailServiceProxy(Context _context, Class _class, IEmailServiceCallback _callback) { super(_context, new Intent(_context, _class)); + TempDirectory.setTempDirectory(_context); mCallback = _callback; isRemote = false; } @@ -91,22 +92,15 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService { super(_context, _intent); try { Device.getDeviceId(_context); - TempDirectory.setTempDirectory(_context); } catch (IOException e) { } + TempDirectory.setTempDirectory(_context); mCallback = _callback; isRemote = true; } public EmailServiceProxy(Context _context, String _action, IEmailServiceCallback _callback) { - super(_context, new Intent(_action)); - try { - Device.getDeviceId(_context); - TempDirectory.setTempDirectory(_context); - } catch (IOException e) { - } - mCallback = _callback; - isRemote = true; + this(_context, new Intent(_action), _callback); } @Override