am 63848d36: Merge "Notify modem about screen on/off states more precisely." into...
Jeff Brown [Wed, 8 Oct 2014 05:12:58 +0000 (05:12 +0000)]
* commit '63848d3691b01bb253989a5cacf4d2fa56883bb5':
  Notify modem about screen on/off states more precisely.

1  2 
src/java/com/android/internal/telephony/RIL.java

@@@ -49,9 -50,9 +50,10 @@@ import android.telephony.Rlog
  import android.telephony.SignalStrength;
  import android.telephony.SmsManager;
  import android.telephony.SmsMessage;
 +import android.telephony.SubscriptionManager;
  import android.text.TextUtils;
  import android.util.SparseArray;
+ import android.view.Display;
  
  import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
  import com.android.internal.telephony.gsm.SuppServiceNotification;
@@@ -623,15 -627,15 +630,15 @@@ public final class RIL extends BaseComm
          if (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false) {
              riljLog("Not starting RILReceiver: wifi-only");
          } else {
 -            riljLog("Starting RILReceiver");
 +            riljLog("Starting RILReceiver" + mInstanceId);
              mReceiver = new RILReceiver();
 -            mReceiverThread = new Thread(mReceiver, "RILReceiver");
 +            mReceiverThread = new Thread(mReceiver, "RILReceiver" + mInstanceId);
              mReceiverThread.start();
  
-             IntentFilter filter = new IntentFilter();
-             filter.addAction(Intent.ACTION_SCREEN_ON);
-             filter.addAction(Intent.ACTION_SCREEN_OFF);
-             context.registerReceiver(mIntentReceiver, filter);
+             DisplayManager dm = (DisplayManager)context.getSystemService(
+                     Context.DISPLAY_SERVICE);
+             mDefaultDisplay = dm.getDisplay(Display.DEFAULT_DISPLAY);
+             dm.registerDisplayListener(mDisplayListener, null);
          }
  
          TelephonyDevController tdc = TelephonyDevController.getInstance();