From 21bf85c4859bbd25242fd5f377154855a53b39cb Mon Sep 17 00:00:00 2001 From: Michael W Date: Sat, 13 Mar 2021 15:06:04 +0100 Subject: Dialer: Add a helpline phone book * Expose the sensitive numbers to the user so they can easily call one of them * Make sure to leave as few traces of access as possible: * Calling a number closes the helpline activity * Opening a link closes the helpline activity * Before opening a link, a warning about browser history appears * This makes use of a changed xml-format, which now allows adding various things: violence|human trafficking Some NGO or whatever 1234 anything else Change-Id: I952bf10ee9516b83e595d8a19450696b303393b6 --- Android.mk | 1 + .../android/dialer/app/res/values/cm_strings.xml | 4 +- .../android/dialer/helplines/AndroidManifest.xml | 36 +++ .../android/dialer/helplines/HelplineActivity.java | 245 +++++++++++++++++++++ .../android/dialer/helplines/HelplineAdapter.java | 158 +++++++++++++ .../com/android/dialer/helplines/HelplineItem.java | 40 ++++ .../dialer/helplines/LoadHelplinesTask.java | 121 ++++++++++ .../dialer/helplines/res/drawable/ic_help.xml | 26 +++ .../helplines/res/drawable/ic_helpline_call.xml | 25 +++ .../helplines/res/layout/activity_helplines.xml | 70 ++++++ .../res/layout/dialog_helpline_details.xml | 105 +++++++++ .../dialer/helplines/res/layout/item_helpline.xml | 80 +++++++ .../dialer/helplines/res/menu/menu_helplines.xml | 23 ++ .../android/dialer/helplines/res/values/dimens.xml | 20 ++ .../helplines/res/values/helpline_categories.xml | 64 ++++++ .../dialer/helplines/res/values/helpline_names.xml | 19 ++ .../dialer/helplines/res/values/strings.xml | 49 +++++ .../android/dialer/helplines/res/values/styles.xml | 39 ++++ .../dialer/helplines/utils/HelplineUtils.java | 91 ++++++++ .../dialer/helplines/utils/ResourceUtils.java | 54 +++++ .../dialer/main/impl/MainSearchController.java | 3 + .../main/impl/toolbar/res/menu/main_menu.xml | 5 + 22 files changed, 1277 insertions(+), 1 deletion(-) create mode 100644 java/com/android/dialer/helplines/AndroidManifest.xml create mode 100755 java/com/android/dialer/helplines/HelplineActivity.java create mode 100644 java/com/android/dialer/helplines/HelplineAdapter.java create mode 100644 java/com/android/dialer/helplines/HelplineItem.java create mode 100644 java/com/android/dialer/helplines/LoadHelplinesTask.java create mode 100644 java/com/android/dialer/helplines/res/drawable/ic_help.xml create mode 100644 java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml create mode 100644 java/com/android/dialer/helplines/res/layout/activity_helplines.xml create mode 100644 java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml create mode 100644 java/com/android/dialer/helplines/res/layout/item_helpline.xml create mode 100644 java/com/android/dialer/helplines/res/menu/menu_helplines.xml create mode 100644 java/com/android/dialer/helplines/res/values/dimens.xml create mode 100644 java/com/android/dialer/helplines/res/values/helpline_categories.xml create mode 100644 java/com/android/dialer/helplines/res/values/helpline_names.xml create mode 100644 java/com/android/dialer/helplines/res/values/strings.xml create mode 100755 java/com/android/dialer/helplines/res/values/styles.xml create mode 100644 java/com/android/dialer/helplines/utils/HelplineUtils.java create mode 100644 java/com/android/dialer/helplines/utils/ResourceUtils.java diff --git a/Android.mk b/Android.mk index db6cff7bd..4e92f1f38 100644 --- a/Android.mk +++ b/Android.mk @@ -133,6 +133,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ libbackup \ libphonenumber \ volley \ + org.lineageos.lib.phone LOCAL_STATIC_ANDROID_LIBRARIES := \ android-support-core-ui \ diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml index 1dcdb2b81..84d6ef735 100644 --- a/java/com/android/dialer/app/res/values/cm_strings.xml +++ b/java/com/android/dialer/app/res/values/cm_strings.xml @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/helplines/HelplineActivity.java b/java/com/android/dialer/helplines/HelplineActivity.java new file mode 100755 index 000000000..906b6fd2c --- /dev/null +++ b/java/com/android/dialer/helplines/HelplineActivity.java @@ -0,0 +1,245 @@ +/* + * Copyright (C) 2019-2021 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.dialer.helplines; + +import android.app.ActionBar; +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.Intent; +import android.content.res.Resources; +import android.content.SharedPreferences; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.telephony.SubscriptionManager; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.android.dialer.R; +import com.android.dialer.app.calllog.IntentProvider; +import com.android.dialer.helplines.utils.HelplineUtils; + +import java.util.List; + +import static android.graphics.Paint.UNDERLINE_TEXT_FLAG; + +public class HelplineActivity extends Activity { + + public static final String SHARED_PREFERENCES_KEY = "com.android.dialer.prefs"; + + private static final String KEY_FIRST_LAUNCH = "pref_first_launch"; + + private RecyclerView mRecyclerView; + private LinearLayout mLoadingView; + private LinearLayout mEmptyView; + private ProgressBar mProgressBar; + + private HelplineAdapter mAdapter; + + @Override + protected void onCreate(@Nullable Bundle savedInstance) { + super.onCreate(savedInstance); + + ActionBar actionBar = getActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } + + setContentView(R.layout.activity_helplines); + mRecyclerView = findViewById(R.id.helplines_list); + mLoadingView = findViewById(R.id.helplines_loading); + mEmptyView = findViewById(R.id.empty_view); + mProgressBar = findViewById(R.id.helplines_progress_bar); + + mAdapter = new HelplineAdapter(getResources(), mListener); + + mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + mRecyclerView.setAdapter(mAdapter); + + showUi(); + } + + @Override + protected void onPause() { + super.onPause(); + finish(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater menuInflater = getMenuInflater(); + menuInflater.inflate(R.menu.menu_helplines, menu); + return super.onCreateOptionsMenu(menu); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if (id == android.R.id.home) { + finish(); + return true; + } else if (id == R.id.menu_helpline_help) { + showHelp(true); + return true; + } + + return super.onOptionsItemSelected(item); + } + + private void showUi() { + mLoadingView.setVisibility(View.VISIBLE); + + showHelp(false); + SubscriptionManager subManager = getSystemService(SubscriptionManager.class); + new LoadHelplinesTask(getResources(), subManager, mCallback).execute(); + } + + private void showHelp(boolean forceShow) { + SharedPreferences preferenceManager = getPrefs(); + if (!forceShow && preferenceManager.getBoolean(KEY_FIRST_LAUNCH, false)) { + return; + } + + preferenceManager.edit() + .putBoolean(KEY_FIRST_LAUNCH, true) + .apply(); + + new AlertDialog.Builder(this) + .setTitle(R.string.helplines_help_title) + .setMessage(R.string.helplines_help_message) + .setPositiveButton(android.R.string.ok, null) + .setNeutralButton(R.string.helpline_button_more, (dialog, which) -> { + showMoreInfo(); }) + .show(); + } + + private void showMoreInfo() { + new AlertDialog.Builder(this) + .setMessage(R.string.helplines_help_more_message) + .setPositiveButton(android.R.string.ok, null) + .show(); + } + + public SharedPreferences getPrefs() { + return this.getSharedPreferences(SHARED_PREFERENCES_KEY, + Context.MODE_PRIVATE); + } + + private LoadHelplinesTask.Callback mCallback = new LoadHelplinesTask.Callback () { + @Override + public void onLoadListProgress(int progress) { + mProgressBar.setProgress(progress); + } + + @Override + public void onLoadCompleted(List result) { + mLoadingView.setVisibility(View.GONE); + if (result.size() == 0) { + mEmptyView.setVisibility(View.VISIBLE); + } else { + mRecyclerView.setVisibility(View.VISIBLE); + } + mAdapter.update(result); + } + }; + + private HelplineAdapter.Listener mListener = new HelplineAdapter.Listener() { + private AlertDialog mDialog; + + @Override + public void initiateCall(@NonNull String number) { + IntentProvider provider = IntentProvider.getReturnCallIntentProvider(number); + Intent intent = provider.getClickIntent(HelplineActivity.this); + // Start the call and finish this activity - we don't want to leave traces of the call + startActivity(intent); + finish(); + } + + @Override + public void onItemClicked(@NonNull HelplineItem item) { + LayoutInflater inflater = LayoutInflater.from(HelplineActivity.this); + final View dialogView = inflater.inflate(R.layout.dialog_helpline_details, null); + + fillOrHideDialogRow(item.getName(), dialogView, R.id.name_title, R.id.name); + fillOrHideDialogRow(item.get("organization"), dialogView, R.id.org_title, R.id.org); + fillOrHideDialogRow(HelplineUtils.getCategories(getResources(), item), + dialogView, R.id.categories_title, R.id.categories); + fillOrHideDialogRow(item.get("number"), dialogView, R.id.number_title, R.id.number); + fillOrHideDialogRow(item.get("website"), dialogView, R.id.website_title, R.id.website, + true); + + mDialog = new AlertDialog.Builder(HelplineActivity.this) + .setView(dialogView) + .setPositiveButton(android.R.string.ok, null) + .show(); + } + + private void fillOrHideDialogRow(String content, View dialog, int headerViewId, + int contentViewId) { + fillOrHideDialogRow(content, dialog, headerViewId, contentViewId, false); + } + + private void fillOrHideDialogRow(String content, View dialogView, int headerViewId, + int contentViewId, boolean isUrl) { + if (dialogView == null) { + return; + } + TextView headerView = dialogView.findViewById(headerViewId); + TextView contentView = dialogView.findViewById(contentViewId); + if (headerView == null || contentView == null) { + return; + } + if (TextUtils.isEmpty(content)) { + headerView.setVisibility(View.GONE); + contentView.setVisibility(View.GONE); + return; + } + + contentView.setText(content); + if (isUrl) { + contentView.setPaintFlags(contentView.getPaintFlags() | UNDERLINE_TEXT_FLAG); + // We want to warn the user that visiting a link might leave traces + contentView.setOnClickListener(v -> { + new AlertDialog.Builder(HelplineActivity.this) + .setTitle(R.string.helpline_browser_history_title) + .setMessage(R.string.helpline_browser_history_message) + .setPositiveButton(android.R.string.ok, (dlg, which) -> { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(content)); + mDialog.dismiss(); + dlg.dismiss(); + startActivity(i); + finish(); // Finish this activity to get rid of own traces + }) + .setNegativeButton(android.R.string.cancel, null) + .show(); + } + ); + } + } + }; +} diff --git a/java/com/android/dialer/helplines/HelplineAdapter.java b/java/com/android/dialer/helplines/HelplineAdapter.java new file mode 100644 index 000000000..6dd748e9b --- /dev/null +++ b/java/com/android/dialer/helplines/HelplineAdapter.java @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2019-2021 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.dialer.helplines; + +import android.content.res.Resources; +import android.support.annotation.NonNull; +import android.support.v7.util.DiffUtil; +import android.support.v7.widget.RecyclerView; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.android.dialer.R; +import com.android.dialer.helplines.utils.HelplineUtils; + +import java.util.ArrayList; +import java.util.List; + +class HelplineAdapter extends RecyclerView.Adapter { + + private Resources mResources; + private List mList = new ArrayList<>(); + private Listener mListener; + + HelplineAdapter(Resources resources, Listener listener) { + mResources = resources; + mListener = listener; + } + + public void update(List list) { + DiffUtil.DiffResult result = DiffUtil.calculateDiff(new Callback(mList, list)); + mList = list; + result.dispatchUpdatesTo(this); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int type) { + return new ViewHolder(LayoutInflater.from(parent.getContext()) + .inflate(R.layout.item_helpline, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) { + viewHolder.bind(mList.get(i)); + } + + @Override + public int getItemCount() { + return mList.size(); + } + + public interface Listener { + void initiateCall(@NonNull String number); + + void onItemClicked(@NonNull HelplineItem item); + } + + private static class Callback extends DiffUtil.Callback { + List mOldList; + List mNewList; + + public Callback(List oldList, + List newList) { + mOldList = oldList; + mNewList = newList; + } + + @Override + public int getOldListSize() { + return mOldList.size(); + } + + @Override + public int getNewListSize() { + return mNewList.size(); + } + + @Override + public boolean areItemsTheSame(int iOld, int iNew) { + String oldNumber = mOldList.get(iOld).get("number"); + String newNumber = mOldList.get(iNew).get("number"); + return oldNumber.equals(newNumber); + } + + @Override + public boolean areContentsTheSame(int iOld, int iNew) { + return false; + } + } + + class ViewHolder extends RecyclerView.ViewHolder { + private final View mItemView; + private final TextView mLabelView; + private final TextView mCategoriesView; + private final TextView mLanguageView; + private final ImageView mCallIcon; + + ViewHolder(@NonNull View itemView) { + super(itemView); + + mItemView = itemView; + mLabelView = itemView.findViewById(R.id.item_helpline_title); + mCategoriesView = itemView.findViewById(R.id.item_helpline_categories); + mLanguageView = itemView.findViewById(R.id.item_helpline_languages); + mCallIcon = itemView.findViewById(R.id.item_helpline_call_icon); + } + + void bind(HelplineItem item) { + mItemView.setOnClickListener(v -> { + mListener.onItemClicked(item); + }); + + String name = item.getName(); + if (!TextUtils.isEmpty(name)) { + mLabelView.setText(name); + } else { + mLabelView.setText(R.string.unknown_helpline_name); + } + + String categories = HelplineUtils.getCategories(mResources, item); + if (!TextUtils.isEmpty(categories)) { + mCategoriesView.setText(categories); + mCategoriesView.setVisibility(View.VISIBLE); + } + + String languages = HelplineUtils.getLanguages(mResources, item); + if (!TextUtils.isEmpty(languages)) { + mLanguageView.setVisibility(View.VISIBLE); + mLanguageView.setText(languages); + } + + String number = item.get("number"); + if (!TextUtils.isEmpty(number)) { + mCallIcon.setVisibility(View.VISIBLE); + mCallIcon.setOnClickListener(v -> { + mListener.initiateCall(number); + }); + } + } + } +} diff --git a/java/com/android/dialer/helplines/HelplineItem.java b/java/com/android/dialer/helplines/HelplineItem.java new file mode 100644 index 000000000..8ac4cc969 --- /dev/null +++ b/java/com/android/dialer/helplines/HelplineItem.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019-2021 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.dialer.helplines; + +import android.content.res.Resources; + +import com.android.dialer.helplines.utils.HelplineUtils; + +import org.lineageos.lib.phone.SensitivePhoneNumberInfo; + +public class HelplineItem { + private final SensitivePhoneNumberInfo mInfo; + private final String mName; + + public HelplineItem(Resources res, SensitivePhoneNumberInfo info, String countryIso) { + mInfo = info; + mName = HelplineUtils.getName(res, info, countryIso); + } + + public String getName() { + return mName; + } + + public String get(String key) { + return mInfo.get(key); + } +} diff --git a/java/com/android/dialer/helplines/LoadHelplinesTask.java b/java/com/android/dialer/helplines/LoadHelplinesTask.java new file mode 100644 index 000000000..7cc0a0152 --- /dev/null +++ b/java/com/android/dialer/helplines/LoadHelplinesTask.java @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2019-2021 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.dialer.helplines; + +import android.content.Context; +import android.content.res.Resources; +import android.os.AsyncTask; +import android.support.annotation.NonNull; +import android.telephony.SubscriptionInfo; +import android.telephony.SubscriptionManager; +import android.util.Log; + +import org.lineageos.lib.phone.SensitivePhoneNumberInfo; +import org.lineageos.lib.phone.SensitivePhoneNumbers; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class LoadHelplinesTask extends AsyncTask> { + + @NonNull + private final Resources mResources; + @NonNull + private final SubscriptionManager mSubManager; + @NonNull + private final Callback mCallback; + + LoadHelplinesTask(@NonNull Resources resources, @NonNull SubscriptionManager subManager, + @NonNull Callback callback) { + mResources = resources; + mSubManager = subManager; + mCallback = callback; + } + + @Override + protected List doInBackground(Void... voids) { + List helplineList = new ArrayList<>(); + /* when the network's and the user's country iso differ from each other, + * include the iso code in the name so one can be sure that the number is the correct one + * (think of accidential roaming close to the country border) */ + boolean addCountryCode = false; + + List subList = getSubscriptionInfos(); + if (subList != null) { + String localeCountryIso = + mResources.getConfiguration().locale.getCountry().toLowerCase(); + List alreadyProcessedMccs = new ArrayList<>(); + for (SubscriptionInfo subInfo : subList) { + String subCountryIso = subInfo.getCountryIso(); + if (!subCountryIso.equals(localeCountryIso)) { + addCountryCode = true; + } + + String mcc = String.valueOf(subInfo.getMcc()); + if (alreadyProcessedMccs.contains(mcc)) { + continue; + } + alreadyProcessedMccs.add(mcc); + + SensitivePhoneNumbers spn = SensitivePhoneNumbers.getInstance(); + ArrayList pns = spn.getSensitivePnInfosForMcc(mcc); + int numPns = pns.size(); + for (int i = 0; i < numPns; i++) { + SensitivePhoneNumberInfo info = pns.get(i); + helplineList.add(new HelplineItem(mResources, info, + addCountryCode ? subCountryIso : "")); + publishProgress(Math.round(i * 100 / numPns / subList.size())); + } + } + } + + Collections.sort(helplineList, (a, b) -> a.getName().compareTo(b.getName())); + + return helplineList; + } + + private List getSubscriptionInfos() { + List subList = mSubManager.getActiveSubscriptionInfoList(); + if (subList == null) { + SubscriptionInfo info = mSubManager.getActiveSubscriptionInfo( + SubscriptionManager.getDefaultVoiceSubscriptionId()); + if (info != null) { + subList = new ArrayList<>(); + subList.add(info); + } + } + return subList; + } + + @Override + protected void onProgressUpdate(Integer... values) { + if (values.length > 0) { + mCallback.onLoadListProgress(values[0]); + } + } + + @Override + protected void onPostExecute(List list) { + mCallback.onLoadCompleted(list); + } + + interface Callback { + void onLoadListProgress(int progress); + + void onLoadCompleted(List result); + } +} diff --git a/java/com/android/dialer/helplines/res/drawable/ic_help.xml b/java/com/android/dialer/helplines/res/drawable/ic_help.xml new file mode 100644 index 000000000..51a32eccf --- /dev/null +++ b/java/com/android/dialer/helplines/res/drawable/ic_help.xml @@ -0,0 +1,26 @@ + + + + diff --git a/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml b/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml new file mode 100644 index 000000000..5d67f0359 --- /dev/null +++ b/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml @@ -0,0 +1,25 @@ + + + + diff --git a/java/com/android/dialer/helplines/res/layout/activity_helplines.xml b/java/com/android/dialer/helplines/res/layout/activity_helplines.xml new file mode 100644 index 000000000..c4cac0aab --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/activity_helplines.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml b/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml new file mode 100644 index 000000000..4b283b2da --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/helplines/res/layout/item_helpline.xml b/java/com/android/dialer/helplines/res/layout/item_helpline.xml new file mode 100644 index 000000000..5160105a4 --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/item_helpline.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/helplines/res/menu/menu_helplines.xml b/java/com/android/dialer/helplines/res/menu/menu_helplines.xml new file mode 100644 index 000000000..c4f99fc61 --- /dev/null +++ b/java/com/android/dialer/helplines/res/menu/menu_helplines.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/java/com/android/dialer/helplines/res/values/dimens.xml b/java/com/android/dialer/helplines/res/values/dimens.xml new file mode 100644 index 000000000..20fec7ede --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/dimens.xml @@ -0,0 +1,20 @@ + + + + 16sp + 12sp + diff --git a/java/com/android/dialer/helplines/res/values/helpline_categories.xml b/java/com/android/dialer/helplines/res/values/helpline_categories.xml new file mode 100644 index 000000000..1e885f1f5 --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/helpline_categories.xml @@ -0,0 +1,64 @@ + + + + Abuse + Alcohol + Addiction + Adolescents + Adults + AIDS + Birth + Children + Crime + Crime Victims + Corruption + Discrimination + Domestic Violence + Drugs + Emotional Support + Family + Gambling + Gender + Generic + HIV + Human rights + Human Trafficking + Legal Aid + LGBTQ+ + Men + Mental Health + Missing children + Mothers + Muslim + Parents + Pregnancy + Psychological + Religion + Seniors + Sexual Abuse + Sexual Assault + Sexual Rights + Sexuality + Soldiers + Suicide Prevention + Transgender + Veterans + Violence + War + Women + Youth + diff --git a/java/com/android/dialer/helplines/res/values/helpline_names.xml b/java/com/android/dialer/helplines/res/values/helpline_names.xml new file mode 100644 index 000000000..5ca02acdd --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/helpline_names.xml @@ -0,0 +1,19 @@ + + + + + diff --git a/java/com/android/dialer/helplines/res/values/strings.xml b/java/com/android/dialer/helplines/res/values/strings.xml new file mode 100644 index 000000000..232ac46a8 --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/strings.xml @@ -0,0 +1,49 @@ + + + + Helplines + Loading\u2026 + No helplines found.\nInsert a sim card and try again + Help + These are safe to call + None of these numbers appear in your call history.\nYou can click any item for more information + + The list of helplines is filled with information that is updated manually by contributors. If you encounter any missing or wrong information, please feel free to contact us at www.lineageos.org + + More + + Unknown Organisation + + Name + Organization + Categories + Number + Website + Attention + Don\'t forget to clear the browser history + + + %1$s (%2$s) + + Cree + English + French + German + Inuktitut + Ojibway + Turkish + diff --git a/java/com/android/dialer/helplines/res/values/styles.xml b/java/com/android/dialer/helplines/res/values/styles.xml new file mode 100755 index 000000000..4df1e1c1d --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/styles.xml @@ -0,0 +1,39 @@ + + + + + + + + +