DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master

Bug: 120848293
Change-Id: I6eeee632ff6ee7f2d7395344a7887c44c7acd440
This commit is contained in:
Xin Li
2019-02-21 11:03:43 -08:00
162 changed files with 19055 additions and 39673 deletions

View File

@@ -16,9 +16,7 @@
package com.android.settings.development.qstile;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
@@ -29,7 +27,6 @@ import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.sysprop.DisplayProperties;
import androidx.annotation.VisibleForTesting;
import android.util.EventLog;
import android.util.Log;
import android.view.IWindowManager;
import android.view.ThreadedRenderer;
@@ -38,8 +35,6 @@ import android.view.WindowManagerGlobal;
import android.widget.Toast;
import com.android.internal.app.LocalePicker;
import com.android.internal.statusbar.IStatusBarService;
import com.android.settingslib.development.DevelopmentSettingsEnabler;
import com.android.settingslib.development.SystemPropPoker;
public abstract class DevelopmentTiles extends TileService {
@@ -56,33 +51,7 @@ public abstract class DevelopmentTiles extends TileService {
}
public void refresh() {
final int state;
if (!DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(this)) {
// Reset to disabled state if dev option is off.
if (isEnabled()) {
setIsEnabled(false);
SystemPropPoker.getInstance().poke();
}
final ComponentName cn = new ComponentName(getPackageName(), getClass().getName());
try {
getPackageManager().setComponentEnabledSetting(
cn, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
final IStatusBarService statusBarService = IStatusBarService.Stub.asInterface(
ServiceManager.checkService(Context.STATUS_BAR_SERVICE));
if (statusBarService != null) {
EventLog.writeEvent(0x534e4554, "117770924"); // SaftyNet
statusBarService.remTile(cn);
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to modify QS tile for component " +
cn.toString(), e);
}
state = Tile.STATE_UNAVAILABLE;
} else {
state = isEnabled() ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
}
getQsTile().setState(state);
getQsTile().setState(isEnabled() ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
getQsTile().updateTile();
}
@@ -273,4 +242,4 @@ public abstract class DevelopmentTiles extends TileService {
}
}
}
}
}