Remove usage of Telephonymanager getDefault() and from() hidden APIs

This CL changes to use getSystemService(TelephonyManager.class)

Bug: 140768340
Test: Build
Change-Id: I0502ea03441ffda79199d5085f9e00a15d975944
This commit is contained in:
Jayachandran C
2019-11-15 16:21:59 -08:00
committed by Jayachandran Chinnakkannu
parent 8e999f22b8
commit 40472f1e77
2 changed files with 2 additions and 2 deletions

View File

@@ -445,7 +445,7 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_RADIO) != 0) {
// We were asked to fetch Telephony data.
if (mTelephony == null) {
mTelephony = TelephonyManager.from(mContext);
mTelephony = mContext.getSystemService(TelephonyManager.class);
}
if (mTelephony != null) {

View File

@@ -731,7 +731,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
public void notePhoneState(int state) {
enforceCallingPermission();
int simState = TelephonyManager.getDefault().getSimState();
int simState = mContext.getSystemService(TelephonyManager.class).getSimState();
synchronized (mStats) {
mStats.notePhoneStateLocked(state, simState);
}