Activity.java (39791594560b2326625b663ed6796882900c220f) Activity.java (d1ac18c7c9eca1b07120be598dc6859b188baeb3)
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

--- 962 unchanged lines hidden (view full) ---

971 * @see #onRestoreInstanceState
972 * @see #onPostCreate
973 */
974 @MainThread
975 @CallSuper
976 protected void onCreate(@Nullable Bundle savedInstanceState) {
977 if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState);
978
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

--- 962 unchanged lines hidden (view full) ---

971 * @see #onRestoreInstanceState
972 * @see #onPostCreate
973 */
974 @MainThread
975 @CallSuper
976 protected void onCreate(@Nullable Bundle savedInstanceState) {
977 if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState);
978
979 if (getApplicationInfo().targetSdkVersion >= O && mActivityInfo.isFixedOrientation()) {
979 if (getApplicationInfo().targetSdkVersion > O && mActivityInfo.isFixedOrientation()) {
980 final TypedArray ta = obtainStyledAttributes(com.android.internal.R.styleable.Window);
981 final boolean isTranslucentOrFloating = ActivityInfo.isTranslucentOrFloating(ta);
982 ta.recycle();
983
984 if (isTranslucentOrFloating) {
985 throw new IllegalStateException(
986 "Only fullscreen opaque activities can request orientation");
987 }

--- 6281 unchanged lines hidden (view full) ---

7269 if (viewRoot.getView() != null
7270 && viewRoot.getView().dispatchActivityResult(
7271 who, requestCode, resultCode, data)) {
7272 return;
7273 }
7274 }
7275 } else if (who.startsWith(AUTO_FILL_AUTH_WHO_PREFIX)) {
7276 Intent resultData = (resultCode == Activity.RESULT_OK) ? data : null;
980 final TypedArray ta = obtainStyledAttributes(com.android.internal.R.styleable.Window);
981 final boolean isTranslucentOrFloating = ActivityInfo.isTranslucentOrFloating(ta);
982 ta.recycle();
983
984 if (isTranslucentOrFloating) {
985 throw new IllegalStateException(
986 "Only fullscreen opaque activities can request orientation");
987 }

--- 6281 unchanged lines hidden (view full) ---

7269 if (viewRoot.getView() != null
7270 && viewRoot.getView().dispatchActivityResult(
7271 who, requestCode, resultCode, data)) {
7272 return;
7273 }
7274 }
7275 } else if (who.startsWith(AUTO_FILL_AUTH_WHO_PREFIX)) {
7276 Intent resultData = (resultCode == Activity.RESULT_OK) ? data : null;
7277 getAutofillManager().onAuthenticationResult(resultData);
7277 getAutofillManager().onAuthenticationResult(requestCode, resultData);
7278 } else {
7279 Fragment frag = mFragments.findFragmentByWho(who);
7280 if (frag != null) {
7281 frag.onActivityResult(requestCode, resultCode, data);
7282 }
7283 }
7284 }
7285

--- 128 unchanged lines hidden (view full) ---

7414 PackageManager.EXTRA_REQUEST_PERMISSIONS_NAMES) : new String[0];
7415 final int[] grantResults = (data != null) ? data.getIntArrayExtra(
7416 PackageManager.EXTRA_REQUEST_PERMISSIONS_RESULTS) : new int[0];
7417 fragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
7418 }
7419
7420 /** @hide */
7421 @Override
7278 } else {
7279 Fragment frag = mFragments.findFragmentByWho(who);
7280 if (frag != null) {
7281 frag.onActivityResult(requestCode, resultCode, data);
7282 }
7283 }
7284 }
7285

--- 128 unchanged lines hidden (view full) ---

7414 PackageManager.EXTRA_REQUEST_PERMISSIONS_NAMES) : new String[0];
7415 final int[] grantResults = (data != null) ? data.getIntArrayExtra(
7416 PackageManager.EXTRA_REQUEST_PERMISSIONS_RESULTS) : new int[0];
7417 fragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
7418 }
7419
7420 /** @hide */
7421 @Override
7422 final public void autofillCallbackAuthenticate(IntentSender intent, Intent fillInIntent) {
7422 final public void autofillCallbackAuthenticate(int authenticationId, IntentSender intent,
7423 Intent fillInIntent) {
7423 try {
7424 startIntentSenderForResultInner(intent, AUTO_FILL_AUTH_WHO_PREFIX,
7424 try {
7425 startIntentSenderForResultInner(intent, AUTO_FILL_AUTH_WHO_PREFIX,
7425 0, fillInIntent, 0, 0, null);
7426 authenticationId, fillInIntent, 0, 0, null);
7426 } catch (IntentSender.SendIntentException e) {
7427 Log.e(TAG, "authenticate() failed for intent:" + intent, e);
7428 }
7429 }
7430
7431 /** @hide */
7432 @Override
7433 final public void autofillCallbackResetableStateAvailable() {

--- 5 unchanged lines hidden (view full) ---

7439 final public boolean autofillCallbackRequestShowFillUi(@NonNull View anchor, int width,
7440 int height, @Nullable Rect anchorBounds, IAutofillWindowPresenter presenter) {
7441 final Rect actualAnchorBounds = new Rect();
7442 anchor.getBoundsOnScreen(actualAnchorBounds);
7443
7444 final int offsetX = (anchorBounds != null)
7445 ? anchorBounds.left - actualAnchorBounds.left : 0;
7446 int offsetY = (anchorBounds != null)
7427 } catch (IntentSender.SendIntentException e) {
7428 Log.e(TAG, "authenticate() failed for intent:" + intent, e);
7429 }
7430 }
7431
7432 /** @hide */
7433 @Override
7434 final public void autofillCallbackResetableStateAvailable() {

--- 5 unchanged lines hidden (view full) ---

7440 final public boolean autofillCallbackRequestShowFillUi(@NonNull View anchor, int width,
7441 int height, @Nullable Rect anchorBounds, IAutofillWindowPresenter presenter) {
7442 final Rect actualAnchorBounds = new Rect();
7443 anchor.getBoundsOnScreen(actualAnchorBounds);
7444
7445 final int offsetX = (anchorBounds != null)
7446 ? anchorBounds.left - actualAnchorBounds.left : 0;
7447 int offsetY = (anchorBounds != null)
7447 ? anchorBounds.bottom - actualAnchorBounds.bottom : 0;
7448 ? anchorBounds.top - actualAnchorBounds.top : 0;
7448
7449 final boolean wasShowing;
7450
7451 if (mAutofillPopupWindow == null) {
7452 wasShowing = false;
7453 mAutofillPopupWindow = new AutofillPopupWindow(presenter);
7454 } else {
7455 wasShowing = mAutofillPopupWindow.isShowing();

--- 214 unchanged lines hidden ---
7449
7450 final boolean wasShowing;
7451
7452 if (mAutofillPopupWindow == null) {
7453 wasShowing = false;
7454 mAutofillPopupWindow = new AutofillPopupWindow(presenter);
7455 } else {
7456 wasShowing = mAutofillPopupWindow.isShowing();

--- 214 unchanged lines hidden ---