Merge "Revert "Revert "Remove the OEM hook implementation and usage"""
am: b686b9cf6d
Change-Id: I3a8142c55cc0e921d84d87137bb849077197b7ac
This commit is contained in:
@@ -1426,31 +1426,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyOemHookRawEventForSubscriber(int subId, byte[] rawData) {
|
|
||||||
if (!checkNotifyPermission("notifyOemHookRawEventForSubscriber")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (mRecords) {
|
|
||||||
for (Record r : mRecords) {
|
|
||||||
if (VDBG) {
|
|
||||||
log("notifyOemHookRawEventForSubscriber: r=" + r + " subId=" + subId);
|
|
||||||
}
|
|
||||||
if ((r.matchPhoneStateListenerEvent(
|
|
||||||
PhoneStateListener.LISTEN_OEM_HOOK_RAW_EVENT)) &&
|
|
||||||
((r.subId == subId) ||
|
|
||||||
(r.subId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID))) {
|
|
||||||
try {
|
|
||||||
r.callback.onOemHookRawEvent(rawData);
|
|
||||||
} catch (RemoteException ex) {
|
|
||||||
mRemoveList.add(r.binder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handleRemoveListLocked();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
|
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
|
||||||
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
|
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
|
||||||
@@ -1718,11 +1693,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
|
android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((events & PhoneStateListener.LISTEN_OEM_HOOK_RAW_EVENT) != 0) {
|
|
||||||
mContext.enforceCallingOrSelfPermission(
|
|
||||||
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,16 +204,6 @@ public class PhoneStateListener {
|
|||||||
*/
|
*/
|
||||||
public static final int LISTEN_VOLTE_STATE = 0x00004000;
|
public static final int LISTEN_VOLTE_STATE = 0x00004000;
|
||||||
|
|
||||||
/**
|
|
||||||
* Listen for OEM hook raw event
|
|
||||||
*
|
|
||||||
* @see #onOemHookRawEvent
|
|
||||||
* @hide
|
|
||||||
* @deprecated OEM needs a vendor-extension hal and their apps should use that instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static final int LISTEN_OEM_HOOK_RAW_EVENT = 0x00008000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen for carrier network changes indicated by a carrier app.
|
* Listen for carrier network changes indicated by a carrier app.
|
||||||
*
|
*
|
||||||
@@ -378,9 +368,6 @@ public class PhoneStateListener {
|
|||||||
case LISTEN_USER_MOBILE_DATA_STATE:
|
case LISTEN_USER_MOBILE_DATA_STATE:
|
||||||
PhoneStateListener.this.onUserMobileDataStateChanged((boolean)msg.obj);
|
PhoneStateListener.this.onUserMobileDataStateChanged((boolean)msg.obj);
|
||||||
break;
|
break;
|
||||||
case LISTEN_OEM_HOOK_RAW_EVENT:
|
|
||||||
PhoneStateListener.this.onOemHookRawEvent((byte[])msg.obj);
|
|
||||||
break;
|
|
||||||
case LISTEN_CARRIER_NETWORK_CHANGE:
|
case LISTEN_CARRIER_NETWORK_CHANGE:
|
||||||
PhoneStateListener.this.onCarrierNetworkChange((boolean)msg.obj);
|
PhoneStateListener.this.onCarrierNetworkChange((boolean)msg.obj);
|
||||||
break;
|
break;
|
||||||
@@ -600,16 +587,6 @@ public class PhoneStateListener {
|
|||||||
// default implementation empty
|
// default implementation empty
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback invoked when OEM hook raw event is received. Requires
|
|
||||||
* the READ_PRIVILEGED_PHONE_STATE permission.
|
|
||||||
* @param rawData is the byte array of the OEM hook raw data.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void onOemHookRawEvent(byte[] rawData) {
|
|
||||||
// default implementation empty
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback invoked when telephony has received notice from a carrier
|
* Callback invoked when telephony has received notice from a carrier
|
||||||
* app that a network action that could result in connectivity loss
|
* app that a network action that could result in connectivity loss
|
||||||
@@ -726,10 +703,6 @@ public class PhoneStateListener {
|
|||||||
send(LISTEN_USER_MOBILE_DATA_STATE, 0, 0, enabled);
|
send(LISTEN_USER_MOBILE_DATA_STATE, 0, 0, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOemHookRawEvent(byte[] rawData) {
|
|
||||||
send(LISTEN_OEM_HOOK_RAW_EVENT, 0, 0, rawData);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCarrierNetworkChange(boolean active) {
|
public void onCarrierNetworkChange(boolean active) {
|
||||||
send(LISTEN_CARRIER_NETWORK_CHANGE, 0, 0, active);
|
send(LISTEN_CARRIER_NETWORK_CHANGE, 0, 0, active);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6424,29 +6424,6 @@ public class TelephonyManager {
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result and response from RIL for oem request
|
|
||||||
*
|
|
||||||
* @param oemReq the data is sent to ril.
|
|
||||||
* @param oemResp the respose data from RIL.
|
|
||||||
* @return negative value request was not handled or get error
|
|
||||||
* 0 request was handled succesfully, but no response data
|
|
||||||
* positive value success, data length of response
|
|
||||||
* @hide
|
|
||||||
* @deprecated OEM needs a vendor-extension hal and their apps should use that instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public int invokeOemRilRequestRaw(byte[] oemReq, byte[] oemResp) {
|
|
||||||
try {
|
|
||||||
ITelephony telephony = getITelephony();
|
|
||||||
if (telephony != null)
|
|
||||||
return telephony.invokeOemRilRequestRaw(oemReq, oemResp);
|
|
||||||
} catch (RemoteException ex) {
|
|
||||||
} catch (NullPointerException ex) {
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
|
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ oneway interface IPhoneStateListener {
|
|||||||
void onVoLteServiceStateChanged(in VoLteServiceState lteState);
|
void onVoLteServiceStateChanged(in VoLteServiceState lteState);
|
||||||
void onVoiceActivationStateChanged(int activationState);
|
void onVoiceActivationStateChanged(int activationState);
|
||||||
void onDataActivationStateChanged(int activationState);
|
void onDataActivationStateChanged(int activationState);
|
||||||
void onOemHookRawEvent(in byte[] rawData);
|
|
||||||
void onCarrierNetworkChange(in boolean active);
|
void onCarrierNetworkChange(in boolean active);
|
||||||
void onUserMobileDataStateChanged(in boolean enabled);
|
void onUserMobileDataStateChanged(in boolean enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1054,17 +1054,6 @@ interface ITelephony {
|
|||||||
in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
|
in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
|
||||||
in List<String> cdmaNonRoamingList);
|
in List<String> cdmaNonRoamingList);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result and response from RIL for oem request
|
|
||||||
*
|
|
||||||
* @param oemReq the data is sent to ril.
|
|
||||||
* @param oemResp the respose data from RIL.
|
|
||||||
* @return negative value request was not handled or get error
|
|
||||||
* 0 request was handled succesfully, but no response data
|
|
||||||
* positive value success, data length of response
|
|
||||||
*/
|
|
||||||
int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if any mobile Radios need to be shutdown.
|
* Check if any mobile Radios need to be shutdown.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ interface ITelephonyRegistry {
|
|||||||
void notifyVoLteServiceStateChanged(in VoLteServiceState lteState);
|
void notifyVoLteServiceStateChanged(in VoLteServiceState lteState);
|
||||||
void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId,
|
void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId,
|
||||||
int activationState, int activationType);
|
int activationState, int activationType);
|
||||||
void notifyOemHookRawEventForSubscriber(in int subId, in byte[] rawData);
|
|
||||||
void notifySubscriptionInfoChanged();
|
void notifySubscriptionInfoChanged();
|
||||||
void notifyCarrierNetworkChange(in boolean active);
|
void notifyCarrierNetworkChange(in boolean active);
|
||||||
void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
|
void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
|
||||||
|
|||||||
Reference in New Issue
Block a user