Uri uri = Uri.parse(code); if (uri.getQueryParameterNames().contains("bundle")) { WXEnvironment.sDynamicMode = uri.getBooleanQueryParameter("debug", false); WXEnvironment.sDynamicUrl = uri.getQueryParameter("bundle"); String tip = WXEnvironment.sDynamicMode ? "Has switched to Dynamic Mode" : "Has switched to Normal Mode";
public static boolean isManageMode(Uri uri) { return uri.getBooleanQueryParameter(PARAM_MANAGE, false); }
public static String[] getPhoneLookupProjection(Uri phoneLookupUri) { if (CompatUtils.isNCompatible()) { return PHONE_LOOKUP_PROJECTION; } // Pre-N boolean isSip = phoneLookupUri.getBooleanQueryParameter( ContactsContract.PhoneLookup.QUERY_PARAMETER_SIP_ADDRESS, false); return (isSip) ? PHONE_LOOKUP_PROJECTION : BACKWARD_COMPATIBLE_NON_SIP_PHONE_LOOKUP_PROJECTION; }
/** * @return the column name that stores contact id for phone lookup query. */ public static String getContactIdColumnNameForUri(Uri phoneLookupUri) { if (CompatUtils.isNCompatible()) { return PhoneLookupSdkCompat.CONTACT_ID; } // In pre-N, contact id is stored in {@link PhoneLookup#_ID} in non-sip query. boolean isSip = phoneLookupUri.getBooleanQueryParameter( ContactsContract.PhoneLookup.QUERY_PARAMETER_SIP_ADDRESS, false); return (isSip) ? PhoneLookupSdkCompat.CONTACT_ID : ContactsContract.PhoneLookup._ID; }
@Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_z_xing_scan, container, false); zXingView = root.findViewById(R.id.z_xing_view); ivFlashLight = root.findViewById(R.id.iv_flash_light); zXingView.setDelegate(this); ivFlashLight.setOnClickListener(this); Uri uri = getActivity().getIntent().getData(); assert uri != null; boolean showFlashLight = uri.getBooleanQueryParameter(SHOW_FLASH_LIGHT, false) && zXingView.isFlashLightAvailable(); ivFlashLight.setVisibility(showFlashLight ? View.VISIBLE : View.GONE); return root; }
private void handleDecodeInternally(String code) { if (!TextUtils.isEmpty(code)) { Uri uri = Uri.parse(code); if (uri.getQueryParameterNames().contains("bundle")) { WXEnvironment.sDynamicMode = uri.getBooleanQueryParameter("debug", false); WXEnvironment.sDynamicUrl = uri.getQueryParameter("bundle"); String tip = WXEnvironment.sDynamicMode ? "Has switched to Dynamic Mode" : "Has switched to Normal Mode"; Toast.makeText(this, tip, Toast.LENGTH_SHORT).show(); finish(); return; } else if (uri.getQueryParameterNames().contains("_wx_devtool")) { WXEnvironment.sRemoteDebugProxyUrl = uri.getQueryParameter("_wx_devtool"); WXEnvironment.sDebugServerConnectable = true; WXSDKEngine.reload(); Toast.makeText(this, "devtool", Toast.LENGTH_SHORT).show(); return; } else if (code.contains("_wx_debug")) { uri = Uri.parse(code); String debug_url = uri.getQueryParameter("_wx_debug"); WXSDKEngine.switchDebugModel(true, debug_url); finish(); } else { Toast.makeText(this, code, Toast.LENGTH_SHORT).show(); Intent intent = new Intent(Constants.ACTION_OPEN_URL); intent.setPackage(getPackageName()); intent.setData(Uri.parse(code)); startActivity(intent); } } }
private void handleDecodeInternally(String code) { if (!TextUtils.isEmpty(code)) { Uri uri = Uri.parse(code); if (uri.getQueryParameterNames().contains("bundle")) { WXEnvironment.sDynamicMode = uri.getBooleanQueryParameter("debug", false); WXEnvironment.sDynamicUrl = uri.getQueryParameter("bundle"); String tip = WXEnvironment.sDynamicMode ? "Has switched to Dynamic Mode" : "Has switched to Normal Mode"; Toast.makeText(this, tip, Toast.LENGTH_SHORT).show(); finish(); return; } else if (uri.getQueryParameterNames().contains("_wx_devtool")) { WXEnvironment.sRemoteDebugProxyUrl = uri.getQueryParameter("_wx_devtool"); WXEnvironment.sDebugServerConnectable = true; WXSDKEngine.reload(); Toast.makeText(this, "devtool", Toast.LENGTH_SHORT).show(); return; } else if (code.contains("_wx_debug")) { uri = Uri.parse(code); String debug_url = uri.getQueryParameter("_wx_debug"); WXSDKEngine.switchDebugModel(true, debug_url); finish(); } else { Toast.makeText(this, code, Toast.LENGTH_SHORT).show(); Intent intent = new Intent(Constants.ACTION_OPEN_URL); intent.setPackage(getPackageName()); intent.setData(Uri.parse(code)); startActivity(intent); } } }
@Override public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) { // Get deep link from result (may be null if no link is found) Uri deepLink = null; if (pendingDynamicLinkData != null) { deepLink = pendingDynamicLinkData.getLink(); } // // If the user isn't signed in and the pending Dynamic Link is // an invitation, sign in the user anonymously, and record the // referrer's UID. // FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user == null && deepLink != null && deepLink.getBooleanQueryParameter("invitedby", false)) { String referrerUid = deepLink.getQueryParameter("invitedby"); createAnonymousAccountWithReferrerInfo(referrerUid); } } });
final int typeInt = getDataUsageFeedbackType(usageType, USAGE_TYPE_ALL); setTablesAndProjectionMapForData(qb, uri, projection, false, typeInt); if (uri.getBooleanQueryParameter(Data.VISIBLE_CONTACTS_ONLY, false)) { qb.appendWhere(" AND " + Data.CONTACT_ID + " in " + Tables.DEFAULT_DIRECTORY);