Do not accept an empty string in EditorInfo#packageName anymore.

In the previous CL Ib871141e3381e45c2623c5f4d692da7a7e78fcc5,
a null or empty EditorInfo#packageName was still allowed in case
there might be applications that simply forgot to set it.

However, after checking the code again, it would be safe to say
that having a null or an empty string in EditorInfo#packageName
would never happen unless the application intentionally clears it
in View#onCreateInputConnection. If there were such applications,
probably we could ask developers to stop doing that.

With this CL the system no longer accepts such an empty package
name.  IME developers do not need to handle such an exceptional
case in their side.

Bug: 18931038
Change-Id: I10d579b48b59fa8ada796e92d58517c6cc5f2230
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 69405cf..6e6fb7f 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -1323,21 +1323,17 @@
     }
 
     InputBindResult startInputUncheckedLocked(@NonNull ClientState cs,
-            IInputContext inputContext, EditorInfo attribute, int controlFlags) {
+            IInputContext inputContext, @NonNull EditorInfo attribute, int controlFlags) {
         // If no method is currently selected, do nothing.
         if (mCurMethodId == null) {
             return mNoBinding;
         }
 
-        if (attribute != null) {
-            // We accept an empty package name as a valid data.
-            if (!TextUtils.isEmpty(attribute.packageName) &&
-                    !InputMethodUtils.checkIfPackageBelongsToUid(mAppOpsManager, cs.uid,
-                            attribute.packageName)) {
-                Slog.e(TAG, "Rejecting this client as it reported an invalid package name."
-                        + " uid=" + cs.uid + " package=" + attribute.packageName);
-                return mNoBinding;
-            }
+        if (!InputMethodUtils.checkIfPackageBelongsToUid(mAppOpsManager, cs.uid,
+                attribute.packageName)) {
+            Slog.e(TAG, "Rejecting this client as it reported an invalid package name."
+                    + " uid=" + cs.uid + " package=" + attribute.packageName);
+            return mNoBinding;
         }
 
         if (mCurClient != cs) {