做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

如何給Service添加accesspermission

來源:懂視網 責編:小采 時間:2020-11-09 07:18:57
文檔

如何給Service添加accesspermission

如何給Service添加accesspermission://首先定義Service的接口,IMyService.aidl package com.xxxx; import android.os.IBinder; import android.os.ParcelFileDescriptor; interface IMyService { void doService(int id); } //實現servi
推薦度:
導讀如何給Service添加accesspermission://首先定義Service的接口,IMyService.aidl package com.xxxx; import android.os.IBinder; import android.os.ParcelFileDescriptor; interface IMyService { void doService(int id); } //實現servi

//首先定義Service的接口,IMyService.aidl package com.xxxx; import android.os.IBinder; import android.os.ParcelFileDescriptor; interface IMyService { void doService(int id); } //實現service類,MyService.java public class MyService extends IM

//首先定義Service的接口,IMyService.aidl
package com.xxxx;

import android.os.IBinder;
import android.os.ParcelFileDescriptor;

interface IMyService {
void doService(int id);
}
//實現service類,MyService.java
public class MyService extends IMyService.Stub {
public static final String MY_SERVICE = "myservice";
private static MyService sService = null;
static String PERMISSION = "com.xxxx.permission.ACCESS_MYSERVICE";

/*
* The entry called by system server to create service.
*/
public static MyService main(Context context) {
if (sService != null) {
return sService;
}
sService = new MyService(context);
try {
Slog.d(TAG, "created service");
ServiceManager.addService(MY_SERVICE, sService);
Slog.d(TAG, "added service " + MY_SERVICE);
} catch (Throwable e) {
Slog.e(TAG, "Failure starting MyService", e);
}
return sService;
}

private MyService(Context context) {
mContext = context;
}

/*
* Called from Client App to retrieve interface
*/
public static IMyService getService() {
IBinder b = ServiceManager.getService(MY_SERVICE);
if ( b == null) {
return null;
}
return IMyService.Stub.asInterface(b);
}

@Override

public long openSession(IBinder clientToken, int sensorType) throws RemoteException {

//添加訪問權限

if (mContext.checkCallingPermission(PERMISSION) != PackageManager.PERMISSION_GRANTED) {
throw new RemoteException("Permission not granted for MyService");
}
//做實際的工作

}

}

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

如何給Service添加accesspermission

如何給Service添加accesspermission://首先定義Service的接口,IMyService.aidl package com.xxxx; import android.os.IBinder; import android.os.ParcelFileDescriptor; interface IMyService { void doService(int id); } //實現servi
推薦度:
標簽: 添加 如何 服務
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 探索| 蓝山县| 岳阳市| 湟源县| 霍邱县| 洪洞县| 南召县| 洪雅县| 白银市| 东港市| 沭阳县| 于都县| 乡城县| 红安县| 吉水县| 河曲县| 任丘市| 兴宁市| 双峰县| 西昌市| 津市市| 宁都县| 马边| 阳西县| 辽阳市| 定结县| 纳雍县| 丽水市| 托里县| 甘洛县| 锡林郭勒盟| 临邑县| 曲周县| 桐梓县| 枣阳市| 东乌| 四会市| 潞城市| 中江县| 固安县| 封丘县|