Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -181,10 +181,8 @@ public final class AutofillManagerService extends SystemService { for (int i = 0; i < users.size(); i++) { final int userId = users.get(i).id; final boolean disabled = umi.getUserRestriction(userId, UserManager.DISALLOW_AUTOFILL); if (disabled) { if (disabled) { Slog.i(TAG, "Disabling Autofill for user " + userId); } mDisabledUsers.put(userId, disabled); } } Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +18 −24 Original line number Diff line number Diff line Loading @@ -185,23 +185,6 @@ final class AutofillManagerServiceImpl { updateLocked(disabled); } @Nullable CharSequence getServiceName() { final String packageName = getServicePackageName(); if (packageName == null) { return null; } try { final PackageManager pm = mContext.getPackageManager(); final ApplicationInfo info = pm.getApplicationInfo(packageName, 0); return pm.getApplicationLabel(info); } catch (Exception e) { Slog.e(TAG, "Could not get label for " + packageName + ": " + e); return packageName; } } @GuardedBy("mLock") private int getServiceUidLocked() { if (mInfo == null) { Loading @@ -226,6 +209,7 @@ final class AutofillManagerServiceImpl { return null; } @Nullable ComponentName getServiceComponentName() { synchronized (mLock) { if (mInfo == null) { Loading Loading @@ -706,17 +690,27 @@ final class AutofillManagerServiceImpl { } } @NonNull CharSequence getServiceLabel() { final CharSequence label = mInfo.getServiceInfo().loadSafeLabel( /** * Gets the user-visibile name of the service this service binds to, or {@code null} if the * service is disabled. */ @Nullable @GuardedBy("mLock") public CharSequence getServiceLabelLocked() { return mInfo == null ? null : mInfo.getServiceInfo().loadSafeLabel( mContext.getPackageManager(), 0 /* do not ellipsize */, PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE | PackageItemInfo.SAFE_LABEL_FLAG_TRIM); return label; } /** * Gets the icon of the service this service binds to, or {@code null} if the service is * disabled. */ @NonNull Drawable getServiceIcon() { return mInfo.getServiceInfo().loadIcon(mContext.getPackageManager()); @Nullable @GuardedBy("mLock") Drawable getServiceIconLocked() { return mInfo == null ? null : mInfo.getServiceInfo().loadIcon(mContext.getPackageManager()); } /** Loading Loading @@ -959,7 +953,7 @@ final class AutofillManagerServiceImpl { } else { pw.println(); mInfo.dump(prefix2, pw); pw.print(prefix); pw.print("Service Label: "); pw.println(getServiceLabel()); pw.print(prefix); pw.print("Service Label: "); pw.println(getServiceLabelLocked()); pw.print(prefix); pw.print("Target SDK: "); pw.println(getTargedSdkLocked()); } pw.print(prefix); pw.print("Component from settings: "); Loading services/autofill/java/com/android/server/autofill/Session.java +24 −8 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.content.Intent; import android.content.IntentSender; import android.graphics.Bitmap; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.metrics.LogMaker; import android.os.Binder; import android.os.Build; Loading Loading @@ -1749,7 +1750,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState final IAutoFillManagerClient client = getClient(); mPendingSaveUi = new PendingUi(mActivityToken, id, client); getUiForShowing().showSaveUi(mService.getServiceLabel(), mService.getServiceIcon(), final CharSequence serviceLabel; final Drawable serviceIcon; synchronized (mLock) { serviceLabel = mService.getServiceLabelLocked(); serviceIcon = mService.getServiceIconLocked(); } if (serviceLabel == null || serviceIcon == null) { wtf(null, "showSaveLocked(): no service label or icon"); return true; } getUiForShowing().showSaveUi(serviceLabel, serviceIcon, mService.getServicePackageName(), saveInfo, this, mComponentName, this, mPendingSaveUi, isUpdate, mCompatMode); if (client != null) { Loading Loading @@ -2318,9 +2330,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState filterText = value.getTextValue().toString(); } final CharSequence serviceLabel; final Drawable serviceIcon; synchronized (mLock) { serviceLabel = mService.getServiceLabelLocked(); serviceIcon = mService.getServiceIconLocked(); } if (serviceLabel == null || serviceIcon == null) { wtf(null, "onFillReady(): no service label or icon"); return; } getUiForShowing().showFillUi(filledId, response, filterText, mService.getServicePackageName(), mComponentName, mService.getServiceLabel(), mService.getServiceIcon(), this, id, mCompatMode); serviceLabel, serviceIcon, this, id, mCompatMode); synchronized (mLock) { if (mUiShownTime == 0) { Loading Loading @@ -2655,12 +2677,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } CharSequence getServiceName() { synchronized (mLock) { return mService.getServiceName(); } } // TODO: this should never be null, but we got at least one occurrence, probably due to a race. @GuardedBy("mLock") @Nullable Loading services/autofill/java/com/android/server/autofill/ViewState.java +0 −4 Original line number Diff line number Diff line Loading @@ -141,10 +141,6 @@ final class ViewState { mResponse = response; } CharSequence getServiceName() { return mSession.getServiceName(); } int getState() { return mState; } Loading Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -181,10 +181,8 @@ public final class AutofillManagerService extends SystemService { for (int i = 0; i < users.size(); i++) { final int userId = users.get(i).id; final boolean disabled = umi.getUserRestriction(userId, UserManager.DISALLOW_AUTOFILL); if (disabled) { if (disabled) { Slog.i(TAG, "Disabling Autofill for user " + userId); } mDisabledUsers.put(userId, disabled); } } Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +18 −24 Original line number Diff line number Diff line Loading @@ -185,23 +185,6 @@ final class AutofillManagerServiceImpl { updateLocked(disabled); } @Nullable CharSequence getServiceName() { final String packageName = getServicePackageName(); if (packageName == null) { return null; } try { final PackageManager pm = mContext.getPackageManager(); final ApplicationInfo info = pm.getApplicationInfo(packageName, 0); return pm.getApplicationLabel(info); } catch (Exception e) { Slog.e(TAG, "Could not get label for " + packageName + ": " + e); return packageName; } } @GuardedBy("mLock") private int getServiceUidLocked() { if (mInfo == null) { Loading @@ -226,6 +209,7 @@ final class AutofillManagerServiceImpl { return null; } @Nullable ComponentName getServiceComponentName() { synchronized (mLock) { if (mInfo == null) { Loading Loading @@ -706,17 +690,27 @@ final class AutofillManagerServiceImpl { } } @NonNull CharSequence getServiceLabel() { final CharSequence label = mInfo.getServiceInfo().loadSafeLabel( /** * Gets the user-visibile name of the service this service binds to, or {@code null} if the * service is disabled. */ @Nullable @GuardedBy("mLock") public CharSequence getServiceLabelLocked() { return mInfo == null ? null : mInfo.getServiceInfo().loadSafeLabel( mContext.getPackageManager(), 0 /* do not ellipsize */, PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE | PackageItemInfo.SAFE_LABEL_FLAG_TRIM); return label; } /** * Gets the icon of the service this service binds to, or {@code null} if the service is * disabled. */ @NonNull Drawable getServiceIcon() { return mInfo.getServiceInfo().loadIcon(mContext.getPackageManager()); @Nullable @GuardedBy("mLock") Drawable getServiceIconLocked() { return mInfo == null ? null : mInfo.getServiceInfo().loadIcon(mContext.getPackageManager()); } /** Loading Loading @@ -959,7 +953,7 @@ final class AutofillManagerServiceImpl { } else { pw.println(); mInfo.dump(prefix2, pw); pw.print(prefix); pw.print("Service Label: "); pw.println(getServiceLabel()); pw.print(prefix); pw.print("Service Label: "); pw.println(getServiceLabelLocked()); pw.print(prefix); pw.print("Target SDK: "); pw.println(getTargedSdkLocked()); } pw.print(prefix); pw.print("Component from settings: "); Loading
services/autofill/java/com/android/server/autofill/Session.java +24 −8 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.content.Intent; import android.content.IntentSender; import android.graphics.Bitmap; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.metrics.LogMaker; import android.os.Binder; import android.os.Build; Loading Loading @@ -1749,7 +1750,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState final IAutoFillManagerClient client = getClient(); mPendingSaveUi = new PendingUi(mActivityToken, id, client); getUiForShowing().showSaveUi(mService.getServiceLabel(), mService.getServiceIcon(), final CharSequence serviceLabel; final Drawable serviceIcon; synchronized (mLock) { serviceLabel = mService.getServiceLabelLocked(); serviceIcon = mService.getServiceIconLocked(); } if (serviceLabel == null || serviceIcon == null) { wtf(null, "showSaveLocked(): no service label or icon"); return true; } getUiForShowing().showSaveUi(serviceLabel, serviceIcon, mService.getServicePackageName(), saveInfo, this, mComponentName, this, mPendingSaveUi, isUpdate, mCompatMode); if (client != null) { Loading Loading @@ -2318,9 +2330,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState filterText = value.getTextValue().toString(); } final CharSequence serviceLabel; final Drawable serviceIcon; synchronized (mLock) { serviceLabel = mService.getServiceLabelLocked(); serviceIcon = mService.getServiceIconLocked(); } if (serviceLabel == null || serviceIcon == null) { wtf(null, "onFillReady(): no service label or icon"); return; } getUiForShowing().showFillUi(filledId, response, filterText, mService.getServicePackageName(), mComponentName, mService.getServiceLabel(), mService.getServiceIcon(), this, id, mCompatMode); serviceLabel, serviceIcon, this, id, mCompatMode); synchronized (mLock) { if (mUiShownTime == 0) { Loading Loading @@ -2655,12 +2677,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } CharSequence getServiceName() { synchronized (mLock) { return mService.getServiceName(); } } // TODO: this should never be null, but we got at least one occurrence, probably due to a race. @GuardedBy("mLock") @Nullable Loading
services/autofill/java/com/android/server/autofill/ViewState.java +0 −4 Original line number Diff line number Diff line Loading @@ -141,10 +141,6 @@ final class ViewState { mResponse = response; } CharSequence getServiceName() { return mSession.getServiceName(); } int getState() { return mState; } Loading