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

Commit 800a988b authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Update usage of ActivityManagerNative.

Bug: 30977067
Test: N/A
Change-Id: I5a3934355e0a4bc47490c16b0dac3979c55d8d16
parent 6630bde5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.internal.telephony;

import android.app.ActivityManagerNative;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
@@ -630,7 +630,7 @@ public class GsmCdmaPhone extends Phone {
        Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
        if (DBG) logd("sendEmergencyCallbackModeChange");
    }

@@ -640,7 +640,7 @@ public class GsmCdmaPhone extends Phone {
            Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALL_STATE_CHANGED);
            intent.putExtra(PhoneConstants.PHONE_IN_EMERGENCY_CALL, callActive);
            SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
            ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
            ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
            if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallStateChange: callActive " + callActive);
        }
    }
@@ -3108,7 +3108,7 @@ public class GsmCdmaPhone extends Phone {
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        intent.putExtra(PhoneConstants.PHONE_NAME_KEY, getPhoneName());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, mPhoneId);
        ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
    }

    private void switchVoiceRadioTech(int newVoiceRadioTech) {
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import static android.service.carrier.CarrierMessagingService.RECEIVE_OPTIONS_SK
import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;

import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.app.BroadcastOptions;
import android.app.Notification;
@@ -1025,7 +1025,7 @@ public abstract class InboundSmsHandler extends StateMachine {
            // Get a list of currently started users.
            int[] users = null;
            try {
                users = ActivityManagerNative.getDefault().getRunningUserIds();
                users = ActivityManager.getService().getRunningUserIds();
            } catch (RemoteException re) {
            }
            if (users == null) {
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.internal.telephony;

import android.app.ActivityManagerNative;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.content.Context;
import android.content.res.Configuration;
@@ -211,7 +211,7 @@ public final class MccTable {

                    if (updateConfig) {
                        Slog.d(LOG_TAG, "updateMccMncConfiguration updateConfig config=" + config);
                        ActivityManagerNative.getDefault().updateConfiguration(config);
                        ActivityManager.getService().updateConfiguration(config);
                    } else {
                        Slog.d(LOG_TAG, "updateMccMncConfiguration nothing to update");
                    }
+5 −6
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.internal.telephony;

import android.app.ActivityManagerNative;
import android.app.ActivityManager;
import android.app.UserSwitchObserver;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
@@ -140,7 +140,7 @@ public class SubscriptionInfoUpdater extends Handler {
        // -Whenever we switch to a new user
        mCurrentlyActiveUserId = 0;
        try {
            ActivityManagerNative.getDefault().registerUserSwitchObserver(new UserSwitchObserver() {
            ActivityManager.getService().registerUserSwitchObserver(new UserSwitchObserver() {
                @Override
                public void onUserSwitching(int newUserId, IRemoteCallback reply)
                        throws RemoteException {
@@ -157,7 +157,7 @@ public class SubscriptionInfoUpdater extends Handler {
                    }
                }
            }, LOG_TAG);
            mCurrentlyActiveUserId = ActivityManagerNative.getDefault().getCurrentUser().id;
            mCurrentlyActiveUserId = ActivityManager.getService().getCurrentUser().id;
        } catch (RemoteException e) {
            logd("Couldn't get current user ID; guessing it's 0: " + e.getMessage());
        }
@@ -182,8 +182,7 @@ public class SubscriptionInfoUpdater extends Handler {
                    iterator.remove();
                    logd("Broadcasting intent ACTION_SIM_STATE_CHANGED for mCardIndex: " +
                            pair.getKey());
                    ActivityManagerNative.broadcastStickyIntent(i, READ_PHONE_STATE,
                            UserHandle.USER_ALL);
                    ActivityManager.broadcastStickyIntent(i, UserHandle.USER_ALL);
                }
                logd("[Receiver]-");
                return;
@@ -671,7 +670,7 @@ public class SubscriptionInfoUpdater extends Handler {
        SubscriptionManager.putPhoneIdAndSubIdExtra(i, slotId);
        logd("Broadcasting intent ACTION_SIM_STATE_CHANGED " + state + " reason " + reason +
             " for mCardIndex: " + slotId);
        ActivityManagerNative.broadcastStickyIntent(i, READ_PHONE_STATE, UserHandle.USER_ALL);
        ActivityManager.broadcastStickyIntent(i, UserHandle.USER_ALL);
        rebroadcastIntentsOnUnlock.put(slotId, i);
    }

+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.internal.telephony.imsphone;

import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -1332,7 +1332,7 @@ public class ImsPhone extends ImsPhoneBase {
        Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
        if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange");
    }

Loading