Move Panel to public API
Change the SettingsPanelActivity to reference the public API. Bug: 117804442 Test: robolectric, manual app Change-Id: I4b128ae9d97c1000fdaa0c3fb5b94f8dc096055f
This commit is contained in:
@@ -16,11 +16,9 @@
|
||||
|
||||
package com.android.settings.panel;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
@@ -35,8 +33,6 @@ import com.android.settings.R;
|
||||
|
||||
/**
|
||||
* Dialog Activity to host Settings Slices.
|
||||
*
|
||||
* TODO link to action / framework API
|
||||
*/
|
||||
public class SettingsPanelActivity extends FragmentActivity {
|
||||
|
||||
@@ -47,28 +43,10 @@ public class SettingsPanelActivity extends FragmentActivity {
|
||||
*/
|
||||
public static final String KEY_PANEL_TYPE_ARGUMENT = "PANEL_TYPE_ARGUMENT";
|
||||
|
||||
|
||||
// TODO (b/117804442) move to framework
|
||||
public static final String EXTRA_PANEL_TYPE = "com.android.settings.panel.extra";
|
||||
|
||||
// TODO (b/117804442) move to framework
|
||||
public static final String PANEL_TYPE_WIFI = "wifi_panel";
|
||||
|
||||
// TODO (b/117804442) move to framework
|
||||
public static final String PANEL_TYPE_VOLUME = "volume_panel";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final ComponentName callingActivityName = getCallingActivity();
|
||||
|
||||
if (callingActivityName == null) {
|
||||
Log.e(TAG, "Must start with startActivityForResult. Closing.");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
final Intent callingIntent = getIntent();
|
||||
if (callingIntent == null) {
|
||||
Log.e(TAG, "Null intent, closing Panel Activity");
|
||||
@@ -76,12 +54,6 @@ public class SettingsPanelActivity extends FragmentActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
final String typeExtra = callingIntent.getStringExtra(EXTRA_PANEL_TYPE);
|
||||
if (TextUtils.isEmpty(typeExtra)) {
|
||||
Log.e(TAG, "No intent passed, closing Panel Activity");
|
||||
return;
|
||||
}
|
||||
|
||||
setContentView(R.layout.settings_panel);
|
||||
|
||||
// Move the window to the bottom of screen, and make it take up the entire screen width.
|
||||
@@ -90,9 +62,8 @@ public class SettingsPanelActivity extends FragmentActivity {
|
||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putString(KEY_PANEL_TYPE_ARGUMENT, typeExtra);
|
||||
bundle.putString(KEY_PANEL_TYPE_ARGUMENT, callingIntent.getAction());
|
||||
|
||||
final PanelFragment panelFragment = new PanelFragment();
|
||||
panelFragment.setArguments(bundle);
|
||||
|
Reference in New Issue
Block a user