From 7219da8c9c723bea24faacf2e6b4c9daa32756eb Mon Sep 17 00:00:00 2001 From: Zhen Zhang Date: Tue, 18 Feb 2020 12:57:00 -0800 Subject: [PATCH] Replace explicit intent with implicit ACTION_TETHER_SETTINGS intent Using implicit intent will give us the freedom to handle it differently on Settings app side at runtime. This won't change the behavior of this QuickSettings Hotspot Tile. Bug: 149590956 Test: Built and flashed to crosshatch. Long clicking on Hotspot Tile will go to Tether Settings. Change-Id: I9f79ff7966b65f9a2ab3d69dfb4a5f50cad798d4 --- .../src/com/android/systemui/qs/tiles/HotspotTile.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java index 0c861573864d6..1ab77f3f75244 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java @@ -17,9 +17,9 @@ package com.android.systemui.qs.tiles; import android.annotation.Nullable; -import android.content.ComponentName; import android.content.Intent; import android.os.UserManager; +import android.provider.Settings; import android.service.quicksettings.Tile; import android.util.Log; import android.widget.Switch; @@ -36,9 +36,6 @@ import javax.inject.Inject; /** Quick settings tile: Hotspot **/ public class HotspotTile extends QSTileImpl { - private static final Intent TETHER_SETTINGS = new Intent().setComponent(new ComponentName( - "com.android.settings", "com.android.settings.TetherSettings")); - private final Icon mEnabledStatic = ResourceIcon.get(R.drawable.ic_hotspot); private final HotspotController mHotspotController; @@ -79,7 +76,7 @@ public class HotspotTile extends QSTileImpl { @Override public Intent getLongClickIntent() { - return new Intent(TETHER_SETTINGS); + return new Intent(Settings.ACTION_TETHER_SETTINGS); } @Override