Restrict hotspot qs tile to admin user
Since hotspot setting is only available for admin user, the qs tile should be disabled for secondary users. Fixes: 29233745 Change-Id: Ie9777feef9650050a89dc42cc0e6436b4ef91471
This commit is contained in:
committed by
Jason Monk
parent
bd04ec31bd
commit
adcbed7459
@@ -16,12 +16,14 @@
|
||||
|
||||
package com.android.systemui.statusbar.policy;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.UserManager;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -49,7 +51,8 @@ public class HotspotControllerImpl implements HotspotController {
|
||||
@Override
|
||||
public boolean isHotspotSupported() {
|
||||
return mConnectivityManager.isTetheringSupported()
|
||||
&& mConnectivityManager.getTetherableWifiRegexs().length != 0;
|
||||
&& mConnectivityManager.getTetherableWifiRegexs().length != 0
|
||||
&& UserManager.get(mContext).isUserAdmin(ActivityManager.getCurrentUser());
|
||||
}
|
||||
|
||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user