您的位置:首页 > 教育 > 锐评 > 平面设计好学吗?没有基础_产品设计需要学的软件_如何把一个关键词优化到首页_百度如何收录网站

平面设计好学吗?没有基础_产品设计需要学的软件_如何把一个关键词优化到首页_百度如何收录网站

2025/4/29 9:16:56 来源:https://blog.csdn.net/oh_my_god/article/details/147501120  浏览:    关键词:平面设计好学吗?没有基础_产品设计需要学的软件_如何把一个关键词优化到首页_百度如何收录网站
平面设计好学吗?没有基础_产品设计需要学的软件_如何把一个关键词优化到首页_百度如何收录网站

1、在/frameworks/base/core/java/android/os下创建一个AIDL文件,比如IDeviceMgr.aidl

package android.os;
interface IDeviceMgr {int createApn(String apn);boolean deleteApn(int apnId);
}

编译系统,生成AIDL对应的JAVA文件。

2、在//frameworks/base/services/core/java/com/android/server创建包名devicemgr,并创建DeviceMgr,继承IDeviceMgr 

package com.android.server.devicemgr;
import android.content.Context;
import android.os.IDeviceMgr;
import android.os.RemoteException;
public class DeviceMgr extends IDeviceMgr.Stub {private Context mContext;public DeviceMgr (Context context){this.mContext=context;}@Overridepublic int createApn(String apnInfo) throws RemoteException {return 0;}@Overridepublic boolean deleteApn(int apnId) throws RemoteException {return false;}
}

编译,然后,然后就出错了:

Your API changes are triggering API Lint warnings or errors.
To make these errors go away, fix the code according to the
error and/or warning messages above.If it is not possible to do so, there are workarounds:1. You can suppress the errors with @SuppressLint("<id>")where the <id> is given in brackets in the error message above.
2. You can update the baseline by executing the followingcommand:(cd $ANDROID_BUILD_TOP && cp \"out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt" \"frameworks/base/services/api/lint-baseline.txt")To submit the revised baseline.txt to the main Androidrepository, you will need approval.
************************************************************

服务需要APP可以调用,选择方式2,执行:

cp out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt  frameworks/base/services/api/lint-baseline.txt

编译后继续出错:

******************************
You have tried to change the API from what has been previously approved.To make these errors go away, you have two choices:1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)to the new methods, etc. shown in the above diff.2. You can update current.txt and/or removed.txt by executing the following command:m api-stubs-docs-non-updatable-update-current-apiTo submit the revised current.txt to the main Android repository,you will need approval.
******************************

选择方法2,lunch相应product,执行:

m api-stubs-docs-non-updatable-update-current-api

这次不报错了

3、打开/frameworks/base/core/java/android/content/Context.java,添加一行对应的服务名称:

 public static final String DEVICEMGR_SERVICE = "devicemgr";

这是APP调用getSystemService对应的服务名称

4、打开/frameworks/base/services/java/com/android/server/SystemServer.java,在中间加上一行代码:

private void startOtherServices(@NonNull TimingsTraceAndSlog t) {.....................................ServiceManager.addService(Context.DEVICEMGR_SERVICE, new DeviceMgr(mSystemContext));.....................................
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com