Loading cmds/telecom/src/com/android/commands/telecom/Telecom.java +13 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ public final class Telecom extends BaseCommand { private static final String COMMAND_UNREGISTER_PHONE_ACCOUNT = "unregister-phone-account"; private static final String COMMAND_SET_DEFAULT_DIALER = "set-default-dialer"; private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer"; private static final String COMMAND_STOP_BLOCK_SUPPRESSION = "stop-block-suppression"; /** * Change the system dialer package name if a package name was specified, * Example: adb shell telecom set-system-dialer <PACKAGE> Loading Loading @@ -115,6 +117,8 @@ public final class Telecom extends BaseCommand { + "usage: telecom set-sim-count <COUNT>\n" + "usage: telecom get-sim-config\n" + "usage: telecom get-max-phones\n" + "usage: telecom stop-block-suppression: Stop suppressing the blocked number" + " provider after a call to emergency services.\n" + "usage: telecom set-emer-phone-account-filter <PACKAGE>\n" + "\n" + "telecom set-phone-account-enabled: Enables the given phone account, if it has" Loading Loading @@ -207,6 +211,9 @@ public final class Telecom extends BaseCommand { case COMMAND_UNREGISTER_PHONE_ACCOUNT: runUnregisterPhoneAccount(); break; case COMMAND_STOP_BLOCK_SUPPRESSION: runStopBlockSuppression(); break; case COMMAND_SET_DEFAULT_DIALER: runSetDefaultDialer(); break; Loading Loading @@ -324,8 +331,13 @@ public final class Telecom extends BaseCommand { System.out.println("Success - " + handle + " unregistered."); } private void runStopBlockSuppression() throws RemoteException { mTelecomService.stopBlockSuppression(); } private void runSetDefaultDialer() throws RemoteException { final String packageName = nextArgRequired(); String packageName = nextArg(); if ("default".equals(packageName)) packageName = null; mTelecomService.setTestDefaultDialer(packageName); System.out.println("Success - " + packageName + " set as override default dialer."); } Loading core/java/android/app/ContextImpl.java +22 −17 Original line number Diff line number Diff line Loading @@ -1900,26 +1900,31 @@ class ContextImpl extends Context { @Override public Object getSystemService(String name) { if (vmIncorrectContextUseEnabled()) { // We may override this API from outer context. final boolean isUiContext = isUiContext() || getOuterContext().isUiContext(); final boolean isUiContext = isUiContext() || isOuterUiContext(); // Check incorrect Context usage. if (isUiComponent(name) && !isUiContext && vmIncorrectContextUseEnabled()) { if (isUiComponent(name) && !isUiContext) { final String errorMessage = "Tried to access visual service " + SystemServiceRegistry.getSystemServiceClassName(name) + " from a non-visual Context:" + getOuterContext(); final String message = "Visual services, such as WindowManager, WallpaperService or " + "LayoutInflater should be accessed from Activity or other visual Context. " + "Use an Activity or a Context created with " + "Context#createWindowContext(int, Bundle), which are adjusted to the " + "configuration and visual bounds of an area on screen."; final String message = "Visual services, such as WindowManager, WallpaperService " + "or LayoutInflater should be accessed from Activity or other visual " + "Context. Use an Activity or a Context created with " + "Context#createWindowContext(int, Bundle), which are adjusted to " + "the configuration and visual bounds of an area on screen."; final Exception exception = new IllegalAccessException(errorMessage); StrictMode.onIncorrectContextUsed(message, exception); Log.e(TAG, errorMessage + message, exception); Log.e(TAG, errorMessage + " " + message, exception); } } return SystemServiceRegistry.getSystemService(this, name); } private boolean isOuterUiContext() { return getOuterContext() != null && getOuterContext().isUiContext(); } @Override public String getSystemServiceName(Class<?> serviceClass) { return SystemServiceRegistry.getSystemServiceName(serviceClass); Loading Loading @@ -2371,7 +2376,7 @@ class ContextImpl extends Context { context.setResources(createResources(mToken, mPackageInfo, mSplitName, displayId, overrideConfiguration, getDisplayAdjustments(displayId).getCompatibilityInfo(), mResources.getLoaders())); context.mIsUiContext = isUiContext() || getOuterContext().isUiContext(); context.mIsUiContext = isUiContext() || isOuterUiContext(); return context; } Loading core/java/android/content/ContextWrapper.java +3 −0 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,9 @@ public class ContextWrapper extends Context { */ @Override public boolean isUiContext() { if (mBase == null) { return false; } return mBase.isUiContext(); } } core/java/android/content/pm/PackageManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -4666,8 +4666,7 @@ public abstract class PackageManager { * Marks an application exempt from having its permissions be automatically revoked when * the app is unused for an extended period of time. * * Only the installer on record that installed the given package, or a holder of * {@code WHITELIST_AUTO_REVOKE_PERMISSIONS} is allowed to call this. * Only the installer on record that installed the given package is allowed to call this. * * Packages start in whitelisted state, and it is the installer's responsibility to * un-whitelist the packages it installs, unless auto-revoking permissions from that package Loading core/java/android/inputmethodservice/InlineSuggestionSession.java +5 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,11 @@ class InlineSuggestionSession { */ @MainThread void invalidate() { try { mCallback.onInlineSuggestionsSessionInvalidated(); } catch (RemoteException e) { Log.w(TAG, "onInlineSuggestionsSessionInvalidated() remote exception:" + e); } if (mResponseCallback != null) { consumeInlineSuggestionsResponse(EMPTY_RESPONSE); mResponseCallback.invalidate(); Loading Loading
cmds/telecom/src/com/android/commands/telecom/Telecom.java +13 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ public final class Telecom extends BaseCommand { private static final String COMMAND_UNREGISTER_PHONE_ACCOUNT = "unregister-phone-account"; private static final String COMMAND_SET_DEFAULT_DIALER = "set-default-dialer"; private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer"; private static final String COMMAND_STOP_BLOCK_SUPPRESSION = "stop-block-suppression"; /** * Change the system dialer package name if a package name was specified, * Example: adb shell telecom set-system-dialer <PACKAGE> Loading Loading @@ -115,6 +117,8 @@ public final class Telecom extends BaseCommand { + "usage: telecom set-sim-count <COUNT>\n" + "usage: telecom get-sim-config\n" + "usage: telecom get-max-phones\n" + "usage: telecom stop-block-suppression: Stop suppressing the blocked number" + " provider after a call to emergency services.\n" + "usage: telecom set-emer-phone-account-filter <PACKAGE>\n" + "\n" + "telecom set-phone-account-enabled: Enables the given phone account, if it has" Loading Loading @@ -207,6 +211,9 @@ public final class Telecom extends BaseCommand { case COMMAND_UNREGISTER_PHONE_ACCOUNT: runUnregisterPhoneAccount(); break; case COMMAND_STOP_BLOCK_SUPPRESSION: runStopBlockSuppression(); break; case COMMAND_SET_DEFAULT_DIALER: runSetDefaultDialer(); break; Loading Loading @@ -324,8 +331,13 @@ public final class Telecom extends BaseCommand { System.out.println("Success - " + handle + " unregistered."); } private void runStopBlockSuppression() throws RemoteException { mTelecomService.stopBlockSuppression(); } private void runSetDefaultDialer() throws RemoteException { final String packageName = nextArgRequired(); String packageName = nextArg(); if ("default".equals(packageName)) packageName = null; mTelecomService.setTestDefaultDialer(packageName); System.out.println("Success - " + packageName + " set as override default dialer."); } Loading
core/java/android/app/ContextImpl.java +22 −17 Original line number Diff line number Diff line Loading @@ -1900,26 +1900,31 @@ class ContextImpl extends Context { @Override public Object getSystemService(String name) { if (vmIncorrectContextUseEnabled()) { // We may override this API from outer context. final boolean isUiContext = isUiContext() || getOuterContext().isUiContext(); final boolean isUiContext = isUiContext() || isOuterUiContext(); // Check incorrect Context usage. if (isUiComponent(name) && !isUiContext && vmIncorrectContextUseEnabled()) { if (isUiComponent(name) && !isUiContext) { final String errorMessage = "Tried to access visual service " + SystemServiceRegistry.getSystemServiceClassName(name) + " from a non-visual Context:" + getOuterContext(); final String message = "Visual services, such as WindowManager, WallpaperService or " + "LayoutInflater should be accessed from Activity or other visual Context. " + "Use an Activity or a Context created with " + "Context#createWindowContext(int, Bundle), which are adjusted to the " + "configuration and visual bounds of an area on screen."; final String message = "Visual services, such as WindowManager, WallpaperService " + "or LayoutInflater should be accessed from Activity or other visual " + "Context. Use an Activity or a Context created with " + "Context#createWindowContext(int, Bundle), which are adjusted to " + "the configuration and visual bounds of an area on screen."; final Exception exception = new IllegalAccessException(errorMessage); StrictMode.onIncorrectContextUsed(message, exception); Log.e(TAG, errorMessage + message, exception); Log.e(TAG, errorMessage + " " + message, exception); } } return SystemServiceRegistry.getSystemService(this, name); } private boolean isOuterUiContext() { return getOuterContext() != null && getOuterContext().isUiContext(); } @Override public String getSystemServiceName(Class<?> serviceClass) { return SystemServiceRegistry.getSystemServiceName(serviceClass); Loading Loading @@ -2371,7 +2376,7 @@ class ContextImpl extends Context { context.setResources(createResources(mToken, mPackageInfo, mSplitName, displayId, overrideConfiguration, getDisplayAdjustments(displayId).getCompatibilityInfo(), mResources.getLoaders())); context.mIsUiContext = isUiContext() || getOuterContext().isUiContext(); context.mIsUiContext = isUiContext() || isOuterUiContext(); return context; } Loading
core/java/android/content/ContextWrapper.java +3 −0 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,9 @@ public class ContextWrapper extends Context { */ @Override public boolean isUiContext() { if (mBase == null) { return false; } return mBase.isUiContext(); } }
core/java/android/content/pm/PackageManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -4666,8 +4666,7 @@ public abstract class PackageManager { * Marks an application exempt from having its permissions be automatically revoked when * the app is unused for an extended period of time. * * Only the installer on record that installed the given package, or a holder of * {@code WHITELIST_AUTO_REVOKE_PERMISSIONS} is allowed to call this. * Only the installer on record that installed the given package is allowed to call this. * * Packages start in whitelisted state, and it is the installer's responsibility to * un-whitelist the packages it installs, unless auto-revoking permissions from that package Loading
core/java/android/inputmethodservice/InlineSuggestionSession.java +5 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,11 @@ class InlineSuggestionSession { */ @MainThread void invalidate() { try { mCallback.onInlineSuggestionsSessionInvalidated(); } catch (RemoteException e) { Log.w(TAG, "onInlineSuggestionsSessionInvalidated() remote exception:" + e); } if (mResponseCallback != null) { consumeInlineSuggestionsResponse(EMPTY_RESPONSE); mResponseCallback.invalidate(); Loading