Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3e061fc authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 24609 into eclair

* changes:
  If disk-full, don't crash the system server. Still todo: when we have disk we should trigger the  event again.
parents b942db35 b6437245
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -21,11 +21,13 @@ import android.content.Intent;
import android.content.Context;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
import android.database.SQLException;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.Parcelable;
import android.util.Log;

import java.io.IOException;
import java.util.concurrent.Callable;
@@ -364,7 +366,13 @@ public class AccountManager {
        handler = (handler == null) ? mMainHandler : handler;
        handler.post(new Runnable() {
            public void run() {
                try {
                    listener.onAccountsUpdated(accountsCopy);
                } catch (SQLException e) {
                    // Better luck next time.  If the problem was disk-full,
                    // the STORAGE_OK intent will re-trigger the update.
                    Log.e(TAG, "Can't update accounts", e);
                }
            }
        });
    }
@@ -824,6 +832,8 @@ public class AccountManager {
                // Register a broadcast receiver to monitor account changes
                IntentFilter intentFilter = new IntentFilter();
                intentFilter.addAction(Constants.LOGIN_ACCOUNTS_CHANGED_ACTION);
                // To recover from disk-full.
                intentFilter.addAction(Intent.ACTION_DEVICE_STORAGE_OK); 
                mContext.registerReceiver(mAccountsChangedBroadcastReceiver, intentFilter);
            }
        }