OSDN Git Service

Fix calling package for app ops
authorSvet Ganov <svetoslavganov@google.com>
Sat, 18 Apr 2015 19:03:44 +0000 (12:03 -0700)
committerSvet Ganov <svetoslavganov@google.com>
Sat, 18 Apr 2015 19:14:07 +0000 (12:14 -0700)
Change-Id: Ie867262e74d0b09e16193cb575b1c1cf942c83cb

telephony/java/android/telephony/TelephonyManager.java

index 81f329c..7c68de2 100644 (file)
@@ -2571,10 +2571,11 @@ public class TelephonyManager {
      *               LISTEN_ flags.
      */
     public void listen(PhoneStateListener listener, int events) {
-        String pkgForDebug = mContext != null ? mContext.getPackageName() : "<unknown>";
+        if (mContext == null) return;
         try {
             Boolean notifyNow = (getITelephony() != null);
-            sRegistry.listenForSubscriber(listener.mSubId, pkgForDebug, listener.callback, events, notifyNow);
+            sRegistry.listenForSubscriber(listener.mSubId, mContext.getOpPackageName(),
+                    listener.callback, events, notifyNow);
         } catch (RemoteException ex) {
             // system process dead
         } catch (NullPointerException ex) {