Merge "Pipe through featureId from caller to permission checks in telephony code"

This commit is contained in:
TreeHugger Robot
2019-11-15 18:18:02 +00:00
committed by Android (Google) Code Review
19 changed files with 375 additions and 229 deletions

View File

@@ -161,7 +161,7 @@ public class Build {
try {
Application application = ActivityThread.currentApplication();
String callingPackage = application != null ? application.getPackageName() : null;
return service.getSerialForPackage(callingPackage);
return service.getSerialForPackage(callingPackage, null);
} catch (RemoteException e) {
e.rethrowFromSystemServer();
}

View File

@@ -21,5 +21,5 @@ package android.os;
*/
interface IDeviceIdentifiersPolicyService {
String getSerial();
String getSerialForPackage(in String callingPackage);
}
String getSerialForPackage(in String callingPackage, String callingFeatureId);
}

View File

@@ -15,7 +15,6 @@
*/
package android.telephony;
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.content.Context;
@@ -23,8 +22,6 @@ import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.Annotation.ApnType;
@@ -37,19 +34,12 @@ import android.telephony.Annotation.PreciseCallStates;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SimActivationState;
import android.telephony.Annotation.SrvccState;
import android.telephony.CallQuality;
import android.telephony.CellInfo;
import android.telephony.DisconnectCause;
import android.telephony.PhoneCapability;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.telephony.ims.ImsReasonInfo;
import android.util.Log;
import com.android.internal.telephony.ITelephonyRegistry;
import com.android.internal.telephony.IOnSubscriptionsChangedListener;
import com.android.internal.telephony.ITelephonyRegistry;
import java.util.HashMap;
import java.util.List;
@@ -120,7 +110,8 @@ public class TelephonyRegistryManager {
};
mSubscriptionChangedListenerMap.put(listener, callback);
try {
sRegistry.addOnSubscriptionsChangedListener(mContext.getOpPackageName(), callback);
sRegistry.addOnSubscriptionsChangedListener(mContext.getOpPackageName(),
mContext.getFeatureId(), callback);
} catch (RemoteException ex) {
// system server crash
}
@@ -179,7 +170,7 @@ public class TelephonyRegistryManager {
mOpportunisticSubscriptionChangedListenerMap.put(listener, callback);
try {
sRegistry.addOnOpportunisticSubscriptionsChangedListener(mContext.getOpPackageName(),
callback);
mContext.getFeatureId(), callback);
} catch (RemoteException ex) {
// system server crash
}