微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > java.lang.SecurityException:The calling process has already registered an ID...

java.lang.SecurityException:The calling process has already registered an ID...

时间:10-02 整理:3721RD 点击:

[DESCRIPTION]

java.lang.SecurityException: The calling process has already registered an
IDisplayManagerCallbac这种类型的exception应该如何进一步debug?

[SOLUTION]

如果要继续分析这个重复注册Display Manager Callback的问题,需要再增加一些log,如下:
1,DisplayManagerGlobal.java
private void registerCallbackIfNeededLocked() {
if (mCallback == null) {
mCallback = new DisplayManagerCallback();
Log.i(TAG,"mCallback == null,new DisplayManagerCallback"); //mtk added
try {
mDm.registerCallback(mCallback);
} catch (RemoteException ex) {
Log.e(TAG, "Failed to register callback with display manager service.", ex);
mCallback = null;
Log.i(TAG,"catch exception,set mCallback == null"); //mtk added
}
}
}
2,DisplayManagerService.java
@Override // Binder call
public void registerCallback(IDisplayManagerCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("listener must not be null");
}
final int callingPid = Binder.getCallingPid();
final long token = Binder.clearCallingIdentity();
try {
Slog.i(TAG,"registerCallbackInternal,callingPid= "+callingPid); //mtk added
registerCallbackInternal(callback, callingPid);
} finally {
Binder.restoreCallingIdentity(token);
}
}
private void registerCallbackInternal(IDisplayManagerCallback callback, int callingPid)
{
synchronized (mSyncroot) {
if (mCallbacks.get(callingPid) != null) {
throw new SecurityException("The calling process has already "
+ "registered an IDisplayManagerCallback.");
}
CallbackRecord record = new CallbackRecord(callingPid, callback);
try {
IBinder binder = callback.asBinder();
binder.linkToDeath(record, 0);
} catch (RemoteException ex) {
// give up
Slog.i(TAG,"registerCallbackInternal,catch remote exception"); //mtk added
throw new RuntimeException(ex);
}
Slog.i(TAG,"mCallbacks put,callingPid = "+callingPid); //mtk added
mCallbacks.put(callingPid, record);
}
}
然后,在手机端把mtklog全部清掉,然后,重启mtklogger,重新关机,再开机,并操作抓取复现问
题的mtklog(包含关机、开机、一直到复现问题的log),并把全部log发送给我们。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top