Merge "Remove usage of Telephonymanager getDefault() and from() hidden APIs"
am: 1dc2a0d77b
Change-Id: I9cb30ad45ec6f013a0944a923c3cc950a2d319fe
This commit is contained in:
committed by
android-build-merger
commit
7798357a86
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user