am e391e713: Merge "Disabled SIM notifications while provisioning." into lmp-mr1-dev automerge: 209c946 automerge: 13028d1

* commit 'e391e713cb34648ad6fc9d3f7336c574acc4787c':
  Disabled SIM notifications while provisioning.
This commit is contained in:
PauloftheWest
2014-12-11 18:07:34 +00:00
committed by Android Git Automerger

View File

@@ -27,6 +27,7 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor; import android.content.SharedPreferences.Editor;
import android.content.res.Resources; import android.content.res.Resources;
import android.provider.Settings;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager;
@@ -62,12 +63,14 @@ public class SimBootReceiver extends BroadcastReceiver {
private void detectChangeAndNotify() { private void detectChangeAndNotify() {
final int numSlots = mTelephonyManager.getSimCount(); final int numSlots = mTelephonyManager.getSimCount();
final boolean isInProvisioning = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) == 0;
boolean notificationSent = false; boolean notificationSent = false;
int numSIMsDetected = 0; int numSIMsDetected = 0;
int lastSIMSlotDetected = -1; int lastSIMSlotDetected = -1;
// Do not create notifications on single SIM devices. // Do not create notifications on single SIM devices or when provisiong.
if (numSlots < 2) { if (numSlots < 2 || isInProvisioning) {
return; return;
} }