Loading location/java/android/location/provider/LocationProviderBase.java +31 −9 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ import android.content.Context; import android.content.Intent; import android.location.Location; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.util.Log; Loading Loading @@ -308,9 +310,7 @@ public abstract class LocationProviderBase { synchronized (mBinder) { try { manager.onInitialize(mAllowed, mProperties, mAttributionTag); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (RuntimeException e) { } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } Loading @@ -320,12 +320,28 @@ public abstract class LocationProviderBase { @Override public void setRequest(ProviderRequest request) { try { onSetRequest(request); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } @Override public void flush() { try { onFlush(this::onFlushComplete); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } private void onFlushComplete() { Loading @@ -333,9 +349,7 @@ public abstract class LocationProviderBase { if (manager != null) { try { manager.onFlushComplete(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (RuntimeException e) { } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } Loading @@ -343,7 +357,15 @@ public abstract class LocationProviderBase { @Override public void sendExtraCommand(String command, Bundle extras) { try { onSendExtraCommand(command, extras); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } } } Loading
location/java/android/location/provider/LocationProviderBase.java +31 −9 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ import android.content.Context; import android.content.Intent; import android.location.Location; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.util.Log; Loading Loading @@ -308,9 +310,7 @@ public abstract class LocationProviderBase { synchronized (mBinder) { try { manager.onInitialize(mAllowed, mProperties, mAttributionTag); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (RuntimeException e) { } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } Loading @@ -320,12 +320,28 @@ public abstract class LocationProviderBase { @Override public void setRequest(ProviderRequest request) { try { onSetRequest(request); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } @Override public void flush() { try { onFlush(this::onFlushComplete); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } private void onFlushComplete() { Loading @@ -333,9 +349,7 @@ public abstract class LocationProviderBase { if (manager != null) { try { manager.onFlushComplete(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (RuntimeException e) { } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } Loading @@ -343,7 +357,15 @@ public abstract class LocationProviderBase { @Override public void sendExtraCommand(String command, Bundle extras) { try { onSendExtraCommand(command, extras); } catch (RuntimeException e) { // exceptions on one-way binder threads are dropped - move to a different thread Log.w(mTag, e); new Handler(Looper.getMainLooper()).post(() -> { throw new AssertionError(e); }); } } } }