@Override public void setMenuItem(MenuItem blockVoiceCallmenu, boolean mOptionsMenuOptions, String commd) { if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { return; } Log.i(TAG, "[setMenuItem]"); blockVoiceCallmenu.setVisible(false); }
@Override public String getReplaceString(final String src, String commd) { if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { return null; } Log.i(TAG, "AbstractStartSIMService: [getReplaceString()]"); return src.replace(PhoneNumberUtils.PAUSE, 'p').replace(PhoneNumberUtils.WAIT, 'w'); }
@Override public int getMultiChoiceLimitCount(String commd) { if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { Log.i(TAG, "[getMultiChoiceLimitCount] commd: " + commd); return 1000; } Log.i(TAG, "[getMultiChoiceLimitCount]"); return 5000; }
@Override public void setLookSimStorageMenuVisible( MenuItem lookSimStorageMenu, boolean flag, String commd) { if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { return; } Log.i(TAG, "PeopleActivity: [setLookSimStorageMenuVisible()]"); if (flag) { lookSimStorageMenu.setVisible(true); } else { lookSimStorageMenu.setVisible(false); } }
@Override public void registerHostContext(Context context, Bundle args, String commd) { if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { return; } mContextHost = context; try { mContext = context.createPackageContext( "com.mediatek.op01.plugin", Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY); } catch (NameNotFoundException e) { Log.d(TAG, "no com.mediatek.op01.plugin packages"); } }
@Override public void addOptionsMenu(Menu menu, Bundle args, String commd) { Log.i(TAG, "addOptionsMenu"); if (!ContactPluginDefault.COMMD_FOR_OP01.equals(commd)) { return; } MenuItem item = menu.findItem(MENU_SIM_STORAGE); List<SimInfoRecord> simInfos = SimInfoManager.getInsertedSimInfoList(mContext); if (item == null && simInfos != null && simInfos.size() > 0) { String string = mContext.getResources().getString(R.string.look_simstorage); menu.add(0, MENU_SIM_STORAGE, 0, string) .setOnMenuItemClickListener( new MenuItem.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { ShowSimCardStorageInfoTask.showSimCardStorageInfo(mContext); return true; } }); } }