Developer QS tile: Show Layout.
Bug: 27872042 Change-Id: I0df2ffecbf7d2682d89c9b8343590bb04bcc305c
This commit is contained in:
@@ -2078,7 +2078,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
||||
}
|
||||
};
|
||||
|
||||
static class SystemPropPoker extends AsyncTask<Void, Void, Void> {
|
||||
public static class SystemPropPoker extends AsyncTask<Void, Void, Void> {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
String[] services = ServiceManager.listServices();
|
||||
|
46
src/com/android/settings/qstile/ShowLayout.java
Normal file
46
src/com/android/settings/qstile/ShowLayout.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.qstile;
|
||||
|
||||
import android.os.SystemProperties;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
import android.view.View;
|
||||
import com.android.settings.DevelopmentSettings;
|
||||
|
||||
public class ShowLayout extends TileService {
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
getQsTile().setState(
|
||||
SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false)
|
||||
? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
getQsTile().updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
SystemProperties.set(View.DEBUG_LAYOUT_PROPERTY,
|
||||
getQsTile().getState() == Tile.STATE_INACTIVE ? "true" : "false");
|
||||
new DevelopmentSettings.SystemPropPoker().execute(); // Settings app magic
|
||||
refresh();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user