Files
Michael W 33a84aa20e 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:
<item>
    <categories>violence|human trafficking</categories>
    <name>Some NGO or whatever</name>
    <number>1234</number>
    <anything>anything else</anything>
</item>

Includes:

Author: Luca Stefani <[email protected]>
Date:   Sat Mar 13 17:37:29 2021 +0100

    Dialer: Move to SPN schema classes

    Change-Id: I2cd3706f64bf45a2a6dd53caa9d5da48cf93ea28

Author: Michael W <[email protected]>
Date:   Sat May 22 16:38:57 2021 +0200

    Dialer: Helplines: Add Bullying and Immigration categories

    Change-Id: I7969fd0dd610a4f041f55ce04e6ede5c66005dee

Author: Luca Stefani <[email protected]>
Date:   Fri Mar 26 14:20:33 2021 +0100

    Dialer: Helplines: Use a webview dialog

    * Instead of relying on one browser we can actually display a webview
      ourselves
    * Set various headers to clear cache and to not track
    * Displays a progressbar and loading text while the page loads

    Co-authored-by: Michael W <[email protected]>
    Change-Id: Ibad2832c0cb6bcef79b5f348c40ca76c2516b295

Author: Michael W <[email protected]>
Date:   Fri May 28 19:08:24 2021 +0200

    Dialer: Helplines: Fix a few casing issues

    Change-Id: I31c2423aee5310ae08c9295971fbe7aced1f8f9b

Change-Id: I952bf10ee9516b83e595d8a19450696b303393b6
2023-10-08 19:10:45 +03:00

46 lines
1.4 KiB
Java

/*
* 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.spn.Item;
/* When loading all the items we modify the name based on the subscription.
* Using the setter would modify it permanently, resulting in modifications on each load.
* Therefore we don't use Item directly but use this little helper class so the modified
* name can be stored
*/
public class HelplineItem {
private final Item mItem;
private final String mName;
public HelplineItem(Resources res, Item item, String countryIso) {
mItem = item;
mName = HelplineUtils.getName(res, item, countryIso);
}
public Item getItem() {
return mItem;
}
public String getName() {
return mName;
}
}