Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Settings: 提交

packages/apps/Settings


Commit MetaInfo

修订版ec84d44abfcf0048c1593654999a19593e100458 (tree)
时间2019-05-20 18:35:01
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Android 8.1.0 Release 64 (OPM8.190505.001)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCXNCVNwAKCRDorT+BmrEO
eKrzAJ40J6+oveYeH2Ohx3tQa6kLO5mivgCbB56PWFyrHvc+Fur00BTnpNHO82E=
=h3FG
-----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r64' into oreo-x86

Android 8.1.0 Release 64 (OPM8.190505.001)

更改概述

差异

--- a/src/com/android/settings/SmsDefaultDialog.java
+++ b/src/com/android/settings/SmsDefaultDialog.java
@@ -16,6 +16,8 @@
1616
1717 package com.android.settings;
1818
19+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
20+
1921 import android.content.ComponentName;
2022 import android.content.Context;
2123 import android.content.DialogInterface;
@@ -30,6 +32,8 @@ import android.text.TextUtils;
3032 import android.view.LayoutInflater;
3133 import android.view.View;
3234 import android.view.ViewGroup;
35+import android.view.Window;
36+import android.view.WindowManager;
3337 import android.widget.BaseAdapter;
3438 import android.widget.ImageView;
3539 import android.widget.TextView;
@@ -60,6 +64,22 @@ public final class SmsDefaultDialog extends AlertActivity implements
6064 }
6165
6266 @Override
67+ protected void onStart() {
68+ super.onStart();
69+ getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
70+ android.util.EventLog.writeEvent(0x534e4554, "120484087", -1, "");
71+ }
72+
73+ @Override
74+ protected void onStop() {
75+ super.onStop();
76+ final Window window = getWindow();
77+ final WindowManager.LayoutParams attrs = window.getAttributes();
78+ attrs.privateFlags &= ~PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
79+ window.setAttributes(attrs);
80+ }
81+
82+ @Override
6383 public void onClick(DialogInterface dialog, int which) {
6484 switch (which) {
6585 case BUTTON_POSITIVE:
@@ -84,7 +104,7 @@ public final class SmsDefaultDialog extends AlertActivity implements
84104 }
85105
86106 private boolean buildDialog(String packageName) {
87- TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
107+ TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
88108 if (!tm.isSmsCapable()) {
89109 // No phone, no SMS
90110 return false;
@@ -198,7 +218,7 @@ public final class SmsDefaultDialog extends AlertActivity implements
198218 } else {
199219 view.findViewById(R.id.default_label).setVisibility(View.GONE);
200220 }
201- ImageView imageView = (ImageView)view.findViewById(android.R.id.icon);
221+ ImageView imageView = (ImageView) view.findViewById(android.R.id.icon);
202222 imageView.setImageDrawable(item.icon);
203223 return view;
204224 }
--- a/src/com/android/settings/development/DevelopmentSettingsEnabler.java
+++ b/src/com/android/settings/development/DevelopmentSettingsEnabler.java
@@ -18,6 +18,8 @@ package com.android.settings.development;
1818
1919 import android.content.Context;
2020 import android.content.SharedPreferences;
21+import android.os.Build;
22+import android.os.UserManager;
2123 import android.provider.Settings;
2224
2325 import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -53,6 +55,17 @@ public class DevelopmentSettingsEnabler implements LifecycleObserver, OnResume {
5355 Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
5456 }
5557
58+ public static boolean isDevelopmentSettingsEnabled(Context context) {
59+ final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
60+ final boolean settingEnabled = Settings.Global.getInt(context.getContentResolver(),
61+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
62+ Build.TYPE.equals("eng") ? 1 : 0) != 0;
63+ final boolean hasRestriction = um.hasUserRestriction(
64+ UserManager.DISALLOW_DEBUGGING_FEATURES);
65+ final boolean isAdminOrDemo = um.isAdminUser() || um.isDemoUser();
66+ return isAdminOrDemo && !hasRestriction && settingEnabled;
67+ }
68+
5669 private void updateEnabledState() {
5770 mLastEnabledState = Settings.Global.getInt(mContext.getContentResolver(),
5871 Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
--- a/src/com/android/settings/qstile/DevelopmentTiles.java
+++ b/src/com/android/settings/qstile/DevelopmentTiles.java
@@ -16,20 +16,29 @@
1616
1717 package com.android.settings.qstile;
1818
19+import android.content.ComponentName;
20+import android.content.Context;
21+import android.content.pm.PackageManager;
1922 import android.os.RemoteException;
23+import android.os.ServiceManager;
2024 import android.os.SystemProperties;
2125 import android.provider.Settings;
2226 import android.service.quicksettings.Tile;
2327 import android.service.quicksettings.TileService;
28+import android.util.EventLog;
29+import android.util.Log;
2430 import android.view.IWindowManager;
2531 import android.view.ThreadedRenderer;
2632 import android.view.View;
2733 import android.view.WindowManagerGlobal;
2834
2935 import com.android.internal.app.LocalePicker;
36+import com.android.internal.statusbar.IStatusBarService;
37+import com.android.settings.development.DevelopmentSettingsEnabler;
3038 import com.android.settings.development.DevelopmentSettings;
3139
3240 public abstract class DevelopmentTiles extends TileService {
41+ private static final String TAG = "DevelopmentTiles";
3342
3443 protected abstract boolean isEnabled();
3544
@@ -42,7 +51,33 @@ public abstract class DevelopmentTiles extends TileService {
4251 }
4352
4453 public void refresh() {
45- getQsTile().setState(isEnabled() ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
54+ final int state;
55+ if (!DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(this)) {
56+ // Reset to disabled state if dev option is off.
57+ if (isEnabled()) {
58+ setIsEnabled(false);
59+ new DevelopmentSettings.SystemPropPoker().execute();
60+ }
61+ final ComponentName cn = new ComponentName(getPackageName(), getClass().getName());
62+ try {
63+ getPackageManager().setComponentEnabledSetting(
64+ cn, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
65+ PackageManager.DONT_KILL_APP);
66+ final IStatusBarService statusBarService = IStatusBarService.Stub.asInterface(
67+ ServiceManager.checkService(Context.STATUS_BAR_SERVICE));
68+ if (statusBarService != null) {
69+ EventLog.writeEvent(0x534e4554, "117770924"); // SaftyNet
70+ statusBarService.remTile(cn);
71+ }
72+ } catch (RemoteException e) {
73+ Log.e(TAG, "Failed to modify QS tile for component " +
74+ cn.toString(), e);
75+ }
76+ state = Tile.STATE_UNAVAILABLE;
77+ } else {
78+ state = isEnabled() ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
79+ }
80+ getQsTile().setState(state);
4681 getQsTile().updateTile();
4782 }
4883
@@ -131,4 +166,4 @@ public abstract class DevelopmentTiles extends TileService {
131166 } catch (RemoteException e) { }
132167 }
133168 }
134-}
\ No newline at end of file
169+}
Show on old repository browser