Merge "Unhide Activity Launch for TileService API"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8462ad189b
@@ -40318,12 +40318,14 @@ package android.service.quicksettings {
|
||||
|
||||
public final class Tile implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method @Nullable public android.app.PendingIntent getActivityLaunchForClick();
|
||||
method public CharSequence getContentDescription();
|
||||
method public android.graphics.drawable.Icon getIcon();
|
||||
method public CharSequence getLabel();
|
||||
method public int getState();
|
||||
method @Nullable public CharSequence getStateDescription();
|
||||
method @Nullable public CharSequence getSubtitle();
|
||||
method public void setActivityLaunchForClick(@Nullable android.app.PendingIntent);
|
||||
method public void setContentDescription(CharSequence);
|
||||
method public void setIcon(android.graphics.drawable.Icon);
|
||||
method public void setLabel(CharSequence);
|
||||
@@ -40352,6 +40354,7 @@ package android.service.quicksettings {
|
||||
method public static final void requestListeningState(android.content.Context, android.content.ComponentName);
|
||||
method public final void showDialog(android.app.Dialog);
|
||||
method public final void startActivityAndCollapse(android.content.Intent);
|
||||
method public final void startActivityAndCollapse(@NonNull android.app.PendingIntent);
|
||||
method public final void unlockAndRun(Runnable);
|
||||
field public static final String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
|
||||
field public static final String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
|
||||
|
||||
@@ -227,7 +227,6 @@ public final class Tile implements Parcelable {
|
||||
|
||||
/**
|
||||
* Gets the Activity {@link PendingIntent} to be launched when the tile is clicked.
|
||||
* @hide
|
||||
*/
|
||||
@Nullable
|
||||
public PendingIntent getActivityLaunchForClick() {
|
||||
@@ -243,7 +242,6 @@ public final class Tile implements Parcelable {
|
||||
* (This is the default behavior if this method is never called.)
|
||||
* @param pendingIntent a PendingIntent for an activity to be launched onclick, or {@code null}
|
||||
* to handle the clicks in the `TileService`.
|
||||
* @hide
|
||||
*/
|
||||
public void setActivityLaunchForClick(@Nullable PendingIntent pendingIntent) {
|
||||
if (pendingIntent != null && !pendingIntent.isActivity()) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package android.service.quicksettings;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SdkConstant;
|
||||
import android.annotation.SdkConstant.SdkConstantType;
|
||||
import android.annotation.SystemApi;
|
||||
@@ -41,6 +42,8 @@ import android.view.WindowManager;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A TileService provides the user a tile that can be added to Quick Settings.
|
||||
* Quick Settings is a space provided that allows the user to change settings and
|
||||
@@ -341,9 +344,9 @@ public class TileService extends Service {
|
||||
* Will collapse Quick Settings after launching.
|
||||
*
|
||||
* @param pendingIntent A PendingIntent for an Activity to be launched immediately.
|
||||
* @hide
|
||||
*/
|
||||
public void startActivityAndCollapse(PendingIntent pendingIntent) {
|
||||
public final void startActivityAndCollapse(@NonNull PendingIntent pendingIntent) {
|
||||
Objects.requireNonNull(pendingIntent);
|
||||
try {
|
||||
mService.startActivity(mTileToken, pendingIntent);
|
||||
} catch (RemoteException e) {
|
||||
|
||||
Reference in New Issue
Block a user