Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 384d5b94 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-9ff446ef-fe26-4f50-a0f0-c1d38619140f-for-git_oc-mr1-release-42...

release-request-9ff446ef-fe26-4f50-a0f0-c1d38619140f-for-git_oc-mr1-release-4257899 snap-temp-L58400000090817127

Change-Id: I06e6c29cda8038b414420d28335ebb932e15617b
parents 3abcdc3c 9e47d2c2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1953,6 +1953,8 @@
    <string name="wifi_failed_connect_message">Failed to connect to network</string>
    <!-- Button label to delete a Wi-Fi network -->
    <string name="wifi_forget">Forget</string>
    <!-- Button label to modify a Wi-Fi network -->
    <string name="wifi_modify">Modify</string>
    <!-- Failured notification for forget -->
    <string name="wifi_failed_forget_message">Failed to forget network</string>
    <!-- Button label to save a Wi-Fi network configuration -->
@@ -6833,6 +6835,10 @@
    <!-- [CHAR LIMIT=100] Notification Importance: high importance level description -->
    <string name="notification_importance_high">Make sound and pop on screen</string>
    <!-- [CHAR LIMIT=100] Notification Importance: high importance level description,
     when the user has picked high importance but disabled sound for it -->
    <string name="notification_importance_high_silent">Pop on screen</string>
    <!-- Importance title strings for the Importance page. Also the first part of the importance
     summary on the channel page-->
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
        android:key="sms_mirroring"
        android:title="@string/sms_mirroring_pref"
        android:icon="@drawable/ic_compare_arrows_24dp"
        android:summary="@string/summary_placeholder"
        android:order="-3"/>

    <Preference
+1 −26
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.pm.PackageManager;
import android.provider.Settings.Secure;
import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import android.text.format.DateUtils;
import android.util.Log;

import com.android.internal.logging.nano.MetricsProto;
@@ -55,12 +54,6 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider

    private static final String SHARED_PREF_FILENAME = "suggestions";

    // Suggestion category name and expiration threshold for first impression type. Needs to keep
    // in sync with suggestion_ordering.xml
    private static final String CATEGORY_FIRST_IMPRESSION =
            "com.android.settings.suggested.category.FIRST_IMPRESSION";
    private static final long FIRST_IMPRESSION_EXPIRE_DAY_IN_MILLIS = 14 * DateUtils.DAY_IN_MILLIS;

    private final SuggestionRanker mSuggestionRanker;
    private final MetricsFeatureProvider mMetricsFeatureProvider;

@@ -141,12 +134,7 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
                context, MetricsProto.MetricsEvent.ACTION_SETTINGS_DISMISS_SUGGESTION,
                getSuggestionIdentifier(context, suggestion));

        boolean isSmartSuggestionEnabled = isSmartSuggestionEnabled(context);
        if (isSmartSuggestionEnabled) {
            // Disable smart suggestion if we are still showing first impression suggestions.
            isSmartSuggestionEnabled = !isShowingFirstImpressionSuggestion(context);
        }
        if (!parser.dismissSuggestion(suggestion, isSmartSuggestionEnabled)) {
        if (!parser.dismissSuggestion(suggestion)) {
            return;
        }
        context.getPackageManager().setComponentEnabledSetting(
@@ -155,19 +143,6 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
                PackageManager.DONT_KILL_APP);
    }

    private boolean isShowingFirstImpressionSuggestion(Context context) {
        final String keySetupTime = CATEGORY_FIRST_IMPRESSION + SuggestionParser.SETUP_TIME;
        final long currentTime = System.currentTimeMillis();
        final SharedPreferences sharedPrefs = getSharedPrefs(context);
        if (!sharedPrefs.contains(keySetupTime)) {
            return true;
        }
        final long setupTime = sharedPrefs.getLong(keySetupTime, 0);
        final long elapsedTime = currentTime - setupTime;
        Log.d(TAG, "Day " + elapsedTime / DateUtils.DAY_IN_MILLIS + " for first impression");
        return elapsedTime <= FIRST_IMPRESSION_EXPIRE_DAY_IN_MILLIS;
    }

    @Override
    public String getSuggestionIdentifier(Context context, Tile suggestion) {
        if (suggestion.intent == null || suggestion.intent.getComponent() == null
+8 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.support.annotation.VisibleForTesting;
import android.support.v14.preference.PreferenceFragment;
import android.support.v7.preference.Preference;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -163,9 +164,15 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements

    public static void startBatteryDetailPage(SettingsActivity caller, PreferenceFragment fragment,
            String packageName) {
        final Bundle args = new Bundle(2);
        final Bundle args = new Bundle(3);
        final PackageManager packageManager = caller.getPackageManager();
        args.putString(EXTRA_PACKAGE_NAME, packageName);
        args.putString(EXTRA_POWER_USAGE_PERCENT, Utils.formatPercentage(0));
        try {
            args.putInt(EXTRA_UID, packageManager.getPackageUid(packageName, 0 /* no flag */));
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(TAG, "Cannot find package: " + packageName, e);
        }

        caller.startPreferencePanelAsUser(fragment, AdvancedPowerUsageDetail.class.getName(), args,
                R.string.battery_details_title, null, new UserHandle(UserHandle.myUserId()));
+6 −2
Original line number Diff line number Diff line
@@ -88,8 +88,7 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
    public TetherPreferenceController(Context context, Lifecycle lifecycle) {
        super(context);
        mBluetoothPan = new AtomicReference<>();
        mAdminDisallowedTetherConfig = checkIfRestrictionEnforced(
                mContext, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
        mAdminDisallowedTetherConfig = isTetherConfigDisallowed(context);
        mConnectivityManager =
                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
@@ -170,6 +169,11 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
        }
    }

    public static boolean isTetherConfigDisallowed(Context context) {
        return checkIfRestrictionEnforced(
                context, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
    }

    @VisibleForTesting
    void updateSummary() {
        if (mPreference == null) {
Loading