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

Commit 6be077a2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Using an official API for opening DWB properties of a task" into ub-launcher3-master

parents 6a6f0ff9 1d9ecae3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.quickstep.views;

import static android.provider.Settings.ACTION_APP_USAGE_SETTINGS;

import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -47,6 +49,8 @@ import java.time.Duration;
import java.util.Locale;

public final class DigitalWellBeingToast extends LinearLayout {
    static final Intent OPEN_APP_USAGE_SETTINGS_TEMPLATE = new Intent(ACTION_APP_USAGE_SETTINGS);

    public interface InitializeCallback {
        void call(float saturation, String contentDescription);
    }
@@ -189,7 +193,7 @@ public final class DigitalWellBeingToast extends LinearLayout {
    }

    public void openAppUsageSettings() {
        final Intent intent = new Intent(TaskView.SEE_TIME_IN_APP_TEMPLATE)
        final Intent intent = new Intent(OPEN_APP_USAGE_SETTINGS_TEMPLATE)
                .putExtra(Intent.EXTRA_PACKAGE_NAME,
                        mTask.getTopComponent().getPackageName()).addFlags(
                        Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+0 −3
Original line number Diff line number Diff line
@@ -133,9 +133,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
                }
            };

    static final Intent SEE_TIME_IN_APP_TEMPLATE =
            new Intent("com.android.settings.action.TIME_SPENT_IN_APP");

    private final OnAttachStateChangeListener mTaskMenuStateListener =
            new OnAttachStateChangeListener() {
                @Override